Adafruit_SleepyDog icon indicating copy to clipboard operation
Adafruit_SleepyDog copied to clipboard

ActualMS could be misleading

Open arkhipenko opened this issue 10 years ago • 1 comments

Hi, I get the intent of actualMS variable, but it could be misleading. If the device is awaken from the sleep mode by a hardware interrupt (for instance arduino uno deep sleep could be interrupted by an external pin interrupt on pins 2 and 3) then there is no way to tell how long the device has been actually slept (unless of course you have an external clock source like a RTC to check against). Not a big deal, but worth a mention in the REAMDE perhaps.

arkhipenko avatar Nov 14 '15 03:11 arkhipenko

I would call this a bug. If you've gone to sleep and an interrupt has woke you up, the return value is wrong. It should be possible to store the value of the RTC before sleep and after, subtract the two, and return that instead.

sampscl avatar Feb 14 '18 21:02 sampscl