Files
desklock/firmware/main/desklock.h
T
jpmschweitzerandClaude Fable 5 b8974ec84f
Test, Build and Push / test-gateway (push) Successful in 10s
Test, Build and Push / release (push) Skipped
Test, Build and Push / build-gateway (push) Skipped
Wi-Fi data path FIXED: esp_hosted 2.12 on both chips + C6 SDIO auto-OTA
Root cause of the dead data path (assoc/scan/RPC fine, zero data
frames): esp-hosted 1.4.x is formally incompatible with IDF 5.5
(esp-hosted-mcu#47) and the factory C6 slave firmware was ancient
(couldn't even answer a version RPC). Waveshare's examples pin 1.4.* —
do not follow them.

Fix:
- host: espressif/esp_hosted ^2.12 (+ esp_wifi_remote 1.6)
- slave: 2.12.11 network_adapter.bin embedded in the app (c6_ota.c
  streams it to the C6 over the SDIO RPC channel at boot when the
  reported version is < 2.x; ~10s, no wires, idempotent)
- RAM diet for hosted 2.x's footprint (MEMPOOL_PREFER_SPIRAM,
  reduced WIFI_RMT buffers) — without it internal SRAM famine
  boot-loops in xTaskCreateStaticPinnedToCore before app_main
- conservative 20MHz SDIO clock for first verified data path

Verified on hardware: DHCP lease (even that healed), 8/8 pings to
router and tower-of-joy at 1-5ms, WebSocket to the gateway connected,
device registered at /devices as desklock-p4 with fw version.

Also: wifi_diag.c L1 SoftAP diagnostic mode (DESKLOCK-DIAG) with
review fixes, boot ping ladder in net.c, static-IP fallback,
face_status() line, docs for the whole failure taxonomy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 00:26:28 +02:00

54 lines
1.5 KiB
C

/* Shared app types and cross-module hooks. */
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
typedef enum {
FACE_BOOT, /* connecting — idle glyphs + status tag */
FACE_IDLE, /* clock, rare drips */
FACE_LISTENING, /* mic hot */
FACE_PENSIVE, /* transcribing / short waits */
FACE_EFFORT, /* Tatlock working: max rain + orbit + elapsed */
FACE_SPEAKING, /* mouth sync */
FACE_RAGE, /* request failed: table flip, auto-returns to idle */
FACE_ERROR, /* gateway unreachable */
} face_state_t;
/* face.c */
void face_init(void);
void face_set(face_state_t state); /* safe from any task */
face_state_t face_get(void);
void face_activity(void);
void face_status(const char *text); /* bottom status line (diag/boot) */ /* reset the power ladder to active */
/* audio.c */
void audio_init(void);
void audio_play_gong(void);
void audio_capture_start(void);
void audio_capture_stop(void);
void audio_playback_begin(void);
void audio_playback_feed(const uint8_t *data, size_t len);
void audio_playback_end(void);
bool audio_is_playing(void);
/* net.c */
void net_start(void);
/* gw_client.c */
void gw_start(void);
bool gw_connected(void);
void gw_send_text(const char *json);
void gw_send_bin(const uint8_t *data, size_t len);
/* wifi_diag.c */
void wifi_diag_start(void);
/* c6_ota.c */
void c6_ota_start(void);
/* desklock_main.c */
void app_on_touch(void);
void app_on_playback_done(void);