From 648bb8d0cd3f62a53a6757c27d11da70c8c6ea71 Mon Sep 17 00:00:00 2001 From: lewisxhe Date: Fri, 4 Oct 2024 16:41:40 +0800 Subject: [PATCH] Added GPS Model info --- examples/UnitTest/UnitTest.ino | 5 ++++- examples/UnitTest/ui.cpp | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/UnitTest/UnitTest.ino b/examples/UnitTest/UnitTest.ino index 0cc6f58..808edb3 100644 --- a/examples/UnitTest/UnitTest.ino +++ b/examples/UnitTest/UnitTest.ino @@ -45,7 +45,7 @@ #include TinyGPSPlus gps; - +String gps_model = "None"; #define MIC_I2S_SAMPLE_RATE 16000 #define MIC_I2S_PORT I2S_NUM_1 @@ -199,6 +199,7 @@ bool setupGPS() ver = SerialGPS.readStringUntil('\n'); if (ver.startsWith("$GPTXT,01,01,02")) { Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n"); + gps_model = "L76K"; result = true; break; } @@ -1014,6 +1015,8 @@ void setup() for (int i = 0; i < 3; ++i) { Serial.printf("Use baudrate : %u\n", baudrate[i]); if (GPS_Recovery()) { + Serial.println("UBlox-M10Q GNSS init succeeded, using UBlox-M10Q GNSS Module\n"); + gps_model = "UBlox-M10"; break; } Serial.printf("Update baudrate : %u\n", baudrate[i]); diff --git a/examples/UnitTest/ui.cpp b/examples/UnitTest/ui.cpp index 6dfe203..8122265 100644 --- a/examples/UnitTest/ui.cpp +++ b/examples/UnitTest/ui.cpp @@ -70,6 +70,7 @@ extern void setTxPower(int16_t dBm); extern void setSenderInterval(uint32_t interval_ms); extern bool enterSleep; +extern String gps_model; void lv_brightness_cb(lv_event_t *e) @@ -310,6 +311,7 @@ void setupUI(void) section = lv_menu_section_create(sub_gps_page); sub_section.push_back(section); + create_label(section, LV_SYMBOL_GPS, "Model", gps_model.c_str()); sub_gps_val.label_lat = create_label(section, LV_SYMBOL_GPS, "lat", "N.A"); sub_gps_val.label_lng = create_label(section, LV_SYMBOL_GPS, "lng", "N.A"); sub_gps_val.label_speed = create_label(section, LV_SYMBOL_SETTINGS, "Speed", "N.A");