-
Notifications
You must be signed in to change notification settings - Fork 660
Document input.runningTimeMicros()
overflows after 18 minutes
#5372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
input.runningTimeMicros()
overruns after 18 minutesinput.runningTimeMicros()
overflows after 18 minutes
@pelikhan out of curiosity, do you know why the 2 most significant bits from CODAL/DAL pxt-microbit/libs/core/control.cpp Lines 239 to 245 in 975c890
The signed bit makes sense, but not sure why bit 30 is removed as well, was there a technical reason? |
Integers up to |
Ah, that's interesting to know, thanks! And yes, both DAL and CODAL return uint64_t (codal-microbit-v2 set Not sure if changing the size range of |
We need to document this. Not planning to fix. |
This caught me by surprised and it's a MakeCode specific limitation, as CODAL returns a 32 bit unsigned int and MakeCode drops the 2 most significant bits:
pxt-microbit/libs/core/control.cpp
Lines 239 to 245 in 975c890
I guess the signed bit makes sense, but don't know why the second bit is dropped as well.
It was done in commit 15b4b47 as part of PR #2572 (512b4dd).
This should probably be documented, as 18 minutes is a relatively short time that can be easily reached.
Docs:
pxt-microbit/docs/reference/input/running-time-micros.md
Lines 1 to 16 in 975c890
The text was updated successfully, but these errors were encountered: