guild icon
Toit
#Using reset reason
Thread channel in help
Spruiid
Spruiid 02/26/2025 01:25 PM
https://libs.toit.io/#reset-reason(0%2C0%2C0%2C)

Greetings, is there example code on how to use the reset-reason function in combination with watchdog?
👍1
floitsch
floitsch 02/26/2025 01:28 PM
I don't think so, but you should just be able to write:
import esp32 main: if esp32.reset-reason == ESP-RST-WDT: print "rebooted due to watchdog"
floitsch
floitsch 02/26/2025 01:28 PM
Maybe it's ESP-RST-TASK-WDT.
floitsch
floitsch 02/26/2025 01:28 PM
I will add more documentation to the constants in the esp32 library.
👍3
4 messages in total