Skip to content

Commit 431b791

Browse files
DvdGiessendpgeorge
authored andcommitted
esp32/panichandler: Support building against IDFv5.4.2.
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: espressif/esp-idf@cd887ef Signed-off-by: Daniël van de Giessen <[email protected]>
1 parent a9801f9 commit 431b791

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ports/esp32/panichandler.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,20 @@
4242
#endif
4343

4444
void __real_esp_panic_handler(void *);
45-
void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
4645
void panic_print_str(const char *str);
4746

47+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2)
48+
void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
49+
#else
50+
void esp_panic_handler_feed_wdts(void);
51+
#endif
52+
4853
void MICROPY_WRAP_PANICHANDLER_FUN(__wrap_esp_panic_handler)(void *info) {
54+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2)
4955
esp_panic_handler_reconfigure_wdts(1000);
56+
#else
57+
esp_panic_handler_feed_wdts();
58+
#endif
5059

5160
const static char *msg = MICROPY_WRAP_PANICHANDLER_STR(
5261
"\r\n"

0 commit comments

Comments
 (0)