[fix] after phyid addition, the init function should init correct phy.

This commit is contained in:
Frantisek Burian 2014-12-18 21:26:59 +01:00
parent bb8980efc6
commit cf6d8d7235
2 changed files with 5 additions and 5 deletions

View File

@ -719,7 +719,7 @@ void eth_desc_init(uint8_t *buf, uint32_t nTx, uint32_t nRx, uint32_t cTx,
bool eth_tx(uint8_t *ppkt, uint32_t n);
bool eth_rx(uint8_t *ppkt, uint32_t *len, uint32_t maxlen);
void eth_init(enum eth_clk clock);
void eth_init(uint8_t phy,enum eth_clk clock);
void eth_start(void);
void eth_enable_checksum_offload(void);
@ -737,8 +737,8 @@ END_DECLS
* rcc_periph_reset_pulse(RCC_ETHMAC);
* [ init gpio pins ]
* rcc_periph_reset_pulse(RCC_ETHMAC);
* phy_init();
* eth_init();
* phy_init(0);
* eth_init(0, ETH_CLK_025_035MHZ);
* eth_set_mac(mac);
* eth_desc_init(buffer, &eth_buffer[0], ETH_TXBUFNB, ETH_RXBUFNB,
* ETH_TX_BUF_SIZE, ETH_RX_BUF_SIZE, false);

View File

@ -200,10 +200,10 @@ void eth_start(void)
*
* @param[in] clock enum eth_clk Core clock speed
*/
void eth_init(enum eth_clk clock)
void eth_init(uint8_t phy, enum eth_clk clock)
{
ETH_MACMIIAR = clock;
phy_reset();
phy_reset(phy);
ETH_MACCR = ETH_MACCR_CSTF | ETH_MACCR_FES | ETH_MACCR_DM |
ETH_MACCR_APCS | ETH_MACCR_RD;