From d2c3ce766f593f79f178b58e0719727fb5385d71 Mon Sep 17 00:00:00 2001 From: Wu Jian Gang Date: Mon, 17 Jun 2024 16:17:55 +0800 Subject: [PATCH] fix: ADC button tied to GND ignored (GitHub PR) --- components/button/CHANGELOG.md | 5 +++++ components/button/button_adc.c | 2 +- components/button/idf_component.yml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/button/CHANGELOG.md b/components/button/CHANGELOG.md index 3c37f3590..f436b08d6 100644 --- a/components/button/CHANGELOG.md +++ b/components/button/CHANGELOG.md @@ -1,5 +1,10 @@ # ChangeLog +## v3.2.1 - 2024-6-17 + +### bugfix + +- Fixed ignored ADC button tied to GND. ## v3.2.0 - 2023-11-13 diff --git a/components/button/button_adc.c b/components/button/button_adc.c index 0e532ecfe..96e527a21 100644 --- a/components/button/button_adc.c +++ b/components/button/button_adc.c @@ -305,7 +305,7 @@ uint8_t button_adc_get_key_level(void *button_index) } if (vol <= g_button.ch[ch_index].btns[index].max && - vol > g_button.ch[ch_index].btns[index].min) { + vol >= g_button.ch[ch_index].btns[index].min) { return 1; } return 0; diff --git a/components/button/idf_component.yml b/components/button/idf_component.yml index c1e294289..43ba68ba3 100644 --- a/components/button/idf_component.yml +++ b/components/button/idf_component.yml @@ -1,4 +1,4 @@ -version: "3.2.0" +version: "3.2.1" description: GPIO and ADC button driver url: https://github.com/espressif/esp-iot-solution/tree/master/components/button repository: https://github.com/espressif/esp-iot-solution.git