stm32/eth: Fix eth_link_status function to use correct BSR bit.
Fixes #7346.
This commit is contained in:
parent
51614ce365
commit
66115a3744
1 changed files with 3 additions and 4 deletions
|
|
@ -791,11 +791,10 @@ int eth_link_status(eth_t *self) {
|
|||
return 2; // link no-ip;
|
||||
}
|
||||
} else {
|
||||
int s = eth_phy_read(0) | eth_phy_read(0x10) << 16;
|
||||
if (s == 0) {
|
||||
return 0; // link down
|
||||
if (eth_phy_read(PHY_BSR) & PHY_BSR_LINK_STATUS) {
|
||||
return 1; // link up
|
||||
} else {
|
||||
return 1; // link join
|
||||
return 0; // link down
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue