mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-04-26 04:07:57 +00:00
@@ -97,6 +97,11 @@ float AmsFirmwareUpdater::getProgress() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AmsFirmwareUpdater::loop() {
|
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(strlen(updateStatus.toVersion) > 0 && updateStatus.errorCode == AMS_UPDATE_ERR_OK) {
|
||||||
if(!hw->isVoltageOptimal(0.1)) {
|
if(!hw->isVoltageOptimal(0.1)) {
|
||||||
writeUpdateStatus();
|
writeUpdateStatus();
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ private:
|
|||||||
bool ledInvert, rgbInvert;
|
bool ledInvert, rgbInvert;
|
||||||
uint8_t vccPin, vccGnd_r, vccVcc_r;
|
uint8_t vccPin, vccGnd_r, vccVcc_r;
|
||||||
float vccOffset, vccMultiplier;
|
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;
|
uint16_t analogRange = 1024;
|
||||||
AdcConfig voltAdc, tempAdc;
|
AdcConfig voltAdc, tempAdc;
|
||||||
|
|||||||
Reference in New Issue
Block a user