summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-12-02 12:01:38 -0600
committerMike Fiore <mfiore@multitech.com>2015-12-02 12:01:38 -0600
commit10a50c37dfa08f0355ceb5664b92f50b4aba9fd2 (patch)
treed21c0cf2397dec35378c9adae0e91c534e0ebf7b /main.cpp
parentab6c90739bc2efb5eaf94474be8916fe0f990707 (diff)
downloadmtdot-box-evb-factory-firmware-10a50c37dfa08f0355ceb5664b92f50b4aba9fd2.tar.gz
mtdot-box-evb-factory-firmware-10a50c37dfa08f0355ceb5664b92f50b4aba9fd2.tar.bz2
mtdot-box-evb-factory-firmware-10a50c37dfa08f0355ceb5664b92f50b4aba9fd2.zip
use a global GPS object like we do for buttons, LoRa, etc
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();