firmware: v17 — waitForReady restaurado, sin watchdog
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
// ================================================================
|
||||
// OTA CONFIG
|
||||
// ================================================================
|
||||
#define FW_VERSION 16
|
||||
#define FW_VERSION 17
|
||||
#define GITEA_HOST "https://git.nacho.myds.me"
|
||||
#define GITEA_OWNER "Natxo"
|
||||
#define GITEA_REPO "Arduino-Car"
|
||||
@@ -24,6 +24,29 @@ const char *password = "Suprak1llm1ndS23S";
|
||||
void startCameraServer();
|
||||
void setupLedFlash();
|
||||
|
||||
static void handshakeTask(void *) {
|
||||
unsigned long deadline = millis() + 30000UL;
|
||||
String buf = "";
|
||||
while (millis() < deadline) {
|
||||
Serial.print("GO\n");
|
||||
unsigned long t = millis();
|
||||
while (millis() - t < 300) {
|
||||
while (Serial.available()) {
|
||||
char c = Serial.read();
|
||||
if (c == '\n') {
|
||||
buf.trim();
|
||||
if (buf == "OK") { vTaskDelete(NULL); return; }
|
||||
buf = "";
|
||||
} else if (c != '\r' && buf.length() < 8) {
|
||||
buf += c;
|
||||
}
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(5));
|
||||
}
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
|
||||
// ── OTA: comprueba si hay firmware nuevo y actualiza si hace falta ──
|
||||
static void checkOTA() {
|
||||
@@ -147,6 +170,8 @@ void setup() {
|
||||
|
||||
// ── Servidor cámara ───────────────────────────────────────────────
|
||||
startCameraServer();
|
||||
|
||||
xTaskCreate(handshakeTask, "handshake", 4096, NULL, 1, NULL);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user