diff --git a/lib/gps/gps.cpp b/lib/gps/gps.cpp index 24eb3d9b..15b50285 100644 --- a/lib/gps/gps.cpp +++ b/lib/gps/gps.cpp @@ -19,7 +19,6 @@ TinyGPSPlus GPS = TinyGPSPlus(); TinyGPSCustom pdop(GPS, PSTR("GNGSA"), 15); // $GNGSA sentence, 15th element TinyGPSCustom hdop(GPS, PSTR("GNGSA"), 16); // $GNGSA sentence, 16th element TinyGPSCustom vdop(GPS, PSTR("GNGSA"), 17); // $GNGSA sentence, 17th element -TinyGPSCustom fix(GPS, PSTR("GNGGA"), 6); TinyGPSCustom fixMode(GPS, PSTR("GNGSA"), 2); GSV GPS_GSV; // GPS Satellites in view @@ -32,7 +31,6 @@ GSV BD_GSV; // BEIDOU Satellites in view TinyGPSCustom pdop(GPS, PSTR("GPGSA"), 15); // $GPGSA sentence, 15th element TinyGPSCustom hdop(GPS, PSTR("GPGSA"), 16); // $GPGSA sentence, 16th element TinyGPSCustom vdop(GPS, PSTR("GPGSA"), 17); // $GPGSA sentence, 17th element -TinyGPSCustom fix(GPS, PSTR("GPGGA"), 6); TinyGPSCustom fixMode(GPS, PSTR("GPGSA"), 2); GSV GPS_GSV; // GPS Satellites in view diff --git a/lib/gps/gps.hpp b/lib/gps/gps.hpp index bd040103..1bf0617b 100644 --- a/lib/gps/gps.hpp +++ b/lib/gps/gps.hpp @@ -52,7 +52,6 @@ struct GSV extern TinyGPSCustom pdop; // $GNGSA sentence, 15th element extern TinyGPSCustom hdop; // $GNGSA sentence, 16th element extern TinyGPSCustom vdop; // $GNGSA sentence, 17th element - extern TinyGPSCustom fix; extern TinyGPSCustom fixMode; extern GSV GPS_GSV; // GPS Satellites in view @@ -65,7 +64,6 @@ struct GSV extern TinyGPSCustom pdop; // $GPGSA sentence, 15th element extern TinyGPSCustom hdop; // $GPGSA sentence, 16th element extern TinyGPSCustom vdop; // $GPGSA sentence, 17th element - extern TinyGPSCustom fix; extern TinyGPSCustom fixMode; extern GSV GPS_GSV; // GPS Satellites in view diff --git a/lib/gui/src/notifyBar.cpp b/lib/gui/src/notifyBar.cpp index 38445a2d..cbe5a11a 100644 --- a/lib/gui/src/notifyBar.cpp +++ b/lib/gui/src/notifyBar.cpp @@ -82,22 +82,27 @@ void updateNotifyBarTimer(lv_timer_t *t) lv_obj_send_event(gpsTime, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_send_event(gpsCount, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_send_event(gpsFixMode, LV_EVENT_VALUE_CHANGED, NULL); - - switch (atoi(fix.value())) + + if (GPS.location.isValid()) { - case 0: - lv_led_off(gpsFix); - break; - case 1: - lv_led_toggle(gpsFix); - break; - case 2: - lv_led_toggle(gpsFix); - break; - default: - lv_led_off(gpsFix); - break; + switch (GPS.location.FixQuality()) + { + case '0': + lv_led_off(gpsFix); + break; + case '1': + lv_led_toggle(gpsFix); + break; + case '2': + lv_led_toggle(gpsFix); + break; + default: + lv_led_off(gpsFix); + break; + } } + else + lv_led_off(gpsFix); #ifdef ENABLE_BME tempValue = (uint8_t)(bme.readTemperature()); @@ -173,7 +178,7 @@ void createNotifyBar() lv_led_off(gpsFix); gpsFixMode = lv_label_create(notifyBarIcons); - lv_obj_set_style_text_font(gpsFixMode, &lv_font_montserrat_10, 0); + lv_obj_set_style_text_font(gpsFixMode, fontSmall, 0); lv_label_set_text_static(gpsFixMode, "--"); lv_obj_add_event_cb(gpsFixMode, updateNotifyBar, LV_EVENT_VALUE_CHANGED, NULL); diff --git a/lib/utils/src/gpsMath.hpp b/lib/utils/src/gpsMath.hpp index a040a3b1..cb8873bb 100644 --- a/lib/utils/src/gpsMath.hpp +++ b/lib/utils/src/gpsMath.hpp @@ -12,7 +12,7 @@ #include #include -#define EARTH_RADIUS 6378137 // Earth Radius +#define EARTH_RADIUS 6371009 //6378137 // Earth Radius #define METER_PER_PIXELS 156543.03 // Meters per pixels #define DEG2RAD(a) ((a) / (180 / M_PI)) // Convert degrees to radians @@ -29,4 +29,4 @@ float mapFloat(float x, float inMin, float inMax, float outMin, float outMax); char *latFormatString(double lat); char *lonFormatString(double lon); -#endif \ No newline at end of file +#endif diff --git a/platformio.ini b/platformio.ini index 3bbdeaae..0e7f5a11 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,7 @@ default_envs = CUSTOMBOARD platform = espressif32 framework = arduino version = 0.1.8_dev -revision = 62 +revision = 63 monitor_speed = 115200 monitor_rts = 0 monitor_dtr = 0 @@ -40,7 +40,7 @@ build_flags = ; -D DISABLE_CLI=1 # removed CLI module. Config via Bluetooth only lib_deps = - mikalhart/TinyGPSPlus@^1.0.3 + mikalhart/TinyGPSPlus@^1.1.0 paulstoffregen/Time@^1.6.1 lvgl/lvgl@^9.1.0 lovyan03/LovyanGFX@^1.1.16 @@ -61,7 +61,7 @@ board_build.partitions = default_16MB.csv lib_deps = ${common.lib_deps} adafruit/Adafruit Unified Sensor@^1.1.14 - adafruit/Adafruit BusIO@^1.16.0 + adafruit/Adafruit BusIO@^1.16.1 adafruit/Adafruit BME280 Library@^2.2.4 adafruit/Adafruit HMC5883 Unified@^1.2.3 build_flags =