diff options
author | Daniël van de Giessen <daniel@dvdgiessen.nl> | 2025-06-30 13:52:52 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-07-06 00:14:10 +1000 |
commit | 431b79146e4c8611144795eebf4e7645aa0c6591 (patch) | |
tree | 90521d3dcc9de666aa3e7f6d6f2d912962ffe382 /ports/esp32/panichandler.c | |
parent | a9801f9960ea2b8e94d5626840c97bc45286e1a3 (diff) | |
download | micropython-master.tar.gz micropython-master.zip |
The IDF panic handler resets the watchdog timeout to prevent the printing
of the error message from being cut off by a WDT reset. We use the exact
same function call in our wrapper function for the same purpose.
In IDFv5.4.2 the function used for this was changed from
`esp_panic_handler_reconfigure_wdts` to `esp_panic_handler_feed_wdts`,
specifically in this commit:
https://github.com/espressif/esp-idf/commit/cd887ef59a7b966a7f431754aaec6ee653849d77
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
Diffstat (limited to 'ports/esp32/panichandler.c')
-rw-r--r-- | ports/esp32/panichandler.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ports/esp32/panichandler.c b/ports/esp32/panichandler.c index e6ff98ded2..5211286f84 100644 --- a/ports/esp32/panichandler.c +++ b/ports/esp32/panichandler.c @@ -42,11 +42,20 @@ #endif void __real_esp_panic_handler(void *); -void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms); void panic_print_str(const char *str); +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) +void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms); +#else +void esp_panic_handler_feed_wdts(void); +#endif + void MICROPY_WRAP_PANICHANDLER_FUN(__wrap_esp_panic_handler)(void *info) { + #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) esp_panic_handler_reconfigure_wdts(1000); + #else + esp_panic_handler_feed_wdts(); + #endif const static char *msg = MICROPY_WRAP_PANICHANDLER_STR( "\r\n" |