From: Scott Worley Date: Mon, 9 Oct 2023 19:51:43 +0000 (-0700) Subject: client: Move queue servicing to service_queue() X-Git-Tag: v0.1.0~47 X-Git-Url: http://git.scottworley.com/tattlekey/commitdiff_plain/ff999046a743cadb712418918b50bc5bb1074448?ds=inline client: Move queue servicing to service_queue() --- diff --git a/client/tattlekey.c b/client/tattlekey.c index cd13241..a11e6c1 100644 --- a/client/tattlekey.c +++ b/client/tattlekey.c @@ -51,21 +51,7 @@ static void button_pressed() { } } -int main() { - stdio_init_all(); - if (cyw43_arch_init_with_country(CYW43_COUNTRY_USA)) - signal_error_by_blinking(); - cyw43_arch_enable_sta_mode(); - signal(3, 100); - if (cyw43_arch_wifi_connect_timeout_ms(config_wifi_ssid, config_wifi_pass, - CYW43_AUTH_WPA2_AES_PSK, 90000)) - signal_error_by_blinking(); - signal(2, 300); - - queue_init(&queue, sizeof(event_t), 99); - - begin_listening_for_button_press(button_pressed); - +void service_queue() { u16_t seq = 0; while (1) { event_t e; @@ -95,3 +81,21 @@ int main() { } } } + +int main() { + stdio_init_all(); + if (cyw43_arch_init_with_country(CYW43_COUNTRY_USA)) + signal_error_by_blinking(); + cyw43_arch_enable_sta_mode(); + signal(3, 100); + if (cyw43_arch_wifi_connect_timeout_ms(config_wifi_ssid, config_wifi_pass, + CYW43_AUTH_WPA2_AES_PSK, 90000)) + signal_error_by_blinking(); + signal(2, 300); + + queue_init(&queue, sizeof(event_t), 99); + + begin_listening_for_button_press(button_pressed); + + service_queue(); +}