utimeq is mostly used in conjunction with ticks_ms() in uasyncio, where "timestamps" generated by ticks_ms() are passed into the queue to sort the elements in the queue.
What the problem is depends a bit on what you deem "correct". The values returned from ticks_ms() can grow larger than utimeq's fields to hold the time values. peektime() can only return values up to 0x3fffffff ((1 << 30) - 1).
If one attempts to use uasyncio on a Pycom board, sooner or later (after 12.42 days when the overflow happens) mayhem will happen because of this wrap-around...
I guess one fix would be to make ticks_ms() wrap at 0x3fffffff as well and fix ticks_diff() to return serial distance (taking wrap-arounds into account) -- see #231. Another could be to change utimeq to be able to handle larger time values.
utimeq
is mostly used in conjunction withticks_ms()
in uasyncio, where "timestamps" generated byticks_ms()
are passed into the queue to sort the elements in the queue.What the problem is depends a bit on what you deem "correct". The values returned from
ticks_ms()
can grow larger thanutimeq
's fields to hold the time values.peektime()
can only return values up to0x3fffffff
((1 << 30) - 1
).If one attempts to use uasyncio on a Pycom board, sooner or later (after 12.42 days when the overflow happens) mayhem will happen because of this wrap-around...
I guess one fix would be to make
ticks_ms()
wrap at0x3fffffff
as well and fixticks_diff()
to return serial distance (taking wrap-arounds into account) -- see #231. Another could be to changeutimeq
to be able to handle larger time values.Related issues: #231, #112.
cc @robert-hh @iwahdan88