Is it possible to force a value for the ticks_ms() counter in order to test rollover processing in my code. #16667
Unanswered
easytarget
asked this question in
Using MicroPython
Replies: 1 comment 1 reply
-
you could test your rollover logic with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking for a way to TEST my code during a rollover of the
ticks_ms()
value, and hoping there is some way to force this other than 'wait 12 days' (or whatever "TICKS_MAX" equates to).I'm familiar with the time library and understand how, and why, I need to use
ticks_diff()
. My code is written with this in mind; however, it is relatively complex; with multiple (overlapping) internal countdowns and watchdogs running, I'm not 100% sure I have got it right 😦I'd really like to sit down and spend some time testing the ticks value rolls over. This means I am looking for a way to force the ticks_ms() counter close to it's maximum so I can observe behaviour. I've had a good search and cannot find this question asked elsewhere for MicroPython.
Currently I am thinking of just compiling my own firmware with
mp_hal_ticks_ms
initialised at a suitably high (2^30 - two minutes..) value so that I reliably get a rollover 2 mins after a hard reset.Beta Was this translation helpful? Give feedback.
All reactions