Commit Graph

5 Commits

Author SHA1 Message Date
Paul Sokolovsky 7327966da7 extmod/modutimeq: Make time_less_than be actually "less than", not less/eq.
This fixes an obvious case of non-fair scheduling of 2 tasks with the same
deadline.
2016-12-24 00:06:29 +03:00
Paul Sokolovsky 18f12caafc extmod/modutimeq: Fix printf in dump(). 2016-12-23 21:11:19 +03:00
Paul Sokolovsky 1b44987d0c extmod/modutimeq: Fix warning about unused param. 2016-12-22 00:48:19 +03:00
Paul Sokolovsky d02f6a9956 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)
2016-12-22 00:29:32 +03:00
Paul Sokolovsky ef23399e32 extmod/modutimeq: Copy of current moduheapq with timeq support for refactoring. 2016-12-22 00:23:11 +03:00