Skip to content

Commit 497ee2d

Browse files
committed
fix(eppp): Fix SPI transport to allow already init GPIO ISR
Closes #868
1 parent b2568a3 commit 497ee2d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

components/eppp_link/eppp_spi.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ static esp_err_t init_master(struct eppp_config_spi_s *config, struct eppp_spi *
208208
};
209209

210210
ESP_GOTO_ON_ERROR(gpio_config(&io_conf), err_dev, TAG, "Failed to config interrupt GPIO");
211-
ESP_GOTO_ON_ERROR(gpio_install_isr_service(0), err_dev, TAG, "Failed to install GPIO ISR");
211+
ret = gpio_install_isr_service(0);
212+
ESP_GOTO_ON_FALSE(ret == ESP_OK || ret == ESP_ERR_INVALID_STATE /* In case the GPIO ISR already installed */,
213+
ret, err_dev, TAG, "Failed to install GPIO ISR");
212214
ESP_GOTO_ON_ERROR(gpio_set_intr_type(config->intr, GPIO_INTR_ANYEDGE), err_dev, TAG, "Failed to set ISR type");
213215
ESP_GOTO_ON_ERROR(gpio_isr_handler_add(config->intr, gpio_isr_handler, h), err_dev, TAG, "Failed to add ISR handler");
214216
return ESP_OK;
@@ -468,9 +470,6 @@ eppp_transport_handle_t eppp_spi_init(struct eppp_config_spi_s *config)
468470
if (h->ready_semaphore) {
469471
vSemaphoreDelete(h->ready_semaphore);
470472
}
471-
if (h->out_queue) {
472-
vQueueDelete(h->out_queue);
473-
}
474473
free(h);
475474
return NULL;
476475
}

0 commit comments

Comments
 (0)