Merge meshcore-dev dev with routing, WiFi and power-policy compatibility
Integrate upstream 1.18.0, delayed direct ACK forwarding, zero-scope routing, Waveshare LR1121 and dynamic WiFi variants. Preserve fork chemistry-aware power management and bounded multi-interface UI; retain retry/dedup safety while adding upstream ACK delay. Qualify LR1121 band power and HP-only Morse handling with native regressions.
This commit is contained in:
commit
285267e3a1
32 files changed
+765
-27
No files matched your search
@@ -288,6 +288,7 @@ int RegionMap::getTransportKeysFor(const RegionEntry& src, TransportKey dest[],
|
||||
}
|
||||
|
||||
RegionEntry* RegionMap::findMatch(const mesh::Packet* packet, uint8_t mask) {
|
||||
if (packet->transport_codes[0] == 0) return &wildcard;
|
||||
for (int i = 0; i < num_regions; i++) {
|
||||
auto region = ®ions[i];
|
||||
if ((region->flags & mask) == 0) { // does region allow this? (per 'mask' param)
|
||||
|
||||
@@ -12,6 +12,8 @@ class CustomLR1121 : public LR1121 {
|
||||
bool _headerSeen = false;
|
||||
bool _rx_boosted = false;
|
||||
LR11x0MorseRfSwitch _morse_rf_switch;
|
||||
int8_t _txPower = 0;
|
||||
bool _txPowerSet = false;
|
||||
|
||||
public:
|
||||
CustomLR1121(Module *mod) : LR1121(mod) { }
|
||||
@@ -70,6 +72,33 @@ class CustomLR1121 : public LR1121 {
|
||||
return len;
|
||||
}
|
||||
|
||||
using LR1121::setOutputPower;
|
||||
using LR1121::setFrequency;
|
||||
|
||||
int16_t setOutputPower(int8_t power) override {
|
||||
#ifdef LR1121_FORCE_HP_PA
|
||||
const bool force_hp = true; // boards with only RFO_HP_LF wired: never select the LP PA
|
||||
#else
|
||||
const bool force_hp = false;
|
||||
#endif
|
||||
// clip to the active PA's range (HF PA tops out at 13 dBm) rather than fail and keep the other band's PA
|
||||
int8_t clipped = power;
|
||||
checkOutputPower(power, &clipped, force_hp);
|
||||
int16_t state = LR1121::setOutputPower(clipped, force_hp);
|
||||
if (state == RADIOLIB_ERR_NONE) {
|
||||
_txPower = power;
|
||||
_txPowerSet = true;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
int16_t setFrequency(float freq) override {
|
||||
int16_t state = LR1121::setFrequency(freq);
|
||||
// PA selection depends on the band, and set radio / tempradio don't call setTxPower
|
||||
if (state == RADIOLIB_ERR_NONE && _txPowerSet) state = setOutputPower(_txPower);
|
||||
return state;
|
||||
}
|
||||
|
||||
float getFreqMHz() const { return freqMHz; }
|
||||
|
||||
int16_t setRxBoostedGainMode(bool en) {
|
||||
|
||||
@@ -54,8 +54,17 @@ protected:
|
||||
if (!_board->prepareRadioFrequency(frequency_mhz)) return RADIOLIB_ERR_INVALID_FREQUENCY;
|
||||
auto* radio = static_cast<CustomLR1121*>(_radio);
|
||||
const int16_t status = radio->setFrequency(frequency_mhz);
|
||||
return status == RADIOLIB_ERR_NONE
|
||||
? radio->setOutputPower(_dbm_valid ? _cur_dbm : LORA_TX_POWER, false, 304) : status;
|
||||
if (status != RADIOLIB_ERR_NONE) return status;
|
||||
#ifdef LR1121_FORCE_HP_PA
|
||||
const bool force_hp = true;
|
||||
#else
|
||||
const bool force_hp = false;
|
||||
#endif
|
||||
// Preserve the Morse ramp while honoring HP-only wiring and the HF PA's
|
||||
// 13 dBm ceiling, just like the normal packet-power path.
|
||||
int8_t clipped = _dbm_valid ? _cur_dbm : LORA_TX_POWER;
|
||||
radio->checkOutputPower(clipped, &clipped, force_hp);
|
||||
return radio->setOutputPower(clipped, force_hp, 304);
|
||||
}
|
||||
bool restoreCarrierWaveModem() override {
|
||||
if (_morse_rx_fsk_mode) {
|
||||
|
||||
Reference in new issue
Block a user