Why is sleepcycle uint8_t and not uint16_t ? #757
-
At the moment, Paxcounter is only able to go into deep sleep for 510 (255*2) seconds at the most. I changed it to uint16_t and it seems to work fine with bigger time windows on our board. But now I am unsure on why this restriction was in place in the first place. Is there an important reason why only uint8_t is used for sleepcycle? Can the additional memory requirement for uint16_t be a problem at some point? I hope somebody can make that more clear to me. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Indeed in early versions there was a restriction in Can you create PR for this and test carefully? Note: We will need adjustments in |
Beta Was this translation helpful? Give feedback.
-
Thanks for the Epaper integration! I will merge this to development branch, after i found some time to take a quick look at it, and carry out a test with my waveshare color esp32 epd. Will take a few days probably. |
Beta Was this translation helpful? Give feedback.
-
I realised that On a more positive note: I have my ttgo5 running with a sleep cycle of 900 seconds (half an hour) for a couple days now and it works flawlessly :) |
Beta Was this translation helpful? Give feedback.
-
@JodliDev I implemented this today in development branch: 295494b |
Beta Was this translation helpful? Give feedback.
Indeed in early versions there was a restriction in
configmanager.cpp
enforcing uint8_t values for storage of configurations in NVRAM. Meanwhileconfigmanager.cpp
was reworked, now all configuration values are stored as a whole in a struct in NVRAM. So we can have uint_16t, or even uint64_t to get longer sleep times.Can you create PR for this and test carefully?
Note: We will need adjustments in
rcommand.cpp
forset_sleepcycle()
, too.