m5stack / M5StickCPlus2

MIT License
52 stars 6 forks source link

StickCP2.Power.timerSleep(300); wakes up too early #1

Closed drewsed closed 4 months ago

drewsed commented 5 months ago

Hello,

Edit: I created this issue, then I was thinking I was mistaken, but now the issue occurs again. Thats why I reopened and "undeleted" this issue.


I modified the wakeup.ino example to 300s and the device actually wakes up 90s too early.

This is what I found:

StickCP2.Power.timerSleep(90); -> wakes up in 90s StickCP2.Power.timerSleep(200); -> wakes up in 200s StickCP2.Power.timerSleep(240); -> wakes up in 240s

StickCP2.Power.timerSleep(299); -> wakes up in 299s

StickCP2.Power.timerSleep(300); -> wakes up in 210s StickCP2.Power.timerSleep(600); -> wakes up in 510


But afterwards the error was always not 90s anymore for durations > 299s, but also 110s and something in between.

drewsed commented 4 months ago

OK, I got the restriction of the RTC. what a pity:

```
/// Set timer IRQ
/// @param afterSeconds 1 - 15,300. If 256 or more, 1-minute cycle.  (max 255 minute.)
/// @return the set number of seconds.
int setAlarmIRQ(int afterSeconds);