#include "config.h"
#include "net.h"
+typedef struct {
+ uint32_t timestamp;
+ u16_t seq;
+ u8_t send_count;
+} send_t;
+
enum event_type { BUTTONPRESS, SEND };
typedef struct {
enum event_type type;
struct {
uint32_t timestamp;
} buttonpress;
- struct {
- uint32_t timestamp;
- u16_t seq;
- u8_t send_count;
- } send;
+ send_t send;
};
} event_t;
}
}
-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;
}
}
}
+
+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();
+}