Fix touch crash + make rain a reachability signal + calm the alarm churn
TOUCH CRASH (the blue screen): app_on_touch ran a blocking WebSocket send (up to 5s) directly in the LVGL touch callback, stalling the MIPI-DSI flush into a garbage/blue frame + task-watchdog reboot on every tap. Now touch_cb only gives a semaphore; a dedicated app_task does the blocking sends, audio, and face changes off the render thread. WS send timeout cut 5s to 1.5s as belt-and-braces. RAIN = REACHABILITY (user request): rain now falls only while the gateway WebSocket is live (gated on gw_connected in rain_tick). It drains gracefully on disconnect, resumes on reconnect, a genuine glanceable reachable signal. Idle density bumped 2 to 4 so connected-idle reads distinctly from disconnected-black. CALM THE WEDGE CHURN (user request): transient wifi/WS drops no longer slam to the x_x error face or a CONNECTING banner. Boot goes straight to the calm idle face (dry until connected). Only a sustained 30s+ outage escalates to x_x (clock_cb); the ~15s wedge-recovery just shows a brief rain pause. Two fixes from adversarial concurrency review before flashing: - persistent single capture task (was xTaskCreate per utterance; a rapid re-tap or WS-stop-vs-app-start race could put two readers on one mic/I2S handle and corrupt the codec) - reset s_talking on disconnect (app_on_disconnect) so the first tap after a mid-utterance drop starts fresh, not the stop branch Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ static void wifi_event(void *arg, esp_event_base_t base, int32_t id, void *data)
|
||||
} else if (base == WIFI_EVENT && id == WIFI_EVENT_STA_DISCONNECTED) {
|
||||
wifi_event_sta_disconnected_t *dc = (wifi_event_sta_disconnected_t *)data;
|
||||
ESP_LOGW(TAG, "wifi disconnected (reason %d), retrying", dc ? dc->reason : -1);
|
||||
face_set(FACE_ERROR);
|
||||
/* rain drains via the gw_connected() gate; face stays calm (see face.c) */
|
||||
vTaskDelay(pdMS_TO_TICKS(3000));
|
||||
esp_wifi_connect();
|
||||
} else if (base == IP_EVENT && id == IP_EVENT_STA_GOT_IP) {
|
||||
|
||||
Reference in New Issue
Block a user