Add extra debounce delay in button presses. Trigger on button-up.

This commit is contained in:
Pim van Pelt
2018-01-02 00:19:37 +01:00
parent a342ff6815
commit 0ea78abf4c

View File

@ -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) {