From 6017ad9474c5ea2f77fbca5f3c19b6cef058b2e9 Mon Sep 17 00:00:00 2001 From: DmitryBlinov Date: Sun, 8 Mar 2020 01:31:16 +0200 Subject: [PATCH] Fix for long click (#2172) With uint8_t length function _buttonMapReleased never returned BUTTON_EVENT_LNGCLICK. BUTTON_EVENT_CLICK returned instesd. I verified that with uint16_t length it returns BUTTON_EVENT_LNGCLICK when correspondent delay passed. --- code/espurna/button_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/button_config.h b/code/espurna/button_config.h index 9228a923..9bb1022b 100644 --- a/code/espurna/button_config.h +++ b/code/espurna/button_config.h @@ -134,7 +134,7 @@ constexpr const unsigned char _buttonDecodeEventAction(unsigned long actions, un ); } -constexpr const uint8_t _buttonMapReleased(uint8_t count, uint8_t length) { +constexpr const uint8_t _buttonMapReleased(uint8_t count, uint16_t length) { return ( (1 == count) ? ( (length > BUTTON_LNGLNGCLICK_DELAY) ? BUTTON_EVENT_LNGLNGCLICK :