Browse Source
Merge pull request #1100 from stphnrdmr/dev
Allow SF smaller than 7 to be saved
pull/1104/head
Liam Cottle
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
3 deletions
-
examples/companion_radio/MyMesh.cpp
-
src/helpers/CommonCLI.cpp
|
|
|
@ -1128,7 +1128,7 @@ void MyMesh::handleCmdFrame(size_t len) { |
|
|
|
uint8_t sf = cmd_frame[i++]; |
|
|
|
uint8_t cr = cmd_frame[i++]; |
|
|
|
|
|
|
|
if (freq >= 300000 && freq <= 2500000 && sf >= 7 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7000 && |
|
|
|
if (freq >= 300000 && freq <= 2500000 && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7000 && |
|
|
|
bw <= 500000) { |
|
|
|
_prefs.sf = sf; |
|
|
|
_prefs.cr = cr; |
|
|
|
|
|
|
|
@ -233,7 +233,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch |
|
|
|
uint8_t sf = num > 2 ? atoi(parts[2]) : 0; |
|
|
|
uint8_t cr = num > 3 ? atoi(parts[3]) : 0; |
|
|
|
int temp_timeout_mins = num > 4 ? atoi(parts[4]) : 0; |
|
|
|
if (freq >= 300.0f && freq <= 2500.0f && sf >= 7 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f && temp_timeout_mins > 0) { |
|
|
|
if (freq >= 300.0f && freq <= 2500.0f && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f && temp_timeout_mins > 0) { |
|
|
|
_callbacks->applyTempRadioParams(freq, bw, sf, cr, temp_timeout_mins); |
|
|
|
sprintf(reply, "OK - temp params for %d mins", temp_timeout_mins); |
|
|
|
} else { |
|
|
|
@ -411,7 +411,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch |
|
|
|
float bw = num > 1 ? atof(parts[1]) : 0.0f; |
|
|
|
uint8_t sf = num > 2 ? atoi(parts[2]) : 0; |
|
|
|
uint8_t cr = num > 3 ? atoi(parts[3]) : 0; |
|
|
|
if (freq >= 300.0f && freq <= 2500.0f && sf >= 7 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f) { |
|
|
|
if (freq >= 300.0f && freq <= 2500.0f && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f) { |
|
|
|
_prefs->sf = sf; |
|
|
|
_prefs->cr = cr; |
|
|
|
_prefs->freq = freq; |
|
|
|
|