From a83e2a436cc24e54c18cc45acb1c84b3b3857c46 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Mon, 29 Jul 2024 23:12:29 -0400 Subject: [PATCH] deepSleep in heltec for lower battery voltage --- src/station_utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/station_utils.cpp b/src/station_utils.cpp index 3888565..c2c48a3 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -236,8 +236,9 @@ namespace STATION_Utils { comment = currentBeacon->comment; sendCommentAfterXBeacons = Config.sendCommentAfterXBeacons; } + String batteryVoltage = POWER_Utils::getBatteryInfoVoltage(); if (Config.sendBatteryInfo) { - String batteryVoltage = POWER_Utils::getBatteryInfoVoltage(); + //String batteryVoltage = POWER_Utils::getBatteryInfoVoltage(); String batteryChargeCurrent = POWER_Utils::getBatteryInfoCurrent(); #ifdef HAS_AXP192 comment += " Bat="; @@ -286,6 +287,11 @@ namespace STATION_Utils { if (currentBeacon->gpsEcoMode) { // currentBeacon->gpsEcoMode // true! SLEEP_Utils::gpsSleep(); } + #if defined(HELTEC_WIRELESS_TRACKER) + if (batteryVoltage.toFloat() < 3.0) { + POWER_Utils::shutdown(); + } + #endif } void checkTelemetryTx() {