File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,15 @@ void WLED::loop()
421421void WLED::enableWatchdog() {
422422#if WLED_WATCHDOG_TIMEOUT > 0
423423#ifdef ARDUINO_ARCH_ESP32
424+ #if ESP_IDF_VERSION_MAJOR >= 5
425+ esp_task_wdt_config_t wdtConfig;
426+ wdtConfig.timeout_ms = WLED_WATCHDOG_TIMEOUT * 1000; // convert to milliseconds
427+ wdtConfig.idle_core_mask = (1 << CONFIG_FREERTOS_NUMBER_OF_CORES) - 1;
428+ wdtConfig.trigger_panic = false; // TroyHacks P4: Stop panics temporarily until we sort the WDT out.
429+ esp_err_t watchdog = esp_task_wdt_reconfigure(&wdtConfig);
430+ #else
424431 esp_err_t watchdog = esp_task_wdt_init(WLED_WATCHDOG_TIMEOUT, true);
432+ #endif
425433 DEBUG_PRINT(F("Watchdog enabled: "));
426434 if (watchdog == ESP_OK) {
427435 DEBUG_PRINTLN(F("OK"));
You can’t perform that action at this time.
0 commit comments