Fix: #935 - Brownout reboot loop (#936)

This commit is contained in:
Gunnar Skjold 2025-03-24 08:59:30 +01:00 committed by GitHub
parent 37aa6ae816
commit 9153a98694
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -97,6 +97,11 @@ float AmsFirmwareUpdater::getProgress() {
}
void AmsFirmwareUpdater::loop() {
if(millis() < 30000) {
// Wait 30 seconds before starting upgrade. This allows the device to deal with other tasks first
// It will also allow BUS powered devices to reach a stable voltage so that hw->isVoltageOptimal will behave properly
return;
}
if(strlen(updateStatus.toVersion) > 0 && updateStatus.errorCode == AMS_UPDATE_ERR_OK) {
if(!hw->isVoltageOptimal(0.1)) {
writeUpdateStatus();

View File

@ -67,7 +67,7 @@ private:
bool ledInvert, rgbInvert;
uint8_t vccPin, vccGnd_r, vccVcc_r;
float vccOffset, vccMultiplier;
float maxVcc = 3.2; // 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
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
uint16_t analogRange = 1024;
AdcConfig voltAdc, tempAdc;