summaryrefslogtreecommitdiff
path: root/src/stm-demo/ao_demo.c
diff options
context:
space:
mode:
authorMike Beattie <mike@ethernal.org>2012-08-08 06:46:56 +1200
committerMike Beattie <mike@ethernal.org>2012-08-08 06:46:56 +1200
commitbd02349111ae0f39b320e6a10a330051ddc39fdf (patch)
treeab7a29204eea195db77aa302fbe3e2012ef5049e /src/stm-demo/ao_demo.c
parent8e4ebd1f6eb928b5cb7bcda4ed88851aa9e61bdf (diff)
parentc7f228503870c44dfd278ede8b0980dbac73d3c7 (diff)
Merge branch 'master' of git://git.gag.com/fw/altos
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);