File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,9 +102,15 @@ void mp_hal_delay_ms(mp_uint_t delay) {
102102 while (remaining > 0 ) {
103103 RUN_BACKGROUND_TASKS ;
104104 // 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 )) ||
107112 WATCHDOG_EXCEPTION_CHECK ()) {
113+ // stop sleeping immediately
108114 break ;
109115 }
110116 remaining = end_tick - port_get_raw_ticks (NULL );
You can’t perform that action at this time.
0 commit comments