File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 27
27
#include "py/runtime.h"
28
28
#include "common-hal/watchdog/WatchDogTimer.h"
29
29
30
+ #include "shared-bindings/watchdog/__init__.h"
30
31
#include "shared-bindings/microcontroller/__init__.h"
31
32
32
33
#include "esp_task_wdt.h"
33
34
34
35
void 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
36
43
}
37
44
38
45
void 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 {
37
37
watchdog_watchdogmode_t mode ;
38
38
};
39
39
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
42
41
void watchdog_reset (void );
43
42
44
43
#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H
Original file line number Diff line number Diff line change 41
41
#include "common-hal/busio/UART.h"
42
42
#include "common-hal/pulseio/PulseIn.h"
43
43
#include "common-hal/pwmio/PWMOut.h"
44
+ #include "common-hal/watchdog/WatchDogTimer.h"
44
45
#include "common-hal/wifi/__init__.h"
45
46
#include "supervisor/memory.h"
46
47
#include "supervisor/shared/tick.h"
@@ -119,6 +120,10 @@ void reset_port(void) {
119
120
rtc_reset ();
120
121
#endif
121
122
123
+ #if CIRCUITPY_WATCHDOG
124
+ watchdog_reset ();
125
+ #endif
126
+
122
127
#if CIRCUITPY_WIFI
123
128
wifi_reset ();
124
129
#endif
You can’t perform that action at this time.
0 commit comments