diff options
author | Damien George <damien.p.george@gmail.com> | 2017-02-16 18:05:06 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-03-20 15:20:26 +1100 |
commit | 6e74d24f30bca3fb70876b1fb9a6b3a59850b83c (patch) | |
tree | 391a713749edac08db0efc45e6ff987b2f437dc0 /py/runtime.c | |
parent | bf29fe2e138a30688cfb94ad3859f903f935ced1 (diff) | |
download | micropython-6e74d24f30bca3fb70876b1fb9a6b3a59850b83c.tar.gz micropython-6e74d24f30bca3fb70876b1fb9a6b3a59850b83c.zip |
py: Add micropython.schedule() function and associated runtime code.
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index 1f69290ba7..19b55f99ac 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -63,6 +63,10 @@ void mp_init(void) { // no pending exceptions to start with MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + #if MICROPY_ENABLE_SCHEDULER + MP_STATE_VM(sched_state) = MP_SCHED_IDLE; + MP_STATE_VM(sched_sp) = 0; + #endif #if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF mp_init_emergency_exception_buf(); |