kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/eth_dm9051_not_responding' into 'master'
esp_eth: Fix dm9051 Rx interrupt processing Closes IDFGH-4598 See merge request espressif/esp-idf!15073pull/7554/head
commit
39b7d3e13f
|
@ -347,8 +347,8 @@ static esp_err_t emac_dm9051_start(esp_eth_mac_t *mac)
|
||||||
{
|
{
|
||||||
esp_err_t ret = ESP_OK;
|
esp_err_t ret = ESP_OK;
|
||||||
emac_dm9051_t *emac = __containerof(mac, emac_dm9051_t, parent);
|
emac_dm9051_t *emac = __containerof(mac, emac_dm9051_t, parent);
|
||||||
/* enable interrupt */
|
/* enable only Rx related interrupts as others are processed synchronously */
|
||||||
ESP_GOTO_ON_ERROR(dm9051_register_write(emac, DM9051_IMR, IMR_ALL), err, TAG, "write IMR failed");
|
ESP_GOTO_ON_ERROR(dm9051_register_write(emac, DM9051_IMR, IMR_PAR | IMR_PRI), err, TAG, "write IMR failed");
|
||||||
/* enable rx */
|
/* enable rx */
|
||||||
uint8_t rcr = 0;
|
uint8_t rcr = 0;
|
||||||
ESP_GOTO_ON_ERROR(dm9051_register_read(emac, DM9051_RCR, &rcr), err, TAG, "read RCR failed");
|
ESP_GOTO_ON_ERROR(dm9051_register_read(emac, DM9051_RCR, &rcr), err, TAG, "read RCR failed");
|
||||||
|
@ -396,8 +396,11 @@ static void emac_dm9051_task(void *arg)
|
||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
uint32_t length = 0;
|
uint32_t length = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
// block indefinitely until some task notifies me
|
// check if the task receives any notification
|
||||||
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
|
if (ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(1000)) == 0 && // if no notification ...
|
||||||
|
gpio_get_level(emac->int_gpio_num) == 0) { // ...and no interrupt asserted
|
||||||
|
continue; // -> just continue to check again
|
||||||
|
}
|
||||||
/* clear interrupt status */
|
/* clear interrupt status */
|
||||||
dm9051_register_read(emac, DM9051_ISR, &status);
|
dm9051_register_read(emac, DM9051_ISR, &status);
|
||||||
dm9051_register_write(emac, DM9051_ISR, status);
|
dm9051_register_write(emac, DM9051_ISR, status);
|
||||||
|
|
Ładowanie…
Reference in New Issue