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.
The functions utime.ticks_us() and utime.ticks_ms() may return values, which then cannot be used as input for utime.ticks_diff(). Example:
>>> time.ticks_us()
3636776263
>>> time.ticks_diff(time.ticks_us(), time.ticks_us()+1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: overflow converting long int to machine word
>>>
The reason is, that the return values are not stripped to values which can be representef by a MP_SMALL_INT, or at least 31 bit.
Edit: Funny enough, the utime module is mostly implemented twice, in esp32/mods/modutime.c and in py/extmod/mphal_utime.c, where the latter seems to have proper value/overflow handling.