mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-06-20 01:54:56 +02:00
comienzo dormir ext
This commit is contained in:
+27
-9
@@ -32,6 +32,7 @@ extern String distance;
|
||||
extern bool WiFiConnected;
|
||||
extern int wxModuleType;
|
||||
extern bool backUpDigiMode;
|
||||
extern bool shouldSleep;
|
||||
|
||||
bool statusAfterBoot = true;
|
||||
bool beaconUpdate = true;
|
||||
@@ -123,18 +124,27 @@ namespace Utils {
|
||||
|
||||
#ifdef BATTERY_PIN
|
||||
if (Config.battery.sendInternalVoltage) {
|
||||
String batteryInfo = "Batt=" + String(BATTERY_Utils::checkBattery(),2) + "V";
|
||||
beaconPacket += " " + batteryInfo;
|
||||
secondaryBeaconPacket += " " + batteryInfo;
|
||||
sixthLine = " ( " + batteryInfo + ")";
|
||||
float internalVoltage = BATTERY_Utils::checkInternalVoltage();
|
||||
String internalVoltageInfo = "Batt=" + String(internalVoltage,2) + "V";
|
||||
beaconPacket += " " + internalVoltageInfo;
|
||||
secondaryBeaconPacket += " " + internalVoltageInfo;
|
||||
sixthLine = " ( " + internalVoltageInfo + ")";
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Config.battery.sendExternalVoltage) {
|
||||
String externalVoltage = String(BATTERY_Utils::checkExternalVoltage(),2) + "V";
|
||||
beaconPacket += " Ext=" + externalVoltage;
|
||||
secondaryBeaconPacket += " Ext=" + externalVoltage;
|
||||
sixthLine = " (Ext V=" + externalVoltage;
|
||||
if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) {
|
||||
float externalVoltage = BATTERY_Utils::checkExternalVoltage();
|
||||
String externalVoltageInfo = String(externalVoltage,2) + "V";
|
||||
if (Config.battery.sendExternalVoltage) {
|
||||
beaconPacket += " Ext=" + externalVoltageInfo;
|
||||
secondaryBeaconPacket += " Ext=" + externalVoltageInfo;
|
||||
sixthLine = " (Ext V=" + externalVoltageInfo + ")";
|
||||
}
|
||||
if (Config.battery.monitorExternalVoltage && externalVoltage <= Config.battery.externalSleepVoltage) {
|
||||
beaconPacket += " **ExtBatWarning:SLEEP**";
|
||||
secondaryBeaconPacket += " **ExtBatWarning:SLEEP**";
|
||||
shouldSleep = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) {
|
||||
@@ -262,4 +272,12 @@ namespace Utils {
|
||||
}
|
||||
}
|
||||
|
||||
void checkSleepByLowBatteryVoltage() {
|
||||
if (shouldSleep) {
|
||||
// dormir
|
||||
shouldSleep = false;
|
||||
Serial.println("Durmiendo");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user