Update ESP32cam-demo.ino

master
Alan 2024-07-08 11:07:54 +01:00 zatwierdzone przez GitHub
rodzic ecf9b5278e
commit 338bec9ce4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -392,25 +392,24 @@ setupFlashPWM(); // configure PWM for the illumination LED
esp_task_wdt_deinit(); // ensure a watchdog is not already configured
#if defined(ESP_ARDUINO_VERSION_MAJOR) && ESP_ARDUINO_VERSION_MAJOR == 3
// v3 board manager detected
// Create and initialize the watchdog timer(WDT) configuration structure
if (serialDebug) Serial.println("v3 esp32 board manager detected");
if (serialDebug) Serial.println("Watchdog timer: v3 esp32 board manager detected");
esp_task_wdt_config_t wdt_config = {
.timeout_ms = WDT_TIMEOUT * 1000, // Convert seconds to milliseconds
.idle_core_mask = 1 << 1, // Monitor core 1 only
.idle_core_mask = 1 << 0, // Which core to monitor
.trigger_panic = true // Enable panic
};
// Initialize the WDT with the configuration structure
esp_task_wdt_init(&wdt_config); // Pass the pointer to the configuration structure
esp_task_wdt_add(NULL); // Add current thread to WDT watch
esp_task_wdt_reset(); // reset timer
if (serialDebug) Serial.println("Watchdog Timer initialized at WDT_TIMEOUT seconds");
if (serialDebug) Serial.println("Watchdog Timer initialized");
#else
// pre v3 board manager assumed
if (serialDebug) Serial.println("older esp32 board manager assumed");
if (serialDebug) Serial.println("Watchdog timer: Older esp32 board manager detected");
esp_task_wdt_init(WDT_TIMEOUT, true); //enable panic so ESP32 restarts
esp_task_wdt_add(NULL); //add current thread to WDT watch
#endif
#endif
#endif
// startup complete
if (serialDebug) Serial.println("\nStarted...");