You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Watchdogs are used to reboot out of the bootloader. There is a
scratch register for user watchdogs. So use sdk functions to better
distinguish these.
Related to #7346
// Check watchdog after chip reset since watchdog doesn't clear chip_reset, while chip_reset clears the watchdog
88
88
89
-
if (watchdog_reset_reg&WATCHDOG_REASON_TIMER_BITS) {
90
-
// This bit can also be set during a software reset because the pico-sdk performs a software reset by setting an extremely low timeout on the watchdog, rather than triggering a watchdog reset manually
91
-
reason=RESET_REASON_WATCHDOG;
89
+
// The watchdog is used for software reboots such as resetting after copying a UF2 via the bootloader.
90
+
if (watchdog_caused_reboot()) {
91
+
reason=RESET_REASON_SOFTWARE;
92
92
}
93
93
94
-
if (watchdog_reset_reg&WATCHDOG_REASON_FORCE_BITS) {
95
-
reason=RESET_REASON_SOFTWARE;
94
+
// Actual watchdog usage will set a special value that this function detects.
0 commit comments