summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2016-01-06 13:39:51 -0600
committerMike Fiore <mfiore@multitech.com>2016-01-06 13:39:51 -0600
commitc80cdb2f3f7b9b23fde37406572cff6895c3bd95 (patch)
treed20d18fb43b786454f71c11d8eb7137b6d7fd192
parentcbda95f01fd109c5b9d9f35624f57bd4cca069d8 (diff)
downloadmtdot-box-evb-factory-firmware-c80cdb2f3f7b9b23fde37406572cff6895c3bd95.tar.gz
mtdot-box-evb-factory-firmware-c80cdb2f3f7b9b23fde37406572cff6895c3bd95.tar.bz2
mtdot-box-evb-factory-firmware-c80cdb2f3f7b9b23fde37406572cff6895c3bd95.zip
add back button to Interval and Trigger modes in LoRa demo so we don't have to exit back to main menu to switch
-rw-r--r--Mode/ModeDemo.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/Mode/ModeDemo.cpp b/Mode/ModeDemo.cpp
index 3fc7961..0c4ffa2 100644
--- a/Mode/ModeDemo.cpp
+++ b/Mode/ModeDemo.cpp
@@ -44,10 +44,16 @@ bool ModeDemo::start() {
_state = sampling;
_mode = trigger;
_sam.display();
- _sam.updateSw2("Send");
+ _sam.updateSw1(" Send");
+ _sam.updateSw2("Back");
break;
case sampling:
- if (_mode == interval) {
+ if (_mode == trigger) {
+ if (_dot->getNextTxMs() > 0)
+ no_channel = true;
+ else
+ send = true;
+ } else {
_interval = (_interval + 1) % (sizeof(_intervals) / sizeof(uint32_t));
_sam.updateInterval(_intervals[_interval]);
}
@@ -63,15 +69,14 @@ bool ModeDemo::start() {
_send_timer.start();
_sam.display();
_sam.updateSw1("Interval");
+ _sam.updateSw2("Back");
_sam.updateInterval(_intervals[_interval]);
break;
case sampling:
- if (_mode == trigger) {
- if (_dot->getNextTxMs() > 0)
- no_channel = true;
- else
- send = true;
- }
+ _send_timer.stop();
+ _send_timer.reset();
+ _state = show_help;
+ displayHelp();
break;
}
break;
@@ -89,12 +94,13 @@ bool ModeDemo::start() {
switch (_state) {
case sampling:
if (_mode == trigger) {
- _sam.updateSw2("Send");
+ _sam.updateSw1(" Send");
_sam.updateInfo(" ");
} else {
_sam.updateSw1("Interval");
_sam.updateInterval(_intervals[_interval]);
}
+ _sam.updateSw2("Back");
break;
}
break;
@@ -103,12 +109,13 @@ bool ModeDemo::start() {
switch (_state) {
case sampling:
if (_mode == trigger) {
- _sam.updateSw2("Send");
+ _sam.updateSw1(" Send");
_sam.updateInfo(" ");
} else {
_sam.updateSw1("Interval");
_sam.updateInterval(_intervals[_interval]);
}
+ _sam.updateSw2("Back");
break;
}
break;