diff --git a/src/display.cpp b/src/display.cpp index 22ad17a..b70b1db 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -177,12 +177,6 @@ void draw_T_DECK_Body(const String& line1, const String& line2, const String& li sprite.drawString("REC:",190,208); sprite.drawString(String(recN), 215, 208);*/ -void cleanTFT() { - /*#ifdef HAS_TFT - tft.fillScreen(TFT_BLACK); - #endif*/ -} - String fillStringLength(const String& line, uint8_t length) { String outputLine = line; for (int a = line.length(); a < length; a++) { @@ -297,7 +291,7 @@ void displayShow(const String& header, const String& line1, const String& line2, sprite.setTextSize(smallSizeFont); sprite.setTextColor(TFT_WHITE, TFT_BLACK); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 2; i++) { sprite.drawString(*lines[i], 3,(lineSpacing * (2 + i)) - 2); } #endif @@ -453,9 +447,6 @@ void startupScreen(uint8_t index, const String& version) { case 2: workingFreq += "UK]"; break; } displayShow(" LoRa APRS", " (TRACKER)", workingFreq, "", "", " CA2RXU " + version, 4000); - #ifdef HAS_TFT - cleanTFT(); - #endif logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "RichonGuzman (CA2RXU) --> LoRa APRS Tracker/Station"); logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "Version: %s", version); } diff --git a/src/display.h b/src/display.h index f36bf1f..009c7fa 100644 --- a/src/display.h +++ b/src/display.h @@ -3,7 +3,6 @@ void displaySetup(); void displayToggle(bool toggle); -void cleanTFT(); void displayShow(const String& header, const String& line1, const String& line2, int wait = 0); void displayShow(const String& header, const String& line1, const String& line2, const String& line3, const String& line4, const String& line5, int wait = 0); diff --git a/src/lora_utils.cpp b/src/lora_utils.cpp index 335df9d..611120e 100644 --- a/src/lora_utils.cpp +++ b/src/lora_utils.cpp @@ -179,9 +179,9 @@ namespace LoRa_Utils { delay(Config.ptt.postDelay); digitalWrite(Config.ptt.io_pin, Config.ptt.reverse ? HIGH : LOW); } - #ifdef HAS_TFT + /*#ifdef HAS_TFT cleanTFT(); - #endif + #endif*/ } void wakeRadio() { diff --git a/src/msg_utils.cpp b/src/msg_utils.cpp index 40db9f7..39f8fbb 100644 --- a/src/msg_utils.cpp +++ b/src/msg_utils.cpp @@ -240,9 +240,9 @@ namespace MSG_Utils { void sendMessage(const String& station, const String& textMessage) { String newPacket = APRSPacketLib::generateMessagePacket(currentBeacon->callsign, "APLRT1", Config.path, station, textMessage); - #if HAS_TFT + /*#if HAS_TFT cleanTFT(); - #endif + #endif*/ if (textMessage.indexOf("ack") == 0 && station != "WLNK-1") { // don't show Winlink ACK displayShow("<>", "", "", 500); } else if (station.indexOf("CA2RXU-15") == 0 && textMessage.indexOf("wrl") == 0) { diff --git a/src/power_utils.cpp b/src/power_utils.cpp index 6357dc4..800dba2 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -172,7 +172,7 @@ namespace POWER_Utils { void batteryManager() { #ifdef ADC_CTRL - if(batteryMeasurmentTime == 0 || (millis() - batteryMeasurmentTime) > 30 * 1000) obtainBatteryInfo(); + if (batteryMeasurmentTime == 0 || (millis() - batteryMeasurmentTime) > 30 * 1000) obtainBatteryInfo(); #else obtainBatteryInfo(); #endif diff --git a/src/station_utils.cpp b/src/station_utils.cpp index d2b4190..68b71ee 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -224,9 +224,7 @@ namespace STATION_Utils { } } else { String path = Config.path; - if (gps.speed.kmph() > 200 || gps.altitude.meters() > 9000) { // avoid plane speed and altitude - path = ""; - } + if (gps.speed.kmph() > 200 || gps.altitude.meters() > 9000) path = ""; // avoid plane speed and altitude if (miceActive) { packet = APRSPacketLib::generateMiceGPSBeacon(currentBeacon->micE, currentBeacon->callsign, currentBeacon->symbol, currentBeacon->overlay, path, gps.location.lat(), gps.location.lng(), gps.course.deg(), gps.speed.knots(), gps.altitude.meters()); } else { @@ -242,6 +240,7 @@ namespace STATION_Utils { comment = currentBeacon->comment; sendCommentAfterXBeacons = Config.sendCommentAfterXBeacons; } + String batteryVoltage = POWER_Utils::getBatteryInfoVoltage(); bool shouldSleepLowVoltage = false; #if defined(BATTERY_PIN) || defined(HAS_AXP192) || defined(HAS_AXP2101) @@ -249,6 +248,7 @@ namespace STATION_Utils { shouldSleepLowVoltage = true; } #endif + if (Config.battery.sendVoltage && !Config.battery.voltageAsTelemetry) { String batteryChargeCurrent = POWER_Utils::getBatteryInfoCurrent(); #if defined(HAS_AXP192) @@ -271,6 +271,7 @@ namespace STATION_Utils { comment += "%"; #endif } + if (shouldSleepLowVoltage) { packet += " **LowVoltagePowerOff**"; } else { @@ -283,10 +284,7 @@ namespace STATION_Utils { } } } - #ifdef HAS_TFT - cleanTFT(); - #endif - displayShow("<<< TX >>>", "", packet,100); + displayShow("<<< TX >>>", "", packet, 100); LoRa_Utils::sendNewPacket(packet); if (Config.bluetooth.type == 0 || Config.bluetooth.type == 2) { // send Tx packets to Phone too @@ -306,9 +304,6 @@ namespace STATION_Utils { } lastTxTime = millis(); sendUpdate = false; - #ifdef HAS_TFT - cleanTFT(); - #endif if (currentBeacon->gpsEcoMode) { gpsShouldSleep = true; }