Skip to content

Commit

Permalink
Change vSetNotAllNetworksUp into a more generic vSetAllNetworksUp
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsowa committed Oct 5, 2023
1 parent 6408ee7 commit 9925b16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions source/FreeRTOS_IP_Timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void vCheckNetworkTimers( void )
}
}

xAllNetworksUp = xUp;
vSetAllNetworksUp( xUp );
}
}
}
Expand Down Expand Up @@ -606,11 +606,10 @@ void vIPSetARPResolutionTimerEnableState( BaseType_t xEnableState )
/*-----------------------------------------------------------*/

/**
* @brief Mark that at least one interface is down so that the 'xNetworkTimer' is checked.
* Whenever the timer expires, all interfaces that are down will get a new NetworkDown
* event.
* @brief Mark whether all interfaces are up or at least one interface is down.
* If all interfaces are up, the 'xNetworkTimer' will not be checked.
*/
void vSetNotAllNetworksUp( void )
void vSetAllNetworksUp( BaseType_t xIsAllNetworksUp )
{
xAllNetworksUp = pdFALSE;
xAllNetworksUp = xIsAllNetworksUp;
}
3 changes: 2 additions & 1 deletion source/FreeRTOS_IP_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,8 @@ void prvProcessNetworkDownEvent( struct xNetworkInterface * pxInterface )
}
else
{
vSetNotAllNetworksUp();
/* At least one interface is down. */
vSetAllNetworksUp( pdFALSE );

/* Nothing else to do. When the 'xNetworkTimer' expires, all interfaces
* with bits.bInterfaceUp cleared will get a new 'eNetworkDownEvent' */
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_IP_Utils/FreeRTOS_IP_Utils_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ void test_prvProcessNetworkDownEvent_InterfaceInitFail( void )

vDHCPStop_Expect( &xEndPoint );

vSetNotAllNetworksUp_Expect();
vSetAllNetworksUp_Expect( pdFALSE );

prvProcessNetworkDownEvent( &xInterface );
}
Expand Down

0 comments on commit 9925b16

Please sign in to comment.