extmod/modutimeq: Refactor into optimized class.
import utimeq, utime
# Max queue size, the queue allocated statically on creation
q = utimeq.utimeq(10)
q.push(utime.ticks_ms(), data1, data2)
res = [0, 0, 0]
# Items in res are filled up with results
q.pop(res)
This commit is contained in:
@@ -189,6 +189,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
|
||||
#if MICROPY_PY_UHEAPQ
|
||||
{ MP_ROM_QSTR(MP_QSTR_uheapq), MP_ROM_PTR(&mp_module_uheapq) },
|
||||
#endif
|
||||
#if MICROPY_PY_UTIMEQ
|
||||
{ MP_ROM_QSTR(MP_QSTR_utimeq), MP_ROM_PTR(&mp_module_utimeq) },
|
||||
#endif
|
||||
#if MICROPY_PY_UHASHLIB
|
||||
{ MP_ROM_QSTR(MP_QSTR_uhashlib), MP_ROM_PTR(&mp_module_uhashlib) },
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user