Improvements & fixes (#178)

- Fix for unPhone sleep: it would wake up every minute briefly (draining the battery over the course of 1-3 days)
- Minor WiFi improvements (mainly added logging and improved filtering on connect .. the latter probably doesn't matter)
This commit is contained in:
Ken Van Hoeylandt
2025-01-22 23:10:28 +01:00
committed by GitHub
parent 12a9839420
commit dc20ed4874
3 changed files with 22 additions and 6 deletions
+2 -1
View File
@@ -25,7 +25,8 @@ static void updatePowerSwitch() {
}
} else { // power switch off and usb plugged in we sleep
unPhoneFeatures.wakeOnPowerSwitch();
esp_sleep_enable_timer_wakeup(60000000); // ea min: USB? else->shipping
// Using UINT64_MAX leads to boot loops because of a bug in esp_sleep_start() converting it to int64_t before sleeping
esp_sleep_enable_timer_wakeup(UINT64_MAX / 2); // ea min: USB? else->shipping
esp_deep_sleep_start(); // deep sleep, wait for wakeup on GPIO
}