py/scheduler: Convert micropythyon.schedule() to a circular buffer.

This means the schedule operates on a first-in, first-executed manner
rather than the current last-in, first executed.
This commit is contained in:
Andrew Leech
2019-03-21 11:52:10 +11:00
committed by Damien George
parent 2befcb8a9d
commit 8977c7eb58
5 changed files with 29 additions and 12 deletions

View File

@@ -63,7 +63,8 @@ void mp_init(void) {
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;
MP_STATE_VM(sched_idx) = 0;
MP_STATE_VM(sched_len) = 0;
#endif
#if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF