Skip to content

Commit

Permalink
Merge pull request #5 from bjsowa/dev-stm32-network-down
Browse files Browse the repository at this point in the history
Support network down event and reinitialization
  • Loading branch information
HTRamsey authored Oct 20, 2023
2 parents 0265752 + 41d699c commit 9d9dbeb
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions source/portable/NetworkInterface/STM32/NetworkInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ static BaseType_t xSTM32_NetworkInterfaceInitialise( NetworkInterface_t * pxInte

case eMACInitComplete:
configASSERT( xEthHandle.gState != HAL_ETH_STATE_ERROR );
xInitResult = pdPASS;

if( xSTM32_GetPhyLinkStatus( pxInterface ) == pdPASS )
{
xInitResult = pdPASS;
}
}

return xInitResult;
Expand Down Expand Up @@ -696,16 +700,6 @@ static void prvEMACHandlerTask( void * pvParameters )
if( xPhyCheckLinkStatus( &xPhyObject, xResult ) != pdFALSE )
{
prvEthernetUpdateConfig();

/*
#if ( ipconfigSUPPORT_NETWORK_DOWN_EVENT != 0 )
{
if( xGetPhyLinkStatus() == pdFALSE )
{
FreeRTOS_NetworkDown();
}
}
*/
}
}
}
Expand Down Expand Up @@ -792,6 +786,10 @@ static void prvEthernetUpdateConfig( void )
/* iptraceNETWORK_INTERFACE_STATUS_CHANGE(); */
xHalResult = HAL_ETH_Stop_IT( &xEthHandle );
configASSERT( xHalResult == HAL_OK );

#if ( ipconfigSUPPORT_NETWORK_DOWN_EVENT != 0 )
FreeRTOS_NetworkDown( pxMyInterface );
#endif
}
}

Expand Down

0 comments on commit 9d9dbeb

Please sign in to comment.