8000 backporting fix for issue #771 from LoRaMac-node · neurodavid/CubeCell-Arduino@6aaee0b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6aaee0b

Browse files
committed
backporting fix for issue #771 from LoRaMac-node
1 parent 6c14f83 commit 6aaee0b

File tree

1 file changed

+15
-13
lines changed
  • libraries/LoraWan102/src/radio

1 file changed

+15
-13
lines changed

libraries/LoraWan102/src/radio/radio.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,22 +1158,24 @@ void RadioIrqProcess( void )
11581158

11591159
if( ( irqRegs & IRQ_RX_DONE ) == IRQ_RX_DONE )
11601160
{
1161-
//printf("rx done\r\n");
1162-
uint8_t size;
1163-
TimerStop( &RxTimeoutTimer );
1164-
SX126xGetPayload( RadioRxPayload, &size , 255 );
1165-
SX126xGetPacketStatus( &RadioPktStatus );
1166-
if( ( RadioEvents != NULL ) && ( RadioEvents->RxDone != NULL ) && ( irqRegs & IRQ_CRC_ERROR ) != IRQ_CRC_ERROR)
1161+
if( ( irqRegs & IRQ_CRC_ERROR ) == IRQ_CRC_ERROR )
11671162
{
1168-
RadioEvents->RxDone( RadioRxPayload, size, RadioPktStatus.Params.LoRa.RssiPkt, RadioPktStatus.Params.LoRa.SnrPkt );
1163+
if( ( RadioEvents != NULL ) && ( RadioEvents->RxError ) )
1164+
{
1165+
RadioEvents->RxError( );
1166+
}
11691167
}
1170-
}
1171-
1172-
if( ( irqRegs & IRQ_CRC_ERROR ) == IRQ_CRC_ERROR )
1173-
{
1174-
if( ( RadioEvents != NULL ) && ( RadioEvents->RxError ) )
1168+
else
11751169
{
1176-
RadioEvents->RxError( );
1170+
//printf("rx done\r\n");
1171+
uint8_t size;
1172+
TimerStop( &RxTimeoutTimer );
1173+
SX126xGetPayload( RadioRxPayload, &size , 255 );
1174+
SX126xGetPacketStatus( &RadioPktStatus );
1175+
if( ( RadioEvents != NULL ) && ( RadioEvents->RxDone != NULL ) && ( irqRegs & IRQ_CRC_ERROR ) != IRQ_CRC_ERROR)
1176+
{
1177+
RadioEvents->RxDone( RadioRxPayload, size, RadioPktStatus.Params.LoRa.RssiPkt, RadioPktStatus.Params.LoRa.SnrPkt );
1178+
}
11771179
}
11781180
}
11791181

0 commit comments

Comments
 (0)
0