altos: re-enable optimization for stm-demo. remove unused bits
[fw/altos] / src / stm-demo / ao_demo.c
index 9a581ff91a9ce4dc0ec19fa14f6ef1e01948899d..b82cb73512711942778b36b4121c919ca033e676 100644 (file)
  */
 
 #include "ao.h"
+#include <ao_exti.h>
+#include <ao_event.h>
+#include <ao_quadrature.h>
+#include <ao_button.h>
 
 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);