Custom Channel Plan version of MTDOT Box firmware

Dependencies:   DOGS102 GpsParser ISL29011 MMA845x MPL3115A2 MTS-Serial NCP5623B libmDot-Custom mDot_Channel_Plans

Fork of MTDOT-BOX-EVB-Factory-Firmware by MultiTech

Revision:
7:a31236c2e75c
Parent:
1:71125aa00e33
Child:
12:5b5e076b5f01
--- 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;
                 }
             }