We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fed2bc5 commit e5076e1Copy full SHA for e5076e1
src/mac/LoRaMac.c
@@ -808,11 +808,15 @@ static void ProcessRadioTxDone( void )
808
{
809
Radio.Sleep( );
810
}
811
+
812
// Setup timers
- TimerSetValue( &MacCtx.RxWindowTimer1, MacCtx.RxWindow1Delay );
813
+ CRITICAL_SECTION_BEGIN( );
814
+ uint32_t offset = TimerGetCurrentTime( ) - TxDoneParams.CurTime;
815
+ TimerSetValue( &MacCtx.RxWindowTimer1, MacCtx.RxWindow1Delay - offset );
816
TimerStart( &MacCtx.RxWindowTimer1 );
- TimerSetValue( &MacCtx.RxWindowTimer2, MacCtx.RxWindow2Delay );
817
+ TimerSetValue( &MacCtx.RxWindowTimer2, MacCtx.RxWindow2Delay - offset );
818
TimerStart( &MacCtx.RxWindowTimer2 );
819
+ CRITICAL_SECTION_END( );
820
821
if( MacCtx.NodeAckRequested == true )
822
0 commit comments