From 3a94137eb38857d9780a5ef65be30736804dea46 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 16 Sep 2011 17:38:22 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3320 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/mac_lld.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'os/hal/platforms/STM32/mac_lld.c') diff --git a/os/hal/platforms/STM32/mac_lld.c b/os/hal/platforms/STM32/mac_lld.c index 98f1839c0..99fba21ff 100644 --- a/os/hal/platforms/STM32/mac_lld.c +++ b/os/hal/platforms/STM32/mac_lld.c @@ -159,13 +159,10 @@ void mac_lld_init(void) { } /* MAC clocks activation.*/ - RCC->AHBENR |= RCC_AHBENR_ETHMACEN | - RCC_AHBENR_ETHMACTXEN | - RCC_AHBENR_ETHMACRXEN; + rccEnableETH(FALSE); /* Reset of the MAC core.*/ - RCC->AHBRSTR = RCC_AHBRSTR_ETHMACRST; - RCC->AHBRSTR = 0; + rccResetETH(); /* Find PHY address.*/ mii_find_phy(); @@ -184,9 +181,7 @@ void mac_lld_init(void) { mii_write_phy(MII_BMCR, BMCR_PDOWN); /* MAC clocks stopped again.*/ - RCC->AHBENR &= ~(RCC_AHBENR_ETHMACEN | - RCC_AHBENR_ETHMACTXEN | - RCC_AHBENR_ETHMACRXEN); + rccDisableETH(FALSE); } /** @@ -208,9 +203,7 @@ void mac_lld_start(MACDriver *macp) { txptr = (stm32_eth_tx_descriptor_t *)td; /* MAC clocks activation.*/ - RCC->AHBENR |= RCC_AHBENR_ETHMACEN | - RCC_AHBENR_ETHMACTXEN | - RCC_AHBENR_ETHMACRXEN; + rccEnableETH(FALSE); /* Descriptor chains pointers.*/ ETH->DMARDLAR = (uint32_t)rd; @@ -241,9 +234,7 @@ void mac_lld_start(MACDriver *macp) { void mac_lld_stop(MACDriver *macp) { /* MAC clocks stopped.*/ - RCC->AHBENR &= ~(RCC_AHBENR_ETHMACEN | - RCC_AHBENR_ETHMACTXEN | - RCC_AHBENR_ETHMACRXEN); + rccDisableETH(FALSE); } /** -- cgit v1.2.3