diff --git a/components/esp_driver_gpio/include/driver/gpio.h b/components/esp_driver_gpio/include/driver/gpio.h index 7e375e2cb15..734dedf4300 100644 --- a/components/esp_driver_gpio/include/driver/gpio.h +++ b/components/esp_driver_gpio/include/driver/gpio.h @@ -344,8 +344,11 @@ esp_err_t gpio_install_isr_service(int intr_alloc_flags); /** * @brief Uninstall the driver's GPIO ISR service, freeing related resources. + * + * @return + * - ESP_OK Success */ -void gpio_uninstall_isr_service(void); +esp_err_t gpio_uninstall_isr_service(void); /** * @brief Add ISR handler for the corresponding GPIO pin. diff --git a/components/esp_driver_gpio/src/gpio.c b/components/esp_driver_gpio/src/gpio.c index 9c494a2631f..c3eec986d66 100644 --- a/components/esp_driver_gpio/src/gpio.c +++ b/components/esp_driver_gpio/src/gpio.c @@ -579,14 +579,14 @@ esp_err_t gpio_isr_handler_remove(gpio_num_t gpio_num) return ESP_OK; } -void gpio_uninstall_isr_service(void) +esp_err_t gpio_uninstall_isr_service(void) { gpio_isr_func_t *gpio_isr_func_free = NULL; gpio_isr_handle_t gpio_isr_handle_free = NULL; portENTER_CRITICAL(&gpio_context.gpio_spinlock); if (gpio_context.gpio_isr_func == NULL) { portEXIT_CRITICAL(&gpio_context.gpio_spinlock); - return; + return ESP_OK; } gpio_isr_func_free = gpio_context.gpio_isr_func; gpio_context.gpio_isr_func = NULL; @@ -596,7 +596,7 @@ void gpio_uninstall_isr_service(void) portEXIT_CRITICAL(&gpio_context.gpio_spinlock); esp_intr_free(gpio_isr_handle_free); free(gpio_isr_func_free); - return; + return ESP_OK; } static void gpio_isr_register_on_core_static(void *param) diff --git a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst index 2609cdea9a7..6bad5011654 100644 --- a/docs/en/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/en/migration-guides/release-6.x/6.0/peripherals.rst @@ -117,6 +117,8 @@ GPIO - ``MAX_PAD_GPIO_NUM``, ``MAX_GPIO_NUM``, and ``DIG_IO_HOLD_BIT_SHIFT`` macros have been removed. +- Added the :cpp:type:`esp_err_t` return type to :func:`gpio_uninstall_isr_service`. + LEDC ---- diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst index 5985f3e300f..0e7c934c91a 100644 --- a/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/peripherals.rst @@ -117,6 +117,8 @@ GPIO - ``MAX_PAD_GPIO_NUM``、 ``MAX_GPIO_NUM`` 和 ``DIG_IO_HOLD_BIT_SHIFT`` 宏已被移除。 +- 为 :func:`gpio_uninstall_isr_service` 添加了 :cpp:type:`esp_err_t` 返回类型。 + LEDC ----