testing for external battery block

This commit is contained in:
richonguzman 2024-08-19 10:41:46 -04:00
parent 9cc26ccdae
commit bd672857f4
3 changed files with 26 additions and 22 deletions

View File

@ -210,9 +210,11 @@ namespace BATTERY_Utils {
shouldSleepLowVoltage = true; shouldSleepLowVoltage = true;
} }
#endif #endif
if (Config.battery.monitorExternalVoltage && checkExternalVoltage() < Config.battery.externalSleepVoltage + 0.1) { #ifndef HELTEC_WP
shouldSleepLowVoltage = true; if (Config.battery.monitorExternalVoltage && checkExternalVoltage() < Config.battery.externalSleepVoltage + 0.1) {
} shouldSleepLowVoltage = true;
}
#endif
if (shouldSleepLowVoltage) { if (shouldSleepLowVoltage) {
Utils::checkSleepByLowBatteryVoltage(0); Utils::checkSleepByLowBatteryVoltage(0);
} }

View File

@ -152,24 +152,26 @@ namespace Utils {
} }
#endif #endif
if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) { #ifndef HELTEC_WP
float externalVoltage = BATTERY_Utils::checkExternalVoltage(); if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) {
String externalVoltageInfo = String(externalVoltage,2) + "V"; float externalVoltage = BATTERY_Utils::checkExternalVoltage();
if (Config.battery.sendExternalVoltage) { String externalVoltageInfo = String(externalVoltage,2) + "V";
beaconPacket += " Ext="; if (Config.battery.sendExternalVoltage) {
beaconPacket += externalVoltageInfo; beaconPacket += " Ext=";
secondaryBeaconPacket += " Ext="; beaconPacket += externalVoltageInfo;
secondaryBeaconPacket += externalVoltageInfo; secondaryBeaconPacket += " Ext=";
sixthLine = " (Ext V="; secondaryBeaconPacket += externalVoltageInfo;
sixthLine += externalVoltageInfo; sixthLine = " (Ext V=";
sixthLine += ")"; sixthLine += externalVoltageInfo;
sixthLine += ")";
}
if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) {
beaconPacket += " **ExtBatWarning:SLEEP**";
secondaryBeaconPacket += " **ExtBatWarning:SLEEP**";
shouldSleepLowVoltage = true;
}
} }
if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) { #endif
beaconPacket += " **ExtBatWarning:SLEEP**";
secondaryBeaconPacket += " **ExtBatWarning:SLEEP**";
shouldSleepLowVoltage = true;
}
}
if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) { if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) {
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0); displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0);