Skip to content

Commit

Permalink
Change custom Fix to TinyGPS++ FixQuality
Browse files Browse the repository at this point in the history
  • Loading branch information
jgauchia committed Jun 15, 2024
1 parent 6e20726 commit 862db34
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
2 changes: 0 additions & 2 deletions lib/gps/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions lib/gps/gps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
35 changes: 20 additions & 15 deletions lib/gui/src/notifyBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 862db34

Please sign in to comment.