You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 16, 2024. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
martijnthe
changed the title
utimeq overflows after reaching 0x3fffffff, while ticks_ms values will grows larger
utimeq overflows after reaching 0x3fffffff, while ticks_ms values will grow larger
Dec 5, 2018
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
The text was updated successfully, but these errors were encountered: