summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-11-30 15:50:22 -0600
committerMike Fiore <mfiore@multitech.com>2015-11-30 15:50:22 -0600
commit37260f2ccff2793f54bfd291169d2c8d879bbc15 (patch)
treeb908d697eb6f2d1ba2c305eacc3c7c7bb6203122 /main.cpp
parent30b4f15aa70d24ec0a6b6bb1b3f5039c4921cb02 (diff)
downloadmtdot-box-evb-factory-firmware-37260f2ccff2793f54bfd291169d2c8d879bbc15.tar.gz
mtdot-box-evb-factory-firmware-37260f2ccff2793f54bfd291169d2c8d879bbc15.tar.bz2
mtdot-box-evb-factory-firmware-37260f2ccff2793f54bfd291169d2c8d879bbc15.zip
start work on survey sweep - currently determines rates and power levels to use and prints them out
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp37
1 files changed, 4 insertions, 33 deletions
diff --git a/main.cpp b/main.cpp
index c63f922..47fbda3 100644
--- a/main.cpp
+++ b/main.cpp
@@ -23,6 +23,7 @@
// mode objects
#include "ModeJoin.h"
#include "ModeSingle.h"
+#include "ModeSweep.h"
#include "ModeConfig.h"
// misc heders
#include <string>
@@ -48,6 +49,7 @@ mDot* dot;
// Modes
ModeJoin* modeJoin;
ModeSingle* modeSingle;
+ModeSweep* modeSweep;
ModeConfig* modeConfig;
// Serial debug port
@@ -73,6 +75,7 @@ int main() {
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);
// display startup screen for 3 seconds
@@ -149,7 +152,7 @@ void mainMenu() {
modeSingle->start();
} else if (selected == menu_strings[sweep]) {
if (modeJoin->start())
- surveySweep();
+ modeSweep->start();
}
mode_selected = false;
@@ -189,35 +192,3 @@ void loraDemo() {
}
}
-void surveySweep() {
- LayoutHelp lh(lcd);
- lh.display();
- lh.updateMode("Survey Sweep");
- lh.updateSw1(" Cancel");
- lh.updateSw2("Sweep");
-
- // clear any stale signals
- osSignalClear(main_id, buttonSignal | loraSignal);
-
- logInfo("survey sweep mode");
-
- while (true) {
- osEvent e = Thread::signal_wait(buttonSignal);
- if (e.status == osEventSignal) {
- ButtonHandler::ButtonEvent ev = buttons->getButtonEvent();
- switch (ev) {
- case ButtonHandler::sw1_press:
- logInfo("cancel");
- break;
- case ButtonHandler::sw2_press:
- logInfo("start sweep");
- break;
- case ButtonHandler::sw1_hold:
- return;
- default:
- break;
- }
- }
- }
-}
-