X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fstm-demo%2Fao_demo.c;h=b82cb73512711942778b36b4121c919ca033e676;hp=9a581ff91a9ce4dc0ec19fa14f6ef1e01948899d;hb=97efce5f7ff227aaa8990529217d3d10db3443dc;hpb=08a4ed8fe794a2b2b52147bd5535fe0954822e95 diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c index 9a581ff9..b82cb735 100644 --- a/src/stm-demo/ao_demo.c +++ b/src/stm-demo/ao_demo.c @@ -16,6 +16,10 @@ */ #include "ao.h" +#include +#include +#include +#include struct ao_task demo_task; @@ -148,12 +152,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 } }; @@ -166,10 +187,13 @@ main(void) 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);