summaryrefslogtreecommitdiff
path: root/py/runtime.h
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2019-03-21 11:52:10 +1100
committerDamien George <damien.p.george@gmail.com>2019-03-26 16:35:42 +1100
commit8977c7eb581f5d06500edb1ea29aea5cbda04f28 (patch)
tree10291cc81c84a9eb0732367c613c35511be4ee48 /py/runtime.h
parent2befcb8a9d54f3f9c059b45eba3e9d4e5fb13514 (diff)
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.
Diffstat (limited to 'py/runtime.h')
-rw-r--r--py/runtime.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/runtime.h b/py/runtime.h
index 0dd97a584..0eb15d461 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -70,7 +70,7 @@ void mp_handle_pending_tail(mp_uint_t atomic_state);
#if MICROPY_ENABLE_SCHEDULER
void mp_sched_lock(void);
void mp_sched_unlock(void);
-static inline unsigned int mp_sched_num_pending(void) { return MP_STATE_VM(sched_sp); }
+static inline unsigned int mp_sched_num_pending(void) { return MP_STATE_VM(sched_len); }
bool mp_sched_schedule(mp_obj_t function, mp_obj_t arg);
#endif