File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727#include "py/runtime.h"
2828#include "common-hal/watchdog/WatchDogTimer.h"
2929
30+ #include "shared-bindings/watchdog/__init__.h"
3031#include "shared-bindings/microcontroller/__init__.h"
3132
3233#include "esp_task_wdt.h"
3334
3435void esp_task_wdt_isr_user_handler (void ) {
35-
36+ mp_obj_exception_clear_traceback (MP_OBJ_FROM_PTR (& mp_watchdog_timeout_exception ));
37+ MP_STATE_VM (mp_pending_exception ) = & mp_watchdog_timeout_exception ;
38+ #if MICROPY_ENABLE_SCHEDULER
39+ if (MP_STATE_VM (sched_state ) == MP_SCHED_IDLE ) {
40+ MP_STATE_VM (sched_state ) = MP_SCHED_PENDING ;
41+ }
42+ #endif
3643}
3744
3845void common_hal_watchdog_feed (watchdog_watchdogtimer_obj_t * self ) {
Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ struct _watchdog_watchdogtimer_obj_t {
3737 watchdog_watchdogmode_t mode ;
3838};
3939
40- // This needs to be called in order to disable the watchdog if it's set to
41- // "RAISE". If set to "RESET", then the watchdog cannot be reset.
40+ // This needs to be called in order to disable the watchdog
4241void watchdog_reset (void );
4342
4443#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H
Original file line number Diff line number Diff line change 4141#include "common-hal/busio/UART.h"
4242#include "common-hal/pulseio/PulseIn.h"
4343#include "common-hal/pwmio/PWMOut.h"
44+ #include "common-hal/watchdog/WatchDogTimer.h"
4445#include "common-hal/wifi/__init__.h"
4546#include "supervisor/memory.h"
4647#include "supervisor/shared/tick.h"
@@ -119,6 +120,10 @@ void reset_port(void) {
119120 rtc_reset ();
120121#endif
121122
123+ #if CIRCUITPY_WATCHDOG
124+ watchdog_reset ();
125+ #endif
126+
122127#if CIRCUITPY_WIFI
123128 wifi_reset ();
124129#endif
You can’t perform that action at this time.
0 commit comments