Merge pull request #3336 from geniusgogo/fixed_drv_eth

[stm32/libraries/HAL_Drivers/drv_eth.c]fixed read phy SR register return value
This commit is contained in:
Bernard Xiong 2020-01-26 18:21:19 +08:00 committed by GitHub
commit 5ca53690f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -411,11 +411,11 @@ static void phy_linkchange()
if (status & (PHY_AUTONEGO_COMPLETE_MASK | PHY_LINKED_STATUS_MASK)) if (status & (PHY_AUTONEGO_COMPLETE_MASK | PHY_LINKED_STATUS_MASK))
{ {
rt_uint32_t SR; rt_uint32_t SR = 0;
phy_speed_new |= PHY_LINK; phy_speed_new |= PHY_LINK;
SR = HAL_ETH_ReadPHYRegister(&EthHandle, PHY_Status_REG, (uint32_t *)&SR); HAL_ETH_ReadPHYRegister(&EthHandle, PHY_Status_REG, (uint32_t *)&SR);
LOG_D("phy control status reg is 0x%X", SR); LOG_D("phy control status reg is 0x%X", SR);
if (PHY_Status_SPEED_100M(SR)) if (PHY_Status_SPEED_100M(SR))