mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py/scheduler: Add optional port hook for when something is scheduled.
So that a port can "wake up" when there is work to do. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -134,6 +134,7 @@ bool MICROPY_WRAP_MP_SCHED_SCHEDULE(mp_sched_schedule)(mp_obj_t function, mp_obj
|
||||
uint8_t iput = IDX_MASK(MP_STATE_VM(sched_idx) + MP_STATE_VM(sched_len)++);
|
||||
MP_STATE_VM(sched_queue)[iput].func = function;
|
||||
MP_STATE_VM(sched_queue)[iput].arg = arg;
|
||||
MICROPY_SCHED_HOOK_SCHEDULED;
|
||||
ret = true;
|
||||
} else {
|
||||
// schedule queue is full
|
||||
|
||||
Reference in New Issue
Block a user