Skip to content

Commit 1ec4dcb

Browse files
committed
Use gd32::Millis() in EMAC PHY config
Switch EMAC PHY timing code from the legacy `gd32_millis.h`/`millis()` API to `gd32_timers.h` and `gd32::Millis()`. This keeps the 500 ms BMCR polling timeout behavior unchanged while aligning with the current GD32 timer interface.
1 parent 21d48b7 commit 1ec4dcb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib-network/src/emac/gd32/emac_phy.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "emac/emac_phy.h"
2929
#include "emac/mmi.h"
30-
#include "gd32_millis.h"
30+
#include "gd32_timers.h"
3131
#include "emac/emac_debug.h"
3232
#include "gd32.h" // IWYU pragma: keep
3333

@@ -148,10 +148,10 @@ bool Config(uint16_t address) {
148148
* IEEE spec.
149149
*/
150150

151-
const auto kMillis = millis();
151+
const auto kMillis = gd32::Millis();
152152
uint16_t value;
153153

154-
while (millis() - kMillis < 500U) {
154+
while (gd32::Millis() - kMillis < 500U) {
155155
if (!phy::Read(address, emac::mmi::REG_BMCR, value)) {
156156
DEBUG_PUTS("PHY status read failed");
157157
EMAC_PHY_DEBUG_EXIT();

0 commit comments

Comments
 (0)