Closed dan-bel closed 3 years ago
All clock are stopped during power down. millis()
only run during active state.
that makes sense, but I would expect the wakeup function to be an active state since things are happening?
The millis()
stops during sleep and upon waking up it will continue to run, hence the millis()
will stop to count during the sleep period. If just prior to sleep the millis()
count is 1000 ms, it will be 1000 ms upon waking up despite sleeping for example 8 seconds.
Thank you, I now realized that time never runs in interrupt handlers, so it would also not run here. Thank you for your input and clarification.
TimeStandingStillAfterWakingUp.txt
Hi,
I experienced that the millis() is always returning the same value when run in a function which is triggered after waking up.
Unfortunately, I lack the skills to dig deeper :(
Attached a sample code. After 10 sec, the Arduino will go to sleep and is woken up by connecting pin 2 to ground. The function wakeUp() is run, and it seems that time stays still, millis() always returns the same value. Tested on Arduino nano, and LowPower version 1.81
Thank you
Dan