X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fcortexelf-v1%2Fao_cortexelf.c;h=8be7ef151457acd362733157709f0684dd7ff159;hp=f9be59e835a11e7e78be52493f95f2cefac4b8c6;hb=1bc48b075f76bfef258f516549573429b24f284c;hpb=8284d3639cd24e2fa0faf1e35e7276ba35a24f8f diff --git a/src/cortexelf-v1/ao_cortexelf.c b/src/cortexelf-v1/ao_cortexelf.c index f9be59e8..8be7ef15 100644 --- a/src/cortexelf-v1/ao_cortexelf.c +++ b/src/cortexelf-v1/ao_cortexelf.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include struct ao_task ball_task; @@ -208,6 +210,21 @@ __code struct ao_cmds ao_demo_cmds[] = { { 0, NULL } }; +static struct ao_task event_task; + +static void +ao_event_loop(void) +{ + for (;;) { + struct ao_event ev; + + ao_event_get(&ev); + printf("type %d uint %d tick %d value %d\n", + ev.type, ev.unit, ev.tick, ev.value); + flush(); + } +} + int main(void) { @@ -236,9 +253,12 @@ main(void) ao_usb_init(); + ao_button_init(); + ao_config_init(); ao_add_task(&ball_task, ao_ball, "ball"); + ao_add_task(&event_task, ao_event_loop, "events"); ao_cmd_register(&ao_demo_cmds[0]); ao_start_scheduler();