summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2016-01-06 15:26:08 -0600
committerMike Fiore <mfiore@multitech.com>2016-01-06 15:26:08 -0600
commit4a7f9e8e5bb6377011d63bddfbbd0f5edda8637a (patch)
treef017c042e9d2706e5994843bfa7f0ca31301ccd6
parentfe6d4ae8b42389d48bbb14782d4fbca4d77e014e (diff)
downloadmtdot-box-evb-factory-firmware-4a7f9e8e5bb6377011d63bddfbbd0f5edda8637a.tar.gz
mtdot-box-evb-factory-firmware-4a7f9e8e5bb6377011d63bddfbbd0f5edda8637a.tar.bz2
mtdot-box-evb-factory-firmware-4a7f9e8e5bb6377011d63bddfbbd0f5edda8637a.zip
display countdown over "send" and "interval" labels instead of over "back" label in 868 band and demo mode
-rw-r--r--Layout/LayoutDemoSampling.cpp6
-rw-r--r--Mode/ModeDemo.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/Layout/LayoutDemoSampling.cpp b/Layout/LayoutDemoSampling.cpp
index 769d6b7..fa37bcb 100644
--- a/Layout/LayoutDemoSampling.cpp
+++ b/Layout/LayoutDemoSampling.cpp
@@ -53,11 +53,15 @@ void LayoutDemoSampling::updateSw2(std::string sw2) {
void LayoutDemoSampling::updateCountdown(uint32_t seconds) {
char buf[32];
size_t size;
+ std::string s;
// make sure the string version is used
writeField(_fInfo, string("No Free Channel"), true);
size = snprintf(buf, sizeof(buf), "%lu s", seconds);
- writeField(_fSw2, buf, size, true);
+ for (int i = 0; i < _fSw1._maxSize - size; i++)
+ s.append(" ");
+ s.append(buf, size);
+ writeField(_fSw1, s, true);
}
void LayoutDemoSampling::updateInterval(uint32_t seconds) {
diff --git a/Mode/ModeDemo.cpp b/Mode/ModeDemo.cpp
index d1dc793..380edb7 100644
--- a/Mode/ModeDemo.cpp
+++ b/Mode/ModeDemo.cpp
@@ -73,6 +73,8 @@ bool ModeDemo::start() {
_sam.updateInterval(_intervals[_interval]);
break;
case sampling:
+ no_channel = false;
+ send = false;
_send_timer.stop();
_send_timer.reset();
_state = show_help;
@@ -83,7 +85,8 @@ bool ModeDemo::start() {
case ButtonHandler::sw1_hold:
_send_timer.stop();
_send_timer.reset();
- _dot->setTxDataRate(_initial_data_rate);
+ if (_band == mDot::FB_915)
+ _dot->setTxDataRate(_initial_data_rate);
return true;
}
}