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:
Paul Sokolovsky
2016-12-22 00:29:32 +03:00
parent ef23399e32
commit d02f6a9956
5 changed files with 122 additions and 59 deletions

View File

@@ -945,6 +945,11 @@ typedef double mp_float_t;
#define MICROPY_PY_UHEAPQ (0)
#endif
// Optimized heap queue for relative timestamps
#ifndef MICROPY_PY_UTIMEQ
#define MICROPY_PY_UTIMEQ (0)
#endif
#ifndef MICROPY_PY_UHASHLIB
#define MICROPY_PY_UHASHLIB (0)
#endif