From f4ff52aa50ea634c33970e96f429ae5b84255e4c Mon Sep 17 00:00:00 2001 From: huangly Date: Tue, 7 May 2024 09:56:56 +0800 Subject: [PATCH] [LoRaMac ProcessRadioTxDone]Optimize code reading and execution conditions --- Middlewares/Third_Party/LoRaWAN/Mac/LoRaMac.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Middlewares/Third_Party/LoRaWAN/Mac/LoRaMac.c b/Middlewares/Third_Party/LoRaWAN/Mac/LoRaMac.c index 1d0631f7..9cccc1d6 100644 --- a/Middlewares/Third_Party/LoRaWAN/Mac/LoRaMac.c +++ b/Middlewares/Third_Party/LoRaWAN/Mac/LoRaMac.c @@ -1041,6 +1041,9 @@ static void ProcessRadioTxDone( void ) phyParam = RegionGetPhyParam( Nvm.MacGroup2.Region, &getPhy ); TimerSetValue( &MacCtx.AckTimeoutTimer, MacCtx.RxWindow2Delay + phyParam.Value ); TimerStart( &MacCtx.AckTimeoutTimer ); + } else if( MacCtx.NodeAckRequested == false ) + { + MacCtx.McpsConfirm.Status = LORAMAC_EVENT_INFO_STATUS_OK; } #elif (defined( LORAMAC_VERSION ) && (( LORAMAC_VERSION == 0x01000400 ) || ( LORAMAC_VERSION == 0x01010100 ))) if( MacCtx.NodeAckRequested == true ) @@ -1072,13 +1075,6 @@ static void ProcessRadioTxDone( void ) } RegionSetBandTxDone( Nvm.MacGroup2.Region, &txDone ); - -#if (defined( LORAMAC_VERSION ) && ( LORAMAC_VERSION == 0x01000300 )) - if( MacCtx.NodeAckRequested == false ) - { - MacCtx.McpsConfirm.Status = LORAMAC_EVENT_INFO_STATUS_OK; - } -#endif /* LORAMAC_VERSION */ } static void PrepareRxDoneAbort( void )