We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 656fce2 + 47c4133 commit 71df3baCopy full SHA for 71df3ba
multi_button.c
@@ -178,7 +178,10 @@ void button_handler(struct button* handle)
178
if(handle->button_level == handle->active_level)
179
{
180
handle->event = (uint8_t)LONG_PRESS_HOLD;
181
- EVENT_CB(LONG_PRESS_HOLD);
+ if (handle->ticks % LONG_HOLD_CYC == 0)
182
+ {
183
+ EVENT_CB(LONG_PRESS_HOLD);
184
+ }
185
}
186
else
187
multi_button.h
@@ -9,6 +9,7 @@
9
#define DEBOUNCE_TICKS 3 //MAX 8
10
#define SHORT_TICKS (300 / TICKS_INTERVAL)
11
#define LONG_TICKS (1000 / TICKS_INTERVAL)
12
+#define LONG_HOLD_CYC (500 / TICKS_INTERVAL)
13
14
typedef void (*BtnCallback)(void*);
15
0 commit comments