]>
git.scottworley.com Git - tattlekey/blob - client/tattlekey.c
45059f6ed2e832b8457c64f4696640d0a6c44e1a
1 #include "pico/cyw43_arch.h"
2 #include "pico/stdlib.h"
3 #include "pico/util/queue.h"
12 static void button_pressed() {
13 /* This runs in interrupt context; don't linger. */
15 /* We don't check for failure (full queue) here because there's not much to be
17 queue_try_add(&queue
, &zero
);
22 if (cyw43_arch_init_with_country(CYW43_COUNTRY_USA
))
23 signal_error_by_blinking();
25 cyw43_arch_enable_sta_mode();
27 if (cyw43_arch_wifi_connect_timeout_ms(wifi_ssid
, wifi_pass
,
28 CYW43_AUTH_WPA2_AES_PSK
, 90000))
29 signal_error_by_blinking();
32 queue_init(&queue
, 1, 99);
34 begin_listening_for_button_press(button_pressed
);
39 queue_remove_blocking(&queue
, &_
);
40 send_report(seq
++, 0);