summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxieyangrun <[email protected]>2020-01-15 11:38:35 +0800
committerxieyangrun <[email protected]>2020-01-15 11:38:35 +0800
commit0094765b311f3a13e3cc174ecc9313ef2fdb13ec (patch)
tree1337d99723f91edab14387f36c8c3a07ab6df3a7
parentcad32a326ce5774044837197fe566f0d5bd69ca9 (diff)
[stm32/libraries/HAL_Drivers/drv_eth.c]fixed read phy SR register return value conflicts with function's parameter
-rw-r--r--bsp/stm32/libraries/HAL_Drivers/drv_eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_eth.c b/bsp/stm32/libraries/HAL_Drivers/drv_eth.c
index 097a1622e5..4ead17dc23 100644
--- a/bsp/stm32/libraries/HAL_Drivers/drv_eth.c
+++ b/bsp/stm32/libraries/HAL_Drivers/drv_eth.c
@@ -411,11 +411,11 @@ static void phy_linkchange()
if (status & (PHY_AUTONEGO_COMPLETE_MASK | PHY_LINKED_STATUS_MASK))
{
- rt_uint32_t SR;
+ rt_uint32_t SR = 0;
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);
if (PHY_Status_SPEED_100M(SR))