Skip to content

Commit 66115a3

Browse files
iabdalkaderdpgeorge
authored andcommitted
stm32/eth: Fix eth_link_status function to use correct BSR bit.
Fixes #7346.
1 parent 51614ce commit 66115a3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ports/stm32/eth.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -791,11 +791,10 @@ int eth_link_status(eth_t *self) {
791791
return 2; // link no-ip;
792792
}
793793
} else {
794-
int s = eth_phy_read(0) | eth_phy_read(0x10) << 16;
795-
if (s == 0) {
796-
return 0; // link down
794+
if (eth_phy_read(PHY_BSR) & PHY_BSR_LINK_STATUS) {
795+
return 1; // link up
797796
} else {
798-
return 1; // link join
797+
return 0; // link down
799798
}
800799
}
801800
}

0 commit comments

Comments
 (0)