diff --git a/platformio.ini b/platformio.ini index 4d403ef..a06b8f3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -195,6 +195,7 @@ build_flags = -DTTGO_T_LORA32_V2_1_TNC -DHAS_SX1278 -DHAS_BT_CLASSIC + -DHAS_NO_GPS lib_deps = ${common.lib_deps} adafruit/Adafruit GFX Library @ 1.11.9 @@ -209,6 +210,7 @@ build_flags = -DTTGO_T_LORA32_V2_1_TNC_915 -DHAS_SX1276 -DHAS_BT_CLASSIC + -DHAS_NO_GPS lib_deps = ${common.lib_deps} adafruit/Adafruit GFX Library @ 1.11.9 diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 0641fbc..48723ce 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -45,7 +45,7 @@ TinyGPSPlus gps; OneButton userButton = OneButton(BUTTON_PIN, true, true); #endif -String versionDate = "2024.07.02"; +String versionDate = "2024.07.05"; uint8_t myBeaconsIndex = 0; int myBeaconsSize = Config.beacons.size(); @@ -80,7 +80,6 @@ uint32_t menuTime = millis(); bool flashlight = false; bool digirepeaterActive = false; bool sosActive = false; -bool disableGPS; bool miceActive = false; diff --git a/src/gps_utils.cpp b/src/gps_utils.cpp index 7f0beaa..b7eb43c 100644 --- a/src/gps_utils.cpp +++ b/src/gps_utils.cpp @@ -3,6 +3,7 @@ #include "configuration.h" #include "station_utils.h" #include "boards_pinout.h" +#include "power_utils.h" #include "gps_utils.h" #include "display.h" #include "logger.h" @@ -20,7 +21,6 @@ extern HardwareSerial neo6m_gps; // cambiar a gpsSerial extern TinyGPSPlus gps; extern Beacon *currentBeacon; extern logging::Logger logger; -extern bool disableGPS; extern bool sendUpdate; extern bool sendStandingUpdate; @@ -30,20 +30,16 @@ extern double lastTxLat; extern double lastTxLng; extern double lastTxDistance; extern uint32_t lastTx; +extern bool disableGPS; -double currentHeading = 0; -double previousHeading = 0; -float bearing = 0; +double currentHeading = 0; +double previousHeading = 0; +float bearing = 0; namespace GPS_Utils { void setup() { - #if defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) - disableGPS = true; - #else - disableGPS = Config.disableGPS; - #endif if (disableGPS) { logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, "Main", "GPS disabled"); return; diff --git a/src/menu_utils.cpp b/src/menu_utils.cpp index 3de3846..fc87396 100644 --- a/src/menu_utils.cpp +++ b/src/menu_utils.cpp @@ -511,11 +511,6 @@ namespace MENU_Utils { } } - #if defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) - secondRowMainMenu = ""; - thirdRowMainMenu = " LoRa APRS TNC"; - fourthRowMainMenu = ""; - #else if (disableGPS) { secondRowMainMenu = ""; thirdRowMainMenu = " LoRa APRS TNC"; @@ -592,7 +587,6 @@ namespace MENU_Utils { fourthRowMainMenu += " ***"; } } - #endif if (showHumanHeading) { fifthRowMainMenu = GPS_Utils::getCardinalDirection(gps.course.deg()); diff --git a/src/power_utils.cpp b/src/power_utils.cpp index 4b03eb5..f6f2109 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -33,13 +33,14 @@ extern Configuration Config; extern logging::Logger logger; -extern bool disableGPS; extern bool transmitFlag; uint32_t batteryMeasurmentTime = 0; bool pmuInterrupt; float lora32BatReadingCorr = 6.5; // % of correction to higher value to reflect the real battery voltage (adjust this to your needs) +bool disableGPS; + namespace POWER_Utils { @@ -340,6 +341,12 @@ namespace POWER_Utils { } void setup() { + #ifdef HAS_NO_GPS + disableGPS = true; + #else + disableGPS = Config.disableGPS; + #endif + #ifdef HAS_AXP192 Wire.begin(SDA, SCL); if (begin(Wire)) {