summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/pendsv.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-15 16:39:30 +1100
committerDamien George <damien.p.george@gmail.com>2017-02-15 16:39:30 +1100
commite5cc681cb1b5163b9ae3453df85344326baf9759 (patch)
tree200ae1f6b6387fbd12ee9dd3cc4223ca32cdd560 /stmhal/pendsv.c
parent05a4859585c4e0a55fca2e7467ba70da6453fdcb (diff)
downloadmicropython-e5cc681cb1b5163b9ae3453df85344326baf9759.tar.gz
micropython-e5cc681cb1b5163b9ae3453df85344326baf9759.zip
stmhal: Use generic interrupt char code.
Diffstat (limited to 'stmhal/pendsv.c')
-rw-r--r--stmhal/pendsv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/stmhal/pendsv.c b/stmhal/pendsv.c
index e6df84b29a..4c2a14de1b 100644
--- a/stmhal/pendsv.c
+++ b/stmhal/pendsv.c
@@ -29,6 +29,7 @@
#include "py/mpstate.h"
#include "py/runtime.h"
+#include "lib/utils/interrupt_char.h"
#include "pendsv.h"
#include "irq.h"
@@ -52,12 +53,12 @@ void pendsv_init(void) {
// PENDSV feature. This will wait until all interrupts are finished then raise
// the given exception object using nlr_jump in the context of the top-level
// thread.
-void pendsv_nlr_jump(void *o) {
+void pendsv_kbd_intr(void) {
if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_NULL) {
- MP_STATE_VM(mp_pending_exception) = o;
+ mp_keyboard_interrupt();
} else {
MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL;
- pendsv_object = o;
+ pendsv_object = &MP_STATE_VM(mp_kbd_exception);
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
}
}