summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index 6dc9447..3fdec38 100644
--- a/main.cpp
+++ b/main.cpp
@@ -41,6 +41,10 @@ ButtonHandler* buttons;
LoRaHandler* lora;
mDot* dot;
+// GPS
+GPSPARSER* gps;
+MTSSerial gps_serial(XBEE_DOUT, XBEE_DIN, 256, 2048);
+
// Modes
ModeJoin* modeJoin;
ModeSingle* modeSingle;
@@ -50,6 +54,7 @@ ModeConfig* modeConfig;
// Serial debug port
Serial debug(USBTX, USBRX);
+
// Prototypes
void mainMenu();
void join();
@@ -67,18 +72,22 @@ int main() {
buttons = new ButtonHandler(main_id);
dot = mDot::getInstance();
lora = new LoRaHandler(main_id);
+ gps = new GPSPARSER(&gps_serial);
+
+ MTSLog::setLogLevel(MTSLog::TRACE_LEVEL);
+
+ modeJoin = new ModeJoin(lcd, buttons, dot, lora, gps);
+ modeSingle = new ModeSingle(lcd, buttons, dot, lora, gps);
+ modeSweep = new ModeSweep(lcd, buttons, dot, lora, gps);
+ modeConfig = new ModeConfig(lcd, buttons, dot, lora, gps);
- modeJoin = new ModeJoin(lcd, buttons, dot, lora);
- modeSingle = new ModeSingle(lcd, buttons, dot, lora);
- modeSweep = new ModeSweep(lcd, buttons, dot, lora);
- modeConfig = new ModeConfig(lcd, buttons, dot, lora);
+ logInfo("GPS %sdetected", gps->gpsDetected() ? "" : "not ");
// display startup screen for 3 seconds
LayoutStartup ls(lcd, dot);
ls.display();
osDelay(3000);
- MTSLog::setLogLevel(MTSLog::TRACE_LEVEL);
logInfo("displaying main menu");
mainMenu();