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.
I guess this needs be if (top == 1) {
There was a problem hiding this comment.
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.
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.
micros is really short. Makes this sense in general in Berry?
There was a problem hiding this comment.
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
* Remove tab from json * Berry `tasmota.micros()` to get time in microseconds
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