Skip to content

Commit 5a70705

Browse files
committed
Change vSetNotAllNetworksUp into a more generic vSetAllNetworksUp
1 parent 6408ee7 commit 5a70705

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

source/FreeRTOS_IP_Timers.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void vCheckNetworkTimers( void )
328328
}
329329
}
330330

331-
xAllNetworksUp = xUp;
331+
vSetAllNetworksUp( xUp );
332332
}
333333
}
334334
}
@@ -606,11 +606,10 @@ void vIPSetARPResolutionTimerEnableState( BaseType_t xEnableState )
606606
/*-----------------------------------------------------------*/
607607

608608
/**
609-
* @brief Mark that at least one interface is down so that the 'xNetworkTimer' is checked.
610-
* Whenever the timer expires, all interfaces that are down will get a new NetworkDown
611-
* event.
609+
* @brief Mark whether all interfaces are up or at least one interface is down.
610+
* If all interfaces are up, the 'xNetworkTimer' will not be checked.
612611
*/
613-
void vSetNotAllNetworksUp( void )
612+
void vSetAllNetworksUp( BaseType_t xIsAllNetworksUp )
614613
{
615-
xAllNetworksUp = pdFALSE;
614+
xAllNetworksUp = xIsAllNetworksUp;
616615
}

source/FreeRTOS_IP_Utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,8 @@ void prvProcessNetworkDownEvent( struct xNetworkInterface * pxInterface )
961961
}
962962
else
963963
{
964-
vSetNotAllNetworksUp();
964+
/* At least one interface is down. */
965+
vSetAllNetworksUp( pdFALSE );
965966

966967
/* Nothing else to do. When the 'xNetworkTimer' expires, all interfaces
967968
* with bits.bInterfaceUp cleared will get a new 'eNetworkDownEvent' */

source/include/FreeRTOS_IP_Private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,8 @@ BaseType_t xIsCallingFromIPTask( void );
882882
/* Send the network-up event and start the ARP timer. */
883883
void vIPNetworkUpCalls( struct xNetworkEndPoint * pxEndPoint );
884884

885-
/* Mark that at least one interface is down to trigger repeated NetworkDown events. */
886-
void vSetNotAllNetworksUp( void );
885+
/* Mark whether all interfaces are up or at least one interface is down. */
886+
void vSetAllNetworksUp( BaseType_t xIsAllNetworksUp );
887887

888888
/* *INDENT-OFF* */
889889
#ifdef __cplusplus

test/unit-test/FreeRTOS_IP_Utils/FreeRTOS_IP_Utils_utest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ void test_prvProcessNetworkDownEvent_InterfaceInitFail( void )
581581

582582
vDHCPStop_Expect( &xEndPoint );
583583

584-
vSetNotAllNetworksUp_Expect();
584+
vSetAllNetworksUp_Expect( pdFALSE );
585585

586586
prvProcessNetworkDownEvent( &xInterface );
587587
}

0 commit comments

Comments
 (0)