HAS NO GPS code improvements

This commit is contained in:
richonguzman 2024-07-05 11:27:48 -04:00
parent 052e32b4c7
commit caff225a22
5 changed files with 16 additions and 18 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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());

View File

@ -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)) {