Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'bugfix/ethernet_init' into 'master'
Browse files Browse the repository at this point in the history
ethernet : fix sometimes ethernet init fail bug



See merge request !376
  • Loading branch information
wujiangang committed Jan 6, 2017
2 parents e387a16 + 6e11504 commit a4c3f87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions components/ethernet/emac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ static void emac_start(void *param)
cmd->err = EMAC_CMD_OK;
emac_enable_clk(true);

emac_reset();
emac_macaddr_init();

emac_check_mac_addr();
Expand Down Expand Up @@ -839,7 +840,9 @@ esp_err_t IRAM_ATTR emac_post(emac_sig_t sig, emac_par_t par)
}
}
} else {
portENTER_CRITICAL(&g_emac_mux);
emac_sig_cnt[sig]++;
portEXIT_CRITICAL(&g_emac_mux);
emac_event_t evt;
evt.sig = sig;
evt.par = par;
Expand Down Expand Up @@ -898,10 +901,8 @@ esp_err_t esp_eth_init(eth_config_t *config)
emac_xqueue = xQueueCreate(EMAC_EVT_QNUM, sizeof(emac_event_t));
xTaskCreate(emac_task, "emacT", 2048, NULL, EMAC_TASK_PRIORITY, &emac_task_hdl);

esp_intr_alloc(ETS_ETH_MAC_INTR_SOURCE, 0, emac_process_intr, NULL, NULL);

emac_reset();
emac_enable_clk(false);
esp_intr_alloc(ETS_ETH_MAC_INTR_SOURCE, 0, emac_process_intr, NULL, NULL);

emac_config.emac_status = EMAC_RUNTIME_INIT;

Expand Down
12 changes: 9 additions & 3 deletions docs/api/esp_eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ Macros
Type Definitions
^^^^^^^^^^^^^^^^

.. doxygentypedef:: eth_phy_fun
.. doxygentypedef:: eth_tcpip_input_fun
.. doxygentypedef:: eth_phy_check_link_func
.. doxygentypedef:: eth_phy_check_init_func
.. doxygentypedef:: eth_phy_get_speed_mode_func
.. doxygentypedef:: eth_phy_get_duplex_mode_func
.. doxygentypedef:: eth_phy_func
.. doxygentypedef:: eth_tcpip_input_func
.. doxygentypedef:: eth_gpio_config_func

Enumerations
^^^^^^^^^^^^

.. doxygenenum:: eth_mode_t
.. doxygenenum:: eth_speed_mode_t
.. doxygenenum:: eth_duplex_mode_t
.. doxygenenum:: eth_phy_base_t

Structures
Expand All @@ -48,4 +54,4 @@ Functions
.. doxygenfunction:: esp_eth_get_mac
.. doxygenfunction:: esp_eth_smi_write
.. doxygenfunction:: esp_eth_smi_read

.. doxygenfunction:: esp_eth_free_rx_buf

0 comments on commit a4c3f87

Please sign in to comment.