diff options
-rw-r--r-- | Layout/LayoutStartup.cpp | 11 | ||||
-rw-r--r-- | Layout/LayoutStartup.h | 2 | ||||
-rw-r--r-- | main.cpp | 8 |
3 files changed, 16 insertions, 5 deletions
diff --git a/Layout/LayoutStartup.cpp b/Layout/LayoutStartup.cpp index c317a7f..1662155 100644 --- a/Layout/LayoutStartup.cpp +++ b/Layout/LayoutStartup.cpp @@ -11,6 +11,7 @@ LayoutStartup::LayoutStartup(DOGS102* lcd, mDot* dot) _lVersion(0, 5, "Version"), _fVersion(8, 5, 9), _fId(0, 7, 17), + _fGps(0, 6, 17), _iLogo(0, 0, MultiTech_Logo) {} @@ -32,3 +33,13 @@ void LayoutStartup::display() { endUpdate(); } + +void LayoutStartup::updateGPS(bool gps) { + char buf[32]; + size_t size; + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%sGPS Detected", gps ? "" : "No "); + writeField(_fGps, buf, size); +} + diff --git a/Layout/LayoutStartup.h b/Layout/LayoutStartup.h index c67ab1e..4490887 100644 --- a/Layout/LayoutStartup.h +++ b/Layout/LayoutStartup.h @@ -10,6 +10,7 @@ class LayoutStartup : public Layout { ~LayoutStartup(); void display(); + void updateGPS(bool gps); private: mDot* _dot; @@ -19,6 +20,7 @@ class LayoutStartup : public Layout { Label _lVersion; Field _fVersion; + Field _fGps; Field _fId; Image _iLogo; @@ -62,10 +62,6 @@ char* file_name; // Prototypes void mainMenu(); -void join(); -void loraDemo(); -void surveySingle(); -void surveySweep(); int main() { debug.baud(115200); @@ -93,11 +89,13 @@ int main() { modeDemo = new ModeDemo(lcd, buttons, dot, lora, gps); modeConfig = new ModeConfig(lcd, buttons, dot, lora, gps); - logInfo("GPS %sdetected", gps->gpsDetected() ? "" : "not "); + osDelay(1000); + logInfo("%sGPS detected", gps->gpsDetected() ? "" : "no "); // display startup screen for 3 seconds LayoutStartup ls(lcd, dot); ls.display(); + ls.updateGPS(gps->gpsDetected()); osDelay(3000); logInfo("displaying main menu"); |