diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-01 23:30:53 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-07 20:33:00 +0000 |
commit | b4b10fd350852e321624d74983cca286091b55a1 (patch) | |
tree | 7ac4aa40d70be0170a61f649e9d73c42faa4ba33 /stmhal/pendsv.c | |
parent | ad2307c92c15f0aa90dbd0741fd2538719d0b5e1 (diff) | |
download | micropython-b4b10fd350852e321624d74983cca286091b55a1.tar.gz micropython-b4b10fd350852e321624d74983cca286091b55a1.zip |
py: Put all global state together in state structures.
This patch consolidates all global variables in py/ core into one place,
in a global structure. Root pointers are all located together to make
GC tracing easier and more efficient.
Diffstat (limited to 'stmhal/pendsv.c')
-rw-r--r-- | stmhal/pendsv.c | 7 |
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; } |