Reset radio activity tracking after successful receive startup

This commit is contained in:
mikecarper committed 2026-10-22 02:39:34 -07:00
1 parent 86a7a27f00
commit e4119a1206
14 files changed
+486 -18

No files matched your search

+6 -1
View File
@@ -124,10 +124,15 @@ class CustomLLCC68 : public LLCC68 {
}
int16_t startReceive() override {
return LLCC68::startReceive(
const int16_t status = LLCC68::startReceive(
RADIOLIB_SX126X_RX_TIMEOUT_INF,
RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED),
RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
if (status == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
return status;
}
bool isReceiving() {
+15 -2
View File
@@ -420,7 +420,12 @@ class CustomLR1110 : public LR1110 {
// Send the already converted values. RadioLib 7.7.1 converts them again
// with 32-bit arithmetic, which overflows for periods above about 131 ms.
return this->setRxDutyCycle(rxPeriodRaw, sleepPeriodRaw, RADIOLIB_LR11X0_RX_DUTY_CYCLE_MODE_RX);
state = this->setRxDutyCycle(rxPeriodRaw, sleepPeriodRaw, RADIOLIB_LR11X0_RX_DUTY_CYCLE_MODE_RX);
if (state == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
return state;
}
int16_t setRxBoostedGainMode(bool en) {
@@ -479,7 +484,11 @@ class CustomLR1110 : public LR1110 {
fastSetRxCycles += DWT->CYCCNT - segment;
#endif
stagedMode = RADIOLIB_RADIO_MODE_NONE;
if (rc == RADIOLIB_ERR_NONE) ++_profileFastResumes;
if (rc == RADIOLIB_ERR_NONE) {
++_profileFastResumes;
_activityAt = 0;
_headerSeen = false;
}
if (rc == RADIOLIB_ERR_NONE) _profilePacketDirty = false;
_profileSwitch.rxResult(rc, true);
return rc;
@@ -490,6 +499,10 @@ class CustomLR1110 : public LR1110 {
RADIOLIB_LR11X0_RX_TIMEOUT_INF,
RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED),
RADIOLIB_IRQ_RX_DEFAULT_MASK | (1UL << RADIOLIB_IRQ_HEADER_ERR), 0);
if (rc == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
_profileSwitch.rxResult(rc, true);
if (rc == RADIOLIB_ERR_NONE) _profilePacketDirty = false;
return rc;
+6 -1
View File
@@ -123,7 +123,12 @@ class CustomLR1121 : public LR1121 {
int16_t startReceive() override {
// include the PREAMBLE_DETECTED irq bit in reported flags.
return LR1121::startReceive(RADIOLIB_LR11X0_RX_TIMEOUT_INF, RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED), RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
const int16_t status = LR1121::startReceive(RADIOLIB_LR11X0_RX_TIMEOUT_INF, RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED), RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
if (status == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
return status;
}
bool isReceiving() {
+6 -1
View File
@@ -33,7 +33,12 @@ class CustomSTM32WLx : public STM32WLx {
int16_t startReceive() override {
// include the PREAMBLE_DETECTED irq bit in reported flags
return STM32WLx::startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF, RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED), RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
const int16_t status = STM32WLx::startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF, RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED), RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
if (status == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
return status;
}
bool isReceiving() {
+15 -1
View File
@@ -550,6 +550,10 @@ class CustomSX1262 : public SX1262 {
// while the SX1262 alternates between its RX and sleep windows.
this->mod->setRfSwitchState(Module::MODE_RX);
}
if (state == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
return state;
}
@@ -712,7 +716,11 @@ class CustomSX1262 : public SX1262 {
rc = setRx(rxTimeout); // original BUSY waits and status checks
}
stagedMode = RADIOLIB_RADIO_MODE_NONE;
if (rc == RADIOLIB_ERR_NONE) ++_profileFastResumes;
if (rc == RADIOLIB_ERR_NONE) {
++_profileFastResumes;
_activityAt = 0;
_headerSeen = false;
}
_coldStandby = rc != RADIOLIB_ERR_NONE;
_profileSwitch.rxResult(rc, true);
return rc;
@@ -723,6 +731,12 @@ class CustomSX1262 : public SX1262 {
RADIOLIB_SX126X_RX_TIMEOUT_INF,
RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED),
RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
// Acknowledged RX entry cleared the previous hardware IRQs. Its local
// activity latches must not classify the next packet as old activity.
if (rc == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
const bool reusable = rc == RADIOLIB_ERR_NONE && _profileSwitch.enabled
&& getPacketType() == RADIOLIB_SX126X_PACKET_TYPE_LORA;
_coldStandby = rc != RADIOLIB_ERR_NONE;
+6 -1
View File
@@ -124,10 +124,15 @@ class CustomSX1268 : public SX1268 {
}
int16_t startReceive() override {
return SX1268::startReceive(
const int16_t status = SX1268::startReceive(
RADIOLIB_SX126X_RX_TIMEOUT_INF,
RADIOLIB_IRQ_RX_DEFAULT_FLAGS | (1UL << RADIOLIB_IRQ_PREAMBLE_DETECTED),
RADIOLIB_IRQ_RX_DEFAULT_MASK, 0);
if (status == RADIOLIB_ERR_NONE) {
_activityAt = 0;
_headerSeen = false;
}
return status;
}
bool isReceiving() {