mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
20 lines
415 B
C
20 lines
415 B
C
#include "py/mpstate.h"
|
|
#include "py/mphal.h"
|
|
|
|
#if MICROPY_KBD_EXCEPTION
|
|
|
|
int mp_interrupt_char;
|
|
|
|
void mp_hal_set_interrupt_char(int c) {
|
|
if (c != -1) {
|
|
mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
|
|
}
|
|
mp_interrupt_char = c;
|
|
}
|
|
|
|
void mp_keyboard_interrupt(void) {
|
|
MP_STATE_MAIN_THREAD(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
|
|
}
|
|
|
|
#endif
|