From 9efb36bfa66d5846c14f21778c25dff7dd733826 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 6 Feb 2020 20:25:54 +1100 Subject: py/scheduler: Move mp_keyboard_interrupt from lib/utils to py core. This function is tightly coupled to the state and behaviour of the scheduler, and is a core part of the runtime: to schedule a pending exception. So move it there. --- lib/utils/interrupt_char.c | 9 --------- lib/utils/interrupt_char.h | 1 - 2 files changed, 10 deletions(-) (limited to 'lib/utils') diff --git a/lib/utils/interrupt_char.c b/lib/utils/interrupt_char.c index 43d45e5ae..3810f7a96 100644 --- a/lib/utils/interrupt_char.c +++ b/lib/utils/interrupt_char.c @@ -38,13 +38,4 @@ void mp_hal_set_interrupt_char(int c) { mp_interrupt_char = c; } -void mp_keyboard_interrupt(void) { - MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)); - #if MICROPY_ENABLE_SCHEDULER - if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { - MP_STATE_VM(sched_state) = MP_SCHED_PENDING; - } - #endif -} - #endif diff --git a/lib/utils/interrupt_char.h b/lib/utils/interrupt_char.h index ca50d4d56..cb086ead9 100644 --- a/lib/utils/interrupt_char.h +++ b/lib/utils/interrupt_char.h @@ -28,6 +28,5 @@ extern int mp_interrupt_char; void mp_hal_set_interrupt_char(int c); -void mp_keyboard_interrupt(void); #endif // MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H -- cgit v1.2.3