Fix late argument verification in emac-main

Prevent crash when emac_phy_power_enable is not set.

Merges #426 https://github.com/espressif/esp-idf/pull/426
This commit is contained in:
alarruskain 2017-03-13 13:31:01 +01:00 committed by Angus Gratton
parent 5272bd899b
commit eba6789e6c

View File

@ -948,14 +948,14 @@ esp_err_t esp_eth_init(eth_config_t *config)
emac_set_user_config_data(config);
}
emac_config.emac_phy_power_enable(true);
ret = emac_verify_args();
if (ret != ESP_OK) {
goto _exit;
}
emac_config.emac_phy_power_enable(true);
//before set emac reg must enable clk
emac_enable_clk(true);
REG_SET_FIELD(EMAC_EX_PHYINF_CONF_REG, EMAC_EX_PHY_INTF_SEL, EMAC_EX_PHY_INTF_RMII);