diff options
author | Keith Packard <keithp@keithp.com> | 2013-03-11 13:21:04 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-05-07 20:16:36 -0700 |
commit | b1a43ce313c85cb7f8f16f7f0647d9d4320ba692 (patch) | |
tree | 932b1768bc85c5ef5865d6acd61eac22a8584dcc /src/stm-demo/ao_demo.c | |
parent | 56a7cbbf51f5c9ebbfe17d1cc30ed807572af3cc (diff) |
altos: Clean up boot loader support
Split out code into separate files.
Add support for getting back to boot loader from application.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm-demo/ao_demo.c')
-rw-r--r-- | src/stm-demo/ao_demo.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c index 9ee0be03..ec572fdc 100644 --- a/src/stm-demo/ao_demo.c +++ b/src/stm-demo/ao_demo.c @@ -20,6 +20,7 @@ #include <ao_event.h> #include <ao_quadrature.h> #include <ao_button.h> +#include <ao_boot.h> struct ao_task demo_task; @@ -168,6 +169,13 @@ ao_event(void) } +static void +ao_boot_loader(void) +{ + flush(); + ao_boot_reboot((uint32_t *) 0); +} + __code struct ao_cmds ao_demo_cmds[] = { { ao_dma_test, "D\0DMA test" }, { ao_spi_write, "W\0SPI write" }, @@ -175,6 +183,7 @@ __code struct ao_cmds ao_demo_cmds[] = { { ao_i2c_write, "i\0I2C write" }, { ao_temp, "t\0Show temp" }, { ao_event, "e\0Monitor event queue" }, + { ao_boot_loader, "L\0Reboot to boot loader" }, { 0, NULL } }; |