Skip to content

Commit a184dd8

Browse files
author
Daniel Jäckle
committed
Introduce a new status MAC_RX_ABORT. Reset MAC_TX_RUNNING only in OnMacStateCheckTimerEvent.
1 parent 73b73c3 commit a184dd8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mac/LoRaMac.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ enum eLoRaMacState
452452
MAC_ACK_RETRY = 0x00000008,
453453
MAC_TX_DELAYED = 0x00000010,
454454
MAC_TX_CONFIG = 0x00000020,
455+
MAC_RX_ABORT = 0x00000040,
455456
};
456457

457458
/*!
@@ -880,7 +881,7 @@ static void OnRadioTxDone( void )
880881

881882
static void PrepareRxDoneAbort( void )
882883
{
883-
LoRaMacState &= ~MAC_TX_RUNNING;
884+
LoRaMacState |= MAC_RX_ABORT;
884885

885886
if( NodeAckRequested )
886887
{
@@ -1321,6 +1322,12 @@ static void OnMacStateCheckTimerEvent( void )
13211322

13221323
if( LoRaMacFlags.Bits.MacDone == 1 )
13231324
{
1325+
if( ( LoRaMacState & MAC_RX_ABORT ) == MAC_RX_ABORT )
1326+
{
1327+
LoRaMacState &= ~MAC_RX_ABORT;
1328+
LoRaMacState &= ~MAC_TX_RUNNING;
1329+
}
1330+
13241331
if( ( LoRaMacFlags.Bits.MlmeReq == 1 ) || ( ( LoRaMacFlags.Bits.McpsReq == 1 ) ) )
13251332
{
13261333
if( ( McpsConfirm.Status == LORAMAC_EVENT_INFO_STATUS_TX_TIMEOUT ) ||

0 commit comments

Comments
 (0)