mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(esp_eth): correct PHYCFGR sanity check mask and bit validation
Closes https://github.com/espressif/esp-idf/issues/17530
This commit is contained in:
committed by
Euripedes Rocha
parent
2b5623970b
commit
3a739eba9b
@@ -613,7 +613,7 @@ static inline bool is_w5500_sane_for_rxtx(emac_w5500_t *emac)
|
||||
{
|
||||
uint8_t phycfg;
|
||||
/* phy is ok for rx and tx operations if bits RST and LNK are set (no link down, no reset) */
|
||||
if (w5500_read(emac, W5500_REG_PHYCFGR, &phycfg, 1) == ESP_OK && (phycfg & 0x8001)) {
|
||||
if (w5500_read(emac, W5500_REG_PHYCFGR, &phycfg, 1) == ESP_OK && (phycfg & 0x81) == 0x81) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user