summaryrefslogtreecommitdiff
path: root/src/stm-demo/ao_demo.c
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2012-08-28 23:39:53 -0600
committerBdale Garbee <bdale@gag.com>2012-08-28 23:39:53 -0600
commit5ed88fb72c3e3ecf3333c700d838667db71cfbdc (patch)
tree3b371f563c0f7607f2fe53242673adb352b48514 /src/stm-demo/ao_demo.c
parentadbe64c5a9402b7c5075a444a12629131b663877 (diff)
parent621d0930244f25165d2ac5da596dcc87e253b965 (diff)
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Conflicts: debian/control
Diffstat (limited to 'src/stm-demo/ao_demo.c')
-rw-r--r--src/stm-demo/ao_demo.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c
index 9a581ff9..fe7c69f2 100644
--- a/src/stm-demo/ao_demo.c
+++ b/src/stm-demo/ao_demo.c
@@ -16,6 +16,10 @@
*/
#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 }
};
@@ -170,6 +191,9 @@ main(void)
// 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);