diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2019-07-11 11:55:31 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-07-17 16:09:32 +1000 |
commit | bc66fe9064c48268dbc88b8c3197f560351b1039 (patch) | |
tree | d37a2bb8df0ba7471fe097e3fe15bbf89024df33 /py | |
parent | 3e558300669effa93e5e4dad4c8c4ecc167766c4 (diff) | |
download | micropython-bc66fe9064c48268dbc88b8c3197f560351b1039.tar.gz micropython-bc66fe9064c48268dbc88b8c3197f560351b1039.zip |
py/scheduler: Rename sched_stack to sched_queue.
Behaviour was changed from stack to queue in
8977c7eb581f5d06500edb1ea29aea5cbda04f28, and this updates variable names
to match. Also updates other references (docs, error messages).
Diffstat (limited to 'py')
-rw-r--r-- | py/modmicropython.c | 2 | ||||
-rw-r--r-- | py/mpstate.h | 2 | ||||
-rw-r--r-- | py/scheduler.c | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/py/modmicropython.c b/py/modmicropython.c index 864d1a5c5b..8d36697f15 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -150,7 +150,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_micropython_kbd_intr_obj, mp_micropython_kbd #if MICROPY_ENABLE_SCHEDULER STATIC mp_obj_t mp_micropython_schedule(mp_obj_t function, mp_obj_t arg) { if (!mp_sched_schedule(function, arg)) { - mp_raise_msg(&mp_type_RuntimeError, "schedule stack full"); + mp_raise_msg(&mp_type_RuntimeError, "schedule queue full"); } return mp_const_none; } diff --git a/py/mpstate.h b/py/mpstate.h index a9c2b32d66..b7eb6bdeb1 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -141,7 +141,7 @@ typedef struct _mp_state_vm_t { volatile mp_obj_t mp_pending_exception; #if MICROPY_ENABLE_SCHEDULER - mp_sched_item_t sched_stack[MICROPY_SCHEDULER_DEPTH]; + mp_sched_item_t sched_queue[MICROPY_SCHEDULER_DEPTH]; #endif // current exception being handled, for sys.exc_info() diff --git a/py/scheduler.c b/py/scheduler.c index 5edff45b6f..e7cbb524de 100644 --- a/py/scheduler.c +++ b/py/scheduler.c @@ -65,7 +65,7 @@ void mp_handle_pending(void) { void mp_handle_pending_tail(mp_uint_t atomic_state) { MP_STATE_VM(sched_state) = MP_SCHED_LOCKED; if (!mp_sched_empty()) { - mp_sched_item_t item = MP_STATE_VM(sched_stack)[MP_STATE_VM(sched_idx)]; + mp_sched_item_t item = MP_STATE_VM(sched_queue)[MP_STATE_VM(sched_idx)]; MP_STATE_VM(sched_idx) = IDX_MASK(MP_STATE_VM(sched_idx) + 1); --MP_STATE_VM(sched_len); MICROPY_END_ATOMIC_SECTION(atomic_state); @@ -107,11 +107,11 @@ bool mp_sched_schedule(mp_obj_t function, mp_obj_t arg) { MP_STATE_VM(sched_state) = MP_SCHED_PENDING; } uint8_t iput = IDX_MASK(MP_STATE_VM(sched_idx) + MP_STATE_VM(sched_len)++); - MP_STATE_VM(sched_stack)[iput].func = function; - MP_STATE_VM(sched_stack)[iput].arg = arg; + MP_STATE_VM(sched_queue)[iput].func = function; + MP_STATE_VM(sched_queue)[iput].arg = arg; ret = true; } else { - // schedule stack is full + // schedule queue is full ret = false; } MICROPY_END_ATOMIC_SECTION(atomic_state); |