Skip to content

Commit ab954ed

Browse files
committed
lib/utils/interrupt_char: Remove support for KBD_EXCEPTION disabled.
If a port is using interrupt_char.c then it must enable MICROPY_KBD_EXCEPTION. This is the case for all official ports.
1 parent 00e4f05 commit ab954ed

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

lib/utils/interrupt_char.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,24 @@
2727
#include "py/obj.h"
2828
#include "py/mpstate.h"
2929

30+
#if MICROPY_KBD_EXCEPTION
31+
3032
int mp_interrupt_char;
3133

3234
void mp_hal_set_interrupt_char(int c) {
3335
if (c != -1) {
34-
#if MICROPY_KBD_EXCEPTION
3536
mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
36-
#else
37-
mp_obj_exception_clear_traceback(MP_STATE_PORT(mp_kbd_exception));
38-
#endif
3937
}
4038
mp_interrupt_char = c;
4139
}
4240

4341
void mp_keyboard_interrupt(void) {
44-
#if MICROPY_KBD_EXCEPTION
4542
MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
46-
#else
47-
MP_STATE_VM(mp_pending_exception) = MP_STATE_PORT(mp_kbd_exception);
48-
#endif
4943
#if MICROPY_ENABLE_SCHEDULER
5044
if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) {
5145
MP_STATE_VM(sched_state) = MP_SCHED_PENDING;
5246
}
5347
#endif
5448
}
49+
50+
#endif

0 commit comments

Comments
 (0)