sforkowany z mirror/meshtastic-firmware
only allow wide BW settings when the right chip is detected
rodzic
a081d28e36
commit
31c2c8a7a3
|
@ -81,6 +81,8 @@ uint8_t kb_model;
|
||||||
// The I2C address of the RTC Module (if found)
|
// The I2C address of the RTC Module (if found)
|
||||||
uint8_t rtc_found;
|
uint8_t rtc_found;
|
||||||
|
|
||||||
|
bool rIf_wide_lora = false;
|
||||||
|
|
||||||
// Keystore Chips
|
// Keystore Chips
|
||||||
uint8_t keystore_found;
|
uint8_t keystore_found;
|
||||||
#ifndef ARCH_PORTDUINO
|
#ifndef ARCH_PORTDUINO
|
||||||
|
@ -374,6 +376,7 @@ void setup()
|
||||||
rIf = NULL;
|
rIf = NULL;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("SX1281 Radio init succeeded, using SX1281 radio\n");
|
DEBUG_MSG("SX1281 Radio init succeeded, using SX1281 radio\n");
|
||||||
|
rIf_wide_lora = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,6 +17,7 @@ extern uint8_t kb_model;
|
||||||
extern uint8_t rtc_found;
|
extern uint8_t rtc_found;
|
||||||
extern uint8_t keystore_found;
|
extern uint8_t keystore_found;
|
||||||
|
|
||||||
|
extern bool rIf_wide_lora;
|
||||||
extern bool eink_found;
|
extern bool eink_found;
|
||||||
extern bool pmu_found;
|
extern bool pmu_found;
|
||||||
extern bool isCharging;
|
extern bool isCharging;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "main.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <pb_decode.h>
|
#include <pb_decode.h>
|
||||||
|
@ -364,37 +365,37 @@ void RadioInterface::applyModemConfig()
|
||||||
|
|
||||||
switch (loraConfig.modem_preset) {
|
switch (loraConfig.modem_preset) {
|
||||||
case Config_LoRaConfig_ModemPreset_SHORT_FAST:
|
case Config_LoRaConfig_ModemPreset_SHORT_FAST:
|
||||||
bw = myRegion->wideLora ? 800 : 250;
|
bw = (myRegion->wideLora && rIf_wide_lora) ? 800 : 250;
|
||||||
cr = 8;
|
cr = 8;
|
||||||
sf = 7;
|
sf = 7;
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_SHORT_SLOW:
|
case Config_LoRaConfig_ModemPreset_SHORT_SLOW:
|
||||||
bw = myRegion->wideLora ? 800 : 250;
|
bw = (myRegion->wideLora && rIf_wide_lora) ? 800 : 250;
|
||||||
cr = 8;
|
cr = 8;
|
||||||
sf = 8;
|
sf = 8;
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_MEDIUM_FAST:
|
case Config_LoRaConfig_ModemPreset_MEDIUM_FAST:
|
||||||
bw = myRegion->wideLora ? 800 : 250;
|
bw = (myRegion->wideLora && rIf_wide_lora) ? 800 : 250;
|
||||||
cr = 8;
|
cr = 8;
|
||||||
sf = 9;
|
sf = 9;
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_MEDIUM_SLOW:
|
case Config_LoRaConfig_ModemPreset_MEDIUM_SLOW:
|
||||||
bw = myRegion->wideLora ? 800 : 250;
|
bw = (myRegion->wideLora && rIf_wide_lora) ? 800 : 250;
|
||||||
cr = 8;
|
cr = 8;
|
||||||
sf = 10;
|
sf = 10;
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_LONG_FAST:
|
case Config_LoRaConfig_ModemPreset_LONG_FAST:
|
||||||
bw = myRegion->wideLora ? 800 : 250;
|
bw = (myRegion->wideLora && rIf_wide_lora) ? 800 : 250;
|
||||||
cr = 8;
|
cr = 8;
|
||||||
sf = 11;
|
sf = 11;
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_LONG_SLOW:
|
case Config_LoRaConfig_ModemPreset_LONG_SLOW:
|
||||||
bw = myRegion->wideLora ? 400 : 125;
|
bw = (myRegion->wideLora && rIf_wide_lora) ? 400 : 125;
|
||||||
cr = 8;
|
cr = 8;
|
||||||
sf = 12;
|
sf = 12;
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW:
|
case Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW:
|
||||||
bw = myRegion->wideLora ? 200 : 31.25;
|
bw = (myRegion->wideLora && rIf_wide_lora) ? 200 : 31.25;
|
||||||
cr = 8;
|
cr = 8;
|
||||||
sf = 12;
|
sf = 12;
|
||||||
break;
|
break;
|
||||||
|
|
Ładowanie…
Reference in New Issue