-
Notifications
You must be signed in to change notification settings - Fork 5k
Berry tasmota.micros() to get time in microseconds
#24192
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
Berry tasmota.micros() to get time in microseconds
#24192
Conversation
|
@s-hadinger This changes are breaking the haspmota Watch 480x480 Demo TAPP. |
| if (top == 1 || (top == 2 && be_isint(vm, 2))) { // only 1 argument of type string accepted | ||
| if (top == 0 || (top == 1 && be_isint(vm, 1))) { // only 1 argument of type string accepted | ||
| uint32_t delay = 0; | ||
| if (top == 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this needs be if (top == 1) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally no, because it is now a static method, so it does not have the default self first argument.
Let's revert this PR so we can identify the breaking change. I suppose that there is some code that expects 'tasmota.millis()' to being not static
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a miscommunication coming.
The change from line 122 is in your failing PR. My suggestion is in line 124 which will never execute when line 122 is changed that way.
In the meantime @Jason2866 tested my change with success so....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
micros is really short. Makes this sense in general in Berry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it does. I’m doing profiling for leds animation on a very slow esp32s2 so it magnifies performance issues. In such cases, milliseconds is too coarse
Description:
New function to get current time in microseconds to get finer measurement than tasmota.millis(). Be careful that the counter changes sign every hour.
Also changed
tasmota.millis()to a static method.Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass