MTDOT-BOX-EVB-Factory-Firmware
Dependencies: NCP5623B GpsParser ISL29011 libmDot-mbed5 MTS-Serial MMA845x DOGS102 MPL3115A2
Diff: Mode/ModeDemo.cpp
- Revision:
- 7:a31236c2e75c
- Parent:
- 1:71125aa00e33
- Child:
- 12:05435282f899
--- a/Mode/ModeDemo.cpp Fri Nov 04 22:21:01 2016 +0000 +++ b/Mode/ModeDemo.cpp Fri Nov 04 17:27:05 2016 -0500 @@ -41,9 +41,14 @@ _initial_data_rate = _dot->getTxDataRate(); // use configured data rate and power if possible - if (_band == mDot::FB_915 && _initial_data_rate == mDot::SF_10) { - logInfo("using SF_9 instead of SF_10 - SF_10 max packet size is too small for data"); - _dot->setTxDataRate(mDot::SF_9); + if ((_band == mDot::FB_US915 || _band == mDot::FB_AU915) && (_initial_data_rate == mDot::DR0 || _initial_data_rate == mDot::SF_10)) { + if(_initial_data_rate == mDot::DR0){ + logInfo("using DR1 instead of DR0 - DR0 max packet size is too small for data"); + _dot->setTxDataRate(mDot::DR1); + }else{ + logInfo("using SF_9 instead of SF_10 - SF_10 max packet size is too small for data"); + _dot->setTxDataRate(mDot::SF_9); + } } _state = show_help; @@ -103,8 +108,9 @@ case ButtonHandler::sw1_hold: _send_timer.stop(); _send_timer.reset(); - if (_band == mDot::FB_915) + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { _dot->setTxDataRate(_initial_data_rate); + } return true; } }