https://toitlang.org/ logo
Using reset reason
# help
s
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?
f
I don't think so, but you should just be able to write:
Copy code
import esp32
main:
 if esp32.reset-reason == ESP-RST-WDT:
    print "rebooted due to watchdog"
Maybe it's
ESP-RST-TASK-WDT
.
I will add more documentation to the constants in the esp32 library.