diff options
Diffstat (limited to 'Mode/ModeSingle.cpp')
-rw-r--r-- | Mode/ModeSingle.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Mode/ModeSingle.cpp b/Mode/ModeSingle.cpp index 70d131c..52f7c21 100644 --- a/Mode/ModeSingle.cpp +++ b/Mode/ModeSingle.cpp @@ -1,8 +1,8 @@ #include "ModeSingle.h" #include "MTSLog.h" -ModeSingle::ModeSingle(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHandler* lora, GPSPARSER* gps) - : Mode(lcd, buttons, dot, lora, gps), +ModeSingle::ModeSingle(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHandler* lora, GPSPARSER* gps, SensorHandler* sensors) + : Mode(lcd, buttons, dot, lora, gps, sensors), _help(lcd), _file(lcd), _confirm(lcd), @@ -23,6 +23,9 @@ bool ModeSingle::start() { // clear any stale signals osSignalClear(_main_id, buttonSignal | loraSignal); + _initial_data_rate = _dot->getTxDataRate(); + _initial_power = _dot->getTxPower(); + // see if we're supposed to send the data packet after success // that item is stored in the mDot::StartUpMode config field _send_data = _dot->getStartUpMode(); @@ -118,6 +121,8 @@ bool ModeSingle::start() { } break; case ButtonHandler::sw1_hold: + _dot->setTxDataRate(_initial_data_rate); + _dot->setTxPower(_initial_power); return true; } } @@ -290,7 +295,6 @@ std::string ModeSingle::formatRatePower() { char buf[8]; size_t size; - memset(buf, 0, sizeof(buf)); msg += "DR="; msg += _dot->DataRateStr(_data_rate).substr(3); msg += " P="; |