Skip to content

Commit f0aa093

Browse files
committed
Issue #1059 - Changed the way IrqFired global variable is handled by RadioIrqProcess
1 parent 83cd9da commit f0aa093

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/radio/sx126x/radio.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,13 +1212,14 @@ void RadioOnDioIrq( void* context )
12121212

12131213
void RadioIrqProcess( void )
12141214
{
1215-
if( IrqFired == true )
1216-
{
1217-
CRITICAL_SECTION_BEGIN( );
1218-
// Clear IRQ flag
1219-
IrqFired = false;
1220-
CRITICAL_SECTION_END( );
1215+
CRITICAL_SECTION_BEGIN( );
1216+
// Clear IRQ flag
1217+
const bool isIrqFired = IrqFired;
1218+
IrqFired = false;
1219+
CRITICAL_SECTION_END( );
12211220

1221+
if( isIrqFired == true )
1222+
{
12221223
uint16_t irqRegs = SX126xGetIrqStatus( );
12231224
SX126xClearIrqStatus( irqRegs );
12241225

0 commit comments

Comments
 (0)