summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal')
-rw-r--r--stmhal/pendsv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/stmhal/pendsv.c b/stmhal/pendsv.c
index c60d91381f..d7104d8518 100644
--- a/stmhal/pendsv.c
+++ b/stmhal/pendsv.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <stm32f4xx_hal.h>
+#include "py/mpstate.h"
#include "py/runtime.h"
#include "pendsv.h"
@@ -46,10 +47,10 @@ void pendsv_init(void) {
// the given exception object using nlr_jump in the context of the top-level
// thread.
void pendsv_nlr_jump(void *o) {
- if (mp_pending_exception == MP_OBJ_NULL) {
- mp_pending_exception = o;
+ if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_NULL) {
+ MP_STATE_VM(mp_pending_exception) = o;
} else {
- mp_pending_exception = MP_OBJ_NULL;
+ MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL;
pendsv_object = o;
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
}