From d870873c250d27c214f49480401208e50a9cc330 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Mon, 3 Oct 2016 13:11:24 -0500 Subject: Update to support AU915 --- Mode/ModeDemo.cpp | 5 +++-- Mode/ModeGps.cpp | 2 +- Mode/ModeJoin.cpp | 2 +- Mode/ModeSweep.cpp | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'Mode') diff --git a/Mode/ModeDemo.cpp b/Mode/ModeDemo.cpp index 4add135..f32e03c 100644 --- a/Mode/ModeDemo.cpp +++ b/Mode/ModeDemo.cpp @@ -41,7 +41,7 @@ bool ModeDemo::start() { _initial_data_rate = _dot->getTxDataRate(); // use configured data rate and power if possible - if (_band == mDot::FB_915 && _initial_data_rate == mDot::DR0) { + if ((_band == mDot::FB_US915 || _band == mDot::FB_AU915) && _initial_data_rate == mDot::DR0) { logInfo("using DR1 instead of DR0 - DR0 max packet size is too small for data"); _dot->setTxDataRate(mDot::DR1); } @@ -103,8 +103,9 @@ bool ModeDemo::start() { 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; } } diff --git a/Mode/ModeGps.cpp b/Mode/ModeGps.cpp index 47053cb..58b2b1f 100644 --- a/Mode/ModeGps.cpp +++ b/Mode/ModeGps.cpp @@ -67,7 +67,7 @@ void ModeGps::init(){ void ModeGps::drIncrement(){ _data_rate++; - if (_data_rate > mDot::DR3 && _band == mDot::FB_915 || _data_rate > mDot::DR5) { + if ((_data_rate > mDot::DR3 && (_band == mDot::FB_US915 || _band == mDot::FB_AU915)) || _data_rate > mDot::DR5) { _drAll = true; _data_rate = 0; } diff --git a/Mode/ModeJoin.cpp b/Mode/ModeJoin.cpp index 3a86dd9..62ac25d 100644 --- a/Mode/ModeJoin.cpp +++ b/Mode/ModeJoin.cpp @@ -119,7 +119,7 @@ void ModeJoin::display() { _join.updateId(_dot->getNetworkName()); _join.updateKey(_dot->getNetworkPassphrase()); } - if (_band == mDot::FB_915) { + if (_band == mDot::FB_US915 || _band == mDot::FB_AU915) { _sub_band = _dot->getFrequencySubBand(); _join.updateFsb(_sub_band); } diff --git a/Mode/ModeSweep.cpp b/Mode/ModeSweep.cpp index b6bef24..c6de7ba 100644 --- a/Mode/ModeSweep.cpp +++ b/Mode/ModeSweep.cpp @@ -261,7 +261,7 @@ bool ModeSweep::start() { } // wait 5s in EU mode to compensate for potential "no free channel" situations on server - if ((_band == mDot::FB_915 && _display_timer.read_ms() > 2000) || _display_timer.read_ms() > 5000) { + if ((_band != mDot::FB_EU868 && _display_timer.read_ms() > 2000) || _display_timer.read_ms() > 5000) { _display_timer.stop(); _display_timer.reset(); if (_survey_current == _survey_total) { @@ -380,7 +380,7 @@ std::vector ModeSweep::generatePoints() { } uint8_t ModeSweep::payloadToRate(uint8_t payload) { - if (_band == mDot::FB_915) { + if (_band != mDot::FB_EU868) { if (payload <= mDot::MaxLengths_915[mDot::DR0]) return mDot::DR0; else if (payload <= mDot::MaxLengths_915[mDot::DR1]) -- cgit v1.2.3