Skip to content

Commit f3f6560

Browse files
committed
Ensure that the radio is in an IDLE state before performing the LBT operation.
For regions where LBT is used the stack could end up in an end less loop displaying the following message: ``` ... ###### ===== MCPS-Request ==== ###### STATUS : Busy beacon reserved time ###### ===== MCPS-Request ==== ###### STATUS : Busy beacon reserved time ... ``` The issue is that the LBT operation could happen when the beacon reception is started but before the `RxDone` or `RxTimeout` IRQ.
1 parent 1f0448b commit f3f6560

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/radio/sx126x/radio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,11 @@ bool RadioIsChannelFree( RadioModems_t modem, uint32_t freq, int16_t rssiThresh,
562562
int16_t rssi = 0;
563563
uint32_t carrierSenseTime = 0;
564564

565+
if( RadioGetStatus( ) != RF_IDLE )
566+
{
567+
return false;
568+
}
569+
565570
RadioSetModem( modem );
566571

567572
RadioSetChannel( freq );

src/radio/sx1272/sx1272.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ bool SX1272IsChannelFree( RadioModems_t modem, uint32_t freq, int16_t rssiThresh
260260
int16_t rssi = 0;
261261
uint32_t carrierSenseTime = 0;
262262

263+
if( SX1272GetStatus( ) != RF_IDLE )
264+
{
265+
return false;
266+
}
267+
263268
SX1272SetModem( modem );
264269

265270
SX1272SetChannel( freq );

src/radio/sx1276/sx1276.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ bool SX1276IsChannelFree( RadioModems_t modem, uint32_t freq, int16_t rssiThresh
271271
int16_t rssi = 0;
272272
uint32_t carrierSenseTime = 0;
273273

274+
if( SX1276GetStatus( ) != RF_IDLE )
275+
{
276+
return false;
277+
}
278+
274279
SX1276SetModem( modem );
275280

276281
SX1276SetChannel( freq );

0 commit comments

Comments
 (0)