From 122a16ad4ec3c14212f52d15a60a39bc95690c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Mon, 27 Apr 2020 20:18:45 +0200 Subject: [PATCH] Use button module in main loop --- stm-firmware/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stm-firmware/main.c b/stm-firmware/main.c index b8981ba..b5db715 100644 --- a/stm-firmware/main.c +++ b/stm-firmware/main.c @@ -42,6 +42,7 @@ #include #include #include +#include #include static void setup_nvic_priorities() @@ -130,6 +131,7 @@ static bool mount_sd_card_if_avail(bool mounted) } const char *oven_controller_hello_world = "Hello world :)\n"; +static volatile enum button_state button; int main() { @@ -152,6 +154,7 @@ int main() led_setup(); loudspeaker_setup(); rotary_encoder_setup(); + button_init(); uart_gpio_config(); setup_sell_uart(&shell_uart); @@ -183,6 +186,7 @@ int main() } } + button = button_read_event(); rot = rotary_encoder_get_abs_val(); uart_receive_status = uart_receive_data_with_dma(&shell_uart, &uart_input, &uart_input_len); if (uart_receive_status >= 1)