File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,15 @@ void mp_hal_delay_ms(mp_uint_t delay) {
102
102
while (remaining > 0 ) {
103
103
RUN_BACKGROUND_TASKS ;
104
104
// Check to see if we've been CTRL-Ced by autoreload or the user.
105
- if (MP_STATE_VM (mp_pending_exception ) == MP_OBJ_FROM_PTR (& MP_STATE_VM (mp_kbd_exception )) ||
106
- MP_STATE_VM (mp_pending_exception ) == MP_OBJ_FROM_PTR (& MP_STATE_VM (mp_reload_exception )) ||
105
+ if (MP_STATE_VM (mp_pending_exception ) == MP_OBJ_FROM_PTR (& MP_STATE_VM (mp_kbd_exception )))
106
+ {
107
+ // clear exception and generate stacktrace
108
+ MP_STATE_VM (mp_pending_exception ) = MP_OBJ_NULL ;
109
+ nlr_raise (& MP_STATE_VM (mp_kbd_exception ));
110
+ }
111
+ if ( MP_STATE_VM (mp_pending_exception ) == MP_OBJ_FROM_PTR (& MP_STATE_VM (mp_reload_exception )) ||
107
112
WATCHDOG_EXCEPTION_CHECK ()) {
113
+ // stop sleeping immediately
108
114
break ;
109
115
}
110
116
remaining = end_tick - port_get_raw_ticks (NULL );
You can’t perform that action at this time.
0 commit comments