handshake-capture-c6: SPI bus lock, SD v1.0.2 diagnostics, MUST_DO review
- SPI_Bus_Lock: serialize LCD + SD on shared SPI; pause display during SD - SD_Init after WiFi scan; SD_IsReady gating; serial [SD]/[CAP] diagnostics - MUST_DO_IMPROVEMENTS.md full firmware review backlog; README link - Bump HANDSHAKE_FIRMWARE_VERSION to 1.0.2 (header) Made-with: Cursor
This commit is contained in:
@@ -17,8 +17,6 @@ enum CaptureState {
|
||||
|
||||
CaptureState captureState = STATE_SCANNING;
|
||||
unsigned long capture_start_time = 0;
|
||||
// Hard cap per channel visit: should exceed MAX_OBSERVE_CYCLES * (observe + capture).
|
||||
const unsigned long CHANNEL_TIMEOUT_MS = 150000UL;
|
||||
|
||||
// ─── Live capture visual update ───
|
||||
|
||||
@@ -119,14 +117,17 @@ void setup() {
|
||||
Set_Backlight(100);
|
||||
Lvgl_Init();
|
||||
|
||||
// WiFi + scan before SD: shared SPI with LCD; radio init can affect first SD.begin timing.
|
||||
handshakeCaptureInit();
|
||||
WiFiScanner_Refresh();
|
||||
|
||||
HANDSHAKE_LOGLN("[SETUP] mounting SD after WiFi scan");
|
||||
if (!SD_Init()) {
|
||||
Ui_SetWifiStatus("SD: no card");
|
||||
} else {
|
||||
Ui_SetWifiStatus("SD OK");
|
||||
}
|
||||
|
||||
handshakeCaptureInit();
|
||||
WiFiScanner_Refresh();
|
||||
captureState = STATE_SCANNING;
|
||||
}
|
||||
|
||||
@@ -147,8 +148,10 @@ void loop() {
|
||||
break;
|
||||
}
|
||||
if (!SD_IsReady()) {
|
||||
HANDSHAKE_LOGLN("[CAP] SD not ready — calling SD_Init before capture");
|
||||
SD_Init();
|
||||
if (!SD_IsReady()) {
|
||||
HANDSHAKE_LOGLN("[CAP] BLOCKED: SD_IsReady still false — UI: Insert SD card");
|
||||
Ui_SetWifiStatus("Insert SD card");
|
||||
delay(800);
|
||||
break;
|
||||
@@ -186,7 +189,7 @@ void loop() {
|
||||
} else if (!any_active) {
|
||||
stopCapture();
|
||||
captureState = STATE_SCANNING;
|
||||
} else if (millis() - capture_start_time > CHANNEL_TIMEOUT_MS) {
|
||||
} else if (millis() - capture_start_time > HANDSHAKE_CHANNEL_TIMEOUT_MS) {
|
||||
Ui_SetWifiStatus("Ch timeout");
|
||||
stopCapture();
|
||||
captureState = STATE_SCANNING;
|
||||
|
||||
Reference in New Issue
Block a user