From caf1d23ac7bd0e771f20829b29e3af3adb2a223d Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Mon, 3 Oct 2016 13:50:34 -0500 Subject: set AU/US max at DR4 and EU max at DR6 --- Mode/ModeGps.cpp | 2 +- Mode/ModeSingle.cpp | 2 +- Mode/ModeSweep.cpp | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mode/ModeGps.cpp b/Mode/ModeGps.cpp index 58b2b1f..98ecb54 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_US915 || _band == mDot::FB_AU915)) || _data_rate > mDot::DR5) { + if ((_data_rate > mDot::DR4 && (_band == mDot::FB_US915 || _band == mDot::FB_AU915)) || _data_rate > mDot::DR6) { _drAll = true; _data_rate = 0; } diff --git a/Mode/ModeSingle.cpp b/Mode/ModeSingle.cpp index 6cc3f4b..b95a6ea 100644 --- a/Mode/ModeSingle.cpp +++ b/Mode/ModeSingle.cpp @@ -326,7 +326,7 @@ void ModeSingle::incrementRatePower() { _data_rate++; if ((_band == mDot::FB_US915 && _data_rate > mDot::DR4) || (_band == mDot::FB_AU915 && _data_rate > mDot::DR4) || - (_band == mDot::FB_EU868 && _data_rate > mDot::DR7)) { + (_band == mDot::FB_EU868 && _data_rate > mDot::DR6)) { _data_rate = mDot::DR0; } } else { diff --git a/Mode/ModeSweep.cpp b/Mode/ModeSweep.cpp index c6de7ba..b5a2b15 100644 --- a/Mode/ModeSweep.cpp +++ b/Mode/ModeSweep.cpp @@ -380,7 +380,14 @@ std::vector ModeSweep::generatePoints() { } uint8_t ModeSweep::payloadToRate(uint8_t payload) { - if (_band != mDot::FB_EU868) { + if (_band == mDot::FB_EU868) { + if (payload <= mDot::MaxLengths_868[mDot::DR0]) + return mDot::DR0; + else if (payload <= mDot::MaxLengths_868[mDot::DR3]) + return mDot::DR3; + else + return mDot::DR6; + } else { if (payload <= mDot::MaxLengths_915[mDot::DR0]) return mDot::DR0; else if (payload <= mDot::MaxLengths_915[mDot::DR1]) @@ -389,13 +396,6 @@ uint8_t ModeSweep::payloadToRate(uint8_t payload) { return mDot::DR2; else return mDot::DR4; - } else { - if (payload <= mDot::MaxLengths_868[mDot::DR0]) - return mDot::DR0; - else if (payload <= mDot::MaxLengths_868[mDot::DR3]) - return mDot::DR3; - else - return mDot::DR6; } } -- cgit v1.2.3