From 46931d73aab54371346cb4d0ae9c48b931a3b140 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Mon, 7 Feb 2022 11:39:32 +0100 Subject: [PATCH] Fix button events so interface is no more sensible to small electro-static discharges --- v10/interface.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/v10/interface.c b/v10/interface.c index 2629901..0814636 100644 --- a/v10/interface.c +++ b/v10/interface.c @@ -58,7 +58,7 @@ const struct pio button_ok = LPC_GPIO_0_12; /* Led control data pin */ const struct pio ws2812_data_out_pin = LPC_GPIO_0_20; - /* Oled Reset */ +/* Oled Reset */ const struct pio oled_reset = LPC_GPIO_0_21; @@ -165,12 +165,12 @@ struct ws2812_conf ws2812_leds = { int interface_config(uint32_t uart) { /* Buttons inputs on front panel */ - /* Activate on Rising edge (button release) */ - set_gpio_callback(button_callback, &button_up, EDGE_RISING); - set_gpio_callback(button_callback, &button_left, EDGE_RISING); - set_gpio_callback(button_callback, &button_right, EDGE_RISING); - set_gpio_callback(button_callback, &button_down, EDGE_RISING); - set_gpio_callback(button_callback, &button_ok, EDGE_RISING); + /* Activate on Falling edge (button press) */ + set_gpio_callback(button_callback, &button_up, EDGE_FALLING); + set_gpio_callback(button_callback, &button_left, EDGE_FALLING); + set_gpio_callback(button_callback, &button_right, EDGE_FALLING); + set_gpio_callback(button_callback, &button_down, EDGE_FALLING); + set_gpio_callback(button_callback, &button_ok, EDGE_FALLING); /* WS2812B Leds on display board */ ws2812_config(&ws2812_leds, &ws2812_data_out_pin); -- 2.43.0