Make controller input best-effort and harden OTA rollback.

Accel/tap use fire-and-forget ESP-NOW with a 10 ms FreeRTOS-safe cadence, OTA recovers from seq gaps and auto-reboots after success, and bootloader app rollback confirms after a stable boot.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-01 22:16:28 +01:00
co-authored by Cursor
parent ae8ef40820
commit 178ab46cec
35 changed files with 236 additions and 79 deletions
+8 -3
View File
@@ -15,9 +15,10 @@
static const char *TAG = "[BLE_STREAM]";
#define BLE_STREAM_PERIOD_MIN_MS 8u
/* Min matches FreeRTOS tick (HZ=100 → 10 ms); 8 ms would delay 0 ticks. */
#define BLE_STREAM_PERIOD_MIN_MS 10u
#define BLE_STREAM_PERIOD_MAX_MS 16u
#define BLE_STREAM_PERIOD_DEFAULT_MS 16u
#define BLE_STREAM_PERIOD_DEFAULT_MS 10u
static uint32_t s_period_ms = BLE_STREAM_PERIOD_DEFAULT_MS;
static TaskHandle_t s_task;
@@ -164,7 +165,11 @@ static void ble_stream_task(void *param) {
}
}
vTaskDelay(pdMS_TO_TICKS(period));
TickType_t delay_ticks = pdMS_TO_TICKS(period);
if (delay_ticks < 1) {
delay_ticks = 1;
}
vTaskDelay(delay_ticks);
}
s_task = NULL;