From: Nathael Pajani Date: Mon, 7 Feb 2022 10:39:32 +0000 (+0100) Subject: Fix button events so interface is no more sensible to small electro-static discharges X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=46931d73aab54371346cb4d0ae9c48b931a3b140;p=soft%2Flpc122x%2Fscialys Fix button events so interface is no more sensible to small electro-static discharges --- 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);