Add extra debounce delay in button presses. Trigger on button-up.
This commit is contained in:
@ -49,7 +49,7 @@ int buttons_init(const char *flag) {
|
|||||||
s_buttons[next_button].gpio=gpio;
|
s_buttons[next_button].gpio=gpio;
|
||||||
s_buttons[next_button].last_change=-1;
|
s_buttons[next_button].last_change=-1;
|
||||||
mgos_gpio_set_mode(gpio, MGOS_GPIO_MODE_INPUT);
|
mgos_gpio_set_mode(gpio, MGOS_GPIO_MODE_INPUT);
|
||||||
mgos_gpio_set_button_handler(gpio, MGOS_GPIO_PULL_UP, MGOS_GPIO_INT_EDGE_NEG, 100, buttons_cb, NULL);
|
mgos_gpio_set_button_handler(gpio, MGOS_GPIO_PULL_NONE, MGOS_GPIO_INT_EDGE_POS, 300, buttons_cb, NULL);
|
||||||
|
|
||||||
next_button++;
|
next_button++;
|
||||||
if (next_button>MAX_BUTTONS) {
|
if (next_button>MAX_BUTTONS) {
|
||||||
|
Reference in New Issue
Block a user