diff options
Diffstat (limited to 'os/hal/platforms/STM32/mac_lld.c')
-rw-r--r-- | os/hal/platforms/STM32/mac_lld.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32/mac_lld.c b/os/hal/platforms/STM32/mac_lld.c index 2a91009c5..eb87d579d 100644 --- a/os/hal/platforms/STM32/mac_lld.c +++ b/os/hal/platforms/STM32/mac_lld.c @@ -306,8 +306,10 @@ void mac_lld_start(MACDriver *macp) { /* ISR vector enabled.*/
nvicEnableVector(ETH_IRQn, CORTEX_PRIORITY_MASK(STM32_ETH1_IRQ_PRIORITY));
+#if STM32_ETH1_CHANGE_PHY_STATE
/* PHY in power up mode.*/
mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) & ~BMCR_PDOWN);
+#endif
/* MAC configuration.*/
ETH->MACFFR = 0;
@@ -361,8 +363,10 @@ void mac_lld_start(MACDriver *macp) { void mac_lld_stop(MACDriver *macp) {
if (macp->state != MAC_STOP) {
+#if STM32_ETH1_CHANGE_PHY_STATE
/* PHY in power down mode until the driver will be restarted.*/
mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) | BMCR_PDOWN);
+#endif
/* MAC and DMA stopped.*/
ETH->MACCR = 0;
|