Skip to content

Commit cf54e6c

Browse files
committed
Temp workaround for WDT panics. Reconfigure WDT to not panic.
1 parent 25cfe63 commit cf54e6c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

wled00/wled.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,15 @@ void WLED::loop()
421421
void 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"));

0 commit comments

Comments
 (0)