py: Add micropython.schedule() function and associated runtime code.

This commit is contained in:
Damien George
2017-02-16 18:05:06 +11:00
parent bf29fe2e13
commit 6e74d24f30
9 changed files with 197 additions and 0 deletions

View File

@@ -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();