mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
driver(gpio): Modified the GPIO_CHECK's return value when ISR service already installed
This commit is contained in:
@@ -403,7 +403,7 @@ esp_err_t gpio_isr_handler_remove(gpio_num_t gpio_num)
|
|||||||
|
|
||||||
esp_err_t gpio_install_isr_service(int intr_alloc_flags)
|
esp_err_t gpio_install_isr_service(int intr_alloc_flags)
|
||||||
{
|
{
|
||||||
GPIO_CHECK(gpio_isr_func == NULL, "GPIO isr service already installed", ESP_FAIL);
|
GPIO_CHECK(gpio_isr_func == NULL, "GPIO isr service already installed", ESP_ERR_INVALID_STATE);
|
||||||
esp_err_t ret;
|
esp_err_t ret;
|
||||||
portENTER_CRITICAL(&gpio_spinlock);
|
portENTER_CRITICAL(&gpio_spinlock);
|
||||||
gpio_isr_func = (gpio_isr_func_t*) calloc(GPIO_NUM_MAX, sizeof(gpio_isr_func_t));
|
gpio_isr_func = (gpio_isr_func_t*) calloc(GPIO_NUM_MAX, sizeof(gpio_isr_func_t));
|
||||||
|
@@ -389,6 +389,7 @@ esp_err_t gpio_wakeup_disable(gpio_num_t gpio_num);
|
|||||||
* @return
|
* @return
|
||||||
* - ESP_OK Success ;
|
* - ESP_OK Success ;
|
||||||
* - ESP_ERR_INVALID_ARG GPIO error
|
* - ESP_ERR_INVALID_ARG GPIO error
|
||||||
|
* - ESP_ERR_NOT_FOUND No free interrupt found with the specified flags
|
||||||
*/
|
*/
|
||||||
esp_err_t gpio_isr_register(void (*fn)(void*), void * arg, int intr_alloc_flags, gpio_isr_handle_t *handle);
|
esp_err_t gpio_isr_register(void (*fn)(void*), void * arg, int intr_alloc_flags, gpio_isr_handle_t *handle);
|
||||||
|
|
||||||
@@ -446,8 +447,10 @@ esp_err_t gpio_pulldown_dis(gpio_num_t gpio_num);
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* - ESP_OK Success
|
* - ESP_OK Success
|
||||||
* - ESP_FAIL Operation fail
|
|
||||||
* - ESP_ERR_NO_MEM No memory to install this service
|
* - ESP_ERR_NO_MEM No memory to install this service
|
||||||
|
* - ESP_ERR_INVALID_STATE ISR service already installed.
|
||||||
|
* - ESP_ERR_NOT_FOUND No free interrupt found with the specified flags
|
||||||
|
* - ESP_ERR_INVALID_ARG GPIO error
|
||||||
*/
|
*/
|
||||||
esp_err_t gpio_install_isr_service(int intr_alloc_flags);
|
esp_err_t gpio_install_isr_service(int intr_alloc_flags);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user