mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
gpio: Fix interrupt lost issue
In previous gpio default isr, interrupt status bits get cleared at the exit of the isr. However, for edge-triggered interrupt type, the interrupt status bit should be cleared before entering the per-pin handlers to avoid any potential interrupt lost. Closes https://github.com/espressif/esp-idf/pull/6853
This commit is contained in:
@@ -95,20 +95,13 @@ typedef struct {
|
||||
#define gpio_hal_get_intr_status_high(hal, core_id, status) gpio_ll_get_intr_status_high((hal)->dev, core_id, status)
|
||||
|
||||
/**
|
||||
* @brief Clear GPIO interrupt status
|
||||
*
|
||||
* @param hal Context of the HAL layer
|
||||
* @param mask interrupt status clear mask
|
||||
*/
|
||||
#define gpio_hal_clear_intr_status(hal, mask) gpio_ll_clear_intr_status((hal)->dev, mask)
|
||||
|
||||
/**
|
||||
* @brief Clear GPIO interrupt status high
|
||||
*
|
||||
* @param hal Context of the HAL layer
|
||||
* @param mask interrupt status high clear mask
|
||||
*/
|
||||
#define gpio_hal_clear_intr_status_high(hal, mask) gpio_ll_clear_intr_status_high((hal)->dev, mask)
|
||||
* @brief Clear GPIO interrupt status bit
|
||||
*
|
||||
* @param hal Context of the HAL layer
|
||||
* @param gpio_num GPIO number. If you want to clear the interrupt status bit of e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16);
|
||||
*/
|
||||
#define gpio_hal_clear_intr_status_bit(hal, gpio_num) (((gpio_num) < 32) ? gpio_ll_clear_intr_status((hal)->dev, 1 << gpio_num) \
|
||||
: gpio_ll_clear_intr_status_high((hal)->dev, 1 << (gpio_num - 32)))
|
||||
|
||||
/**
|
||||
* @brief Enable GPIO module interrupt signal
|
||||
|
||||
@@ -386,17 +386,6 @@ typedef enum {
|
||||
GPIO_PULLDOWN_ENABLE = 0x1, /*!< Enable GPIO pull-down resistor */
|
||||
} gpio_pulldown_t;
|
||||
|
||||
/**
|
||||
* @brief Configuration parameters of GPIO pad for gpio_config function
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t pin_bit_mask; /*!< GPIO pin: set with bit mask, each bit maps to a GPIO */
|
||||
gpio_mode_t mode; /*!< GPIO mode: set input/output mode */
|
||||
gpio_pullup_t pull_up_en; /*!< GPIO pull-up */
|
||||
gpio_pulldown_t pull_down_en; /*!< GPIO pull-down */
|
||||
gpio_int_type_t intr_type; /*!< GPIO interrupt type */
|
||||
} gpio_config_t;
|
||||
|
||||
typedef enum {
|
||||
GPIO_PULLUP_ONLY, /*!< Pad pull up */
|
||||
GPIO_PULLDOWN_ONLY, /*!< Pad pull down */
|
||||
@@ -413,8 +402,6 @@ typedef enum {
|
||||
GPIO_DRIVE_CAP_MAX,
|
||||
} gpio_drive_cap_t;
|
||||
|
||||
typedef void (*gpio_isr_t)(void *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user