Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/button/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog

## v4.1.7 - 2026-05-04

### Feature:

* Added `hys_ctrl_mode` field to `button_gpio_config_t` for chips that support GPIO input hysteresis (`SOC_GPIO_SUPPORT_PIN_HYS_FILTER`, e.g. ESP32-P4). Set `hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE` to suppress spurious PRESS_DOWN/PRESS_UP events caused by a signal glitching around the switching threshold. Fixes [#663](https://github.com/espressif/esp-iot-solution/issues/663).

## v4.1.6 - 2026-02-09

### Fix:
Expand Down
3 changes: 3 additions & 0 deletions components/button/button_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ esp_err_t iot_button_new_gpio_device(const button_config_t *button_config, const
gpio_conf.pull_up_en = GPIO_PULLUP_ENABLE;
}
}
#if SOC_GPIO_SUPPORT_PIN_HYS_FILTER
gpio_conf.hys_ctrl_mode = gpio_cfg->hys_ctrl_mode;
#endif
ret = gpio_config(&gpio_conf);
ESP_GOTO_ON_FALSE(ret == ESP_OK, ret, err, TAG, "GPIO config failed");

Expand Down
2 changes: 1 addition & 1 deletion components/button/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "4.1.6"
version: "4.1.7"
description: GPIO and ADC and Matrix button driver
url: https://github.com/espressif/esp-iot-solution/tree/master/components/button
repository: https://github.com/espressif/esp-iot-solution.git
Expand Down
4 changes: 4 additions & 0 deletions components/button/include/button_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include "esp_err.h"
#include "driver/gpio.h"
#include "button_types.h"

#ifdef __cplusplus
Expand All @@ -21,6 +22,9 @@ typedef struct {
uint8_t active_level; /**< gpio level when press down */
bool enable_power_save; /**< enable power save mode */
bool disable_pull; /**< disable internal pull up or down */
#if SOC_GPIO_SUPPORT_PIN_HYS_FILTER
gpio_hys_ctrl_mode_t hys_ctrl_mode; /**< GPIO input hysteresis; prevents spurious PRESS_DOWN/PRESS_UP events when the signal glitches around the switching threshold (e.g. ESP32-P4) */
#endif
} button_gpio_config_t;

/**
Expand Down