Improve power saving (#1024)

* Limit tasks in loop based on voltage

* Updated disconnect voltage limit

* Fixed 8266 build
This commit is contained in:
Gunnar Skjold
2025-10-02 12:59:47 +02:00
committed by GitHub
parent 6a75b0fe71
commit b06aa5f71b
4 changed files with 375 additions and 285 deletions

View File

@@ -67,7 +67,9 @@ private:
bool ledInvert, rgbInvert;
uint8_t vccPin, vccGnd_r, vccVcc_r;
float vccOffset, vccMultiplier;
float vcc = 3.3; // Last known Vcc
float maxVcc = 3.25; // Best to have this close to max as a start, in case Pow-U reboots and starts off with a low voltage, we dont want that to be perceived as max
unsigned long lastVccRead = 0;
uint16_t analogRange = 1024;
AdcConfig voltAdc, tempAdc;