X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fstm-demo%2Fao_demo.c;h=5677cdf46d3b5ed2261b94f5a10ce21aab21fdb0;hp=9a581ff91a9ce4dc0ec19fa14f6ef1e01948899d;hb=dfc268e0021e1cd3045f73339a749d292a6a6300;hpb=08a4ed8fe794a2b2b52147bd5535fe0954822e95 diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c index 9a581ff9..5677cdf4 100644 --- a/src/stm-demo/ao_demo.c +++ b/src/stm-demo/ao_demo.c @@ -16,6 +16,11 @@ */ #include "ao.h" +#include +#include +#include +#include +#include struct ao_task demo_task; @@ -148,12 +153,29 @@ ao_temp (void) printf ("temp: %d\n", temp); } +static void +ao_event(void) +{ + struct ao_event event; + + for (;;) { + flush(); + ao_event_get(&event); + printf ("type %1d unit %1d tick %5u value %ld\n", + event.type, event.unit, event.tick, event.value); + if (event.value == 100) + break; + } + +} + __code struct ao_cmds ao_demo_cmds[] = { { ao_dma_test, "D\0DMA test" }, { ao_spi_write, "W\0SPI write" }, { ao_spi_read, "R\0SPI read" }, { ao_i2c_write, "i\0I2C write" }, { ao_temp, "t\0Show temp" }, + { ao_event, "e\0Monitor event queue" }, { 0, NULL } }; @@ -162,14 +184,19 @@ main(void) { ao_clock_init(); + ao_task_init(); + ao_serial_init(); ao_timer_init(); ao_dma_init(); ao_cmd_init(); - ao_lcd_stm_init(); +// ao_lcd_stm_init(); // ao_lcd_font_init(); ao_spi_init(); ao_i2c_init(); + ao_exti_init(); +// ao_quadrature_init(); +// ao_button_init(); ao_timer_set_adc_interval(100);