From 497ee2d6d4baf23feba08ff9aa49a2c700cf7a1b Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 25 Aug 2025 15:23:07 +0200 Subject: [PATCH] fix(eppp): Fix SPI transport to allow already init GPIO ISR Closes https://github.com/espressif/esp-protocols/issues/868 --- components/eppp_link/eppp_spi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/eppp_link/eppp_spi.c b/components/eppp_link/eppp_spi.c index 233a8ee01..0c496b691 100644 --- a/components/eppp_link/eppp_spi.c +++ b/components/eppp_link/eppp_spi.c @@ -208,7 +208,9 @@ static esp_err_t init_master(struct eppp_config_spi_s *config, struct eppp_spi * }; ESP_GOTO_ON_ERROR(gpio_config(&io_conf), err_dev, TAG, "Failed to config interrupt GPIO"); - ESP_GOTO_ON_ERROR(gpio_install_isr_service(0), err_dev, TAG, "Failed to install GPIO ISR"); + ret = gpio_install_isr_service(0); + ESP_GOTO_ON_FALSE(ret == ESP_OK || ret == ESP_ERR_INVALID_STATE /* In case the GPIO ISR already installed */, + ret, err_dev, TAG, "Failed to install GPIO ISR"); ESP_GOTO_ON_ERROR(gpio_set_intr_type(config->intr, GPIO_INTR_ANYEDGE), err_dev, TAG, "Failed to set ISR type"); ESP_GOTO_ON_ERROR(gpio_isr_handler_add(config->intr, gpio_isr_handler, h), err_dev, TAG, "Failed to add ISR handler"); return ESP_OK; @@ -468,9 +470,6 @@ err: if (h->ready_semaphore) { vSemaphoreDelete(h->ready_semaphore); } - if (h->out_queue) { - vQueueDelete(h->out_queue); - } free(h); return NULL; }