From bd672857f405b107c1eafde1624e14fd2b815e31 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Mon, 19 Aug 2024 10:41:46 -0400 Subject: [PATCH] testing for external battery block --- src/battery_utils.cpp | 8 +++++--- src/configuration.cpp | 4 ++-- src/utils.cpp | 36 +++++++++++++++++++----------------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/battery_utils.cpp b/src/battery_utils.cpp index 74a1f12a..e64ec946 100644 --- a/src/battery_utils.cpp +++ b/src/battery_utils.cpp @@ -210,9 +210,11 @@ namespace BATTERY_Utils { shouldSleepLowVoltage = true; } #endif - if (Config.battery.monitorExternalVoltage && checkExternalVoltage() < Config.battery.externalSleepVoltage + 0.1) { - shouldSleepLowVoltage = true; - } + #ifndef HELTEC_WP + if (Config.battery.monitorExternalVoltage && checkExternalVoltage() < Config.battery.externalSleepVoltage + 0.1) { + shouldSleepLowVoltage = true; + } + #endif if (shouldSleepLowVoltage) { Utils::checkSleepByLowBatteryVoltage(0); } diff --git a/src/configuration.cpp b/src/configuration.cpp index 3714b3d9..fbf56cc7 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -137,8 +137,8 @@ bool Configuration::readFile() { beacon.comment = data["beacon"]["comment"] | "LoRa APRS"; beacon.interval = data["beacon"]["interval"] | 15; beacon.overlay = data["beacon"]["overlay"] | "L"; - beacon.symbol = data["beacon"]["symbol"] | "a"; - beacon.path = data["beacon"]["path"] | "WIDE1-1"; + beacon.symbol = data["beacon"]["symbol"] | "a"; + beacon.path = data["beacon"]["path"] | "WIDE1-1"; beacon.sendViaAPRSIS = data["beacon"]["sendViaAPRSIS"] | false; beacon.sendViaRF = data["beacon"]["sendViaRF"] | false; diff --git a/src/utils.cpp b/src/utils.cpp index 18cb8f59..c0fe460d 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -152,24 +152,26 @@ namespace Utils { } #endif - if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) { - float externalVoltage = BATTERY_Utils::checkExternalVoltage(); - String externalVoltageInfo = String(externalVoltage,2) + "V"; - if (Config.battery.sendExternalVoltage) { - beaconPacket += " Ext="; - beaconPacket += externalVoltageInfo; - secondaryBeaconPacket += " Ext="; - secondaryBeaconPacket += externalVoltageInfo; - sixthLine = " (Ext V="; - sixthLine += externalVoltageInfo; - sixthLine += ")"; - } - if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) { - beaconPacket += " **ExtBatWarning:SLEEP**"; - secondaryBeaconPacket += " **ExtBatWarning:SLEEP**"; - shouldSleepLowVoltage = true; + #ifndef HELTEC_WP + if (Config.battery.sendExternalVoltage || Config.battery.monitorExternalVoltage) { + float externalVoltage = BATTERY_Utils::checkExternalVoltage(); + String externalVoltageInfo = String(externalVoltage,2) + "V"; + if (Config.battery.sendExternalVoltage) { + beaconPacket += " Ext="; + beaconPacket += externalVoltageInfo; + secondaryBeaconPacket += " Ext="; + secondaryBeaconPacket += externalVoltageInfo; + sixthLine = " (Ext V="; + sixthLine += externalVoltageInfo; + sixthLine += ")"; + } + if (Config.battery.monitorExternalVoltage && externalVoltage < Config.battery.externalSleepVoltage) { + beaconPacket += " **ExtBatWarning:SLEEP**"; + secondaryBeaconPacket += " **ExtBatWarning:SLEEP**"; + shouldSleepLowVoltage = true; + } } - } + #endif if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) { displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0);