Skip to content

Commit a32de9a

Browse files
committed
Relocate setting of OnRxWindow2TimerEvent for class C
1 parent 2503155 commit a32de9a

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/mac/LoRaMac.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,11 +1112,6 @@ static void PrepareRxDoneAbort( void )
11121112
OnAckTimeoutTimerEvent( );
11131113
}
11141114

1115-
if( ( RxSlot == 0 ) && ( LoRaMacDeviceClass == CLASS_C ) )
1116-
{
1117-
OnRxWindow2TimerEvent( );
1118-
}
1119-
11201115
LoRaMacFlags.Bits.McpsInd = 1;
11211116
LoRaMacFlags.Bits.MacDone = 1;
11221117

@@ -1166,10 +1161,7 @@ static void OnRadioRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t
11661161
McpsIndication.DownLinkCounter = 0;
11671162
McpsIndication.McpsIndication = MCPS_UNCONFIRMED;
11681163

1169-
if( LoRaMacDeviceClass != CLASS_C )
1170-
{
1171-
Radio.Sleep( );
1172-
}
1164+
Radio.Sleep( );
11731165
TimerStop( &RxWindowTimer2 );
11741166

11751167
macHdr.Value = payload[pktHeaderLen++];
@@ -1508,11 +1500,6 @@ static void OnRadioRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t
15081500
PrepareRxDoneAbort( );
15091501
break;
15101502
}
1511-
1512-
if( ( RxSlot == 0 ) && ( LoRaMacDeviceClass == CLASS_C ) )
1513-
{
1514-
OnRxWindow2TimerEvent( );
1515-
}
15161503
LoRaMacFlags.Bits.MacDone = 1;
15171504

15181505
// Trig OnMacCheckTimerEvent call as soon as possible
@@ -1781,6 +1768,11 @@ static void OnMacStateCheckTimerEvent( void )
17811768

17821769
if( LoRaMacFlags.Bits.McpsInd == 1 )
17831770
{
1771+
if( LoRaMacDeviceClass == CLASS_C )
1772+
{// Activate RX2 window for Class C
1773+
OnRxWindow2TimerEvent( );
1774+
}
1775+
17841776
LoRaMacPrimitives->MacMcpsIndication( &McpsIndication );
17851777
LoRaMacFlags.Bits.McpsInd = 0;
17861778
}

0 commit comments

Comments
 (0)