diff options
| author | Keith Packard <keithp@keithp.com> | 2013-03-10 21:02:59 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2013-03-10 21:02:59 -0700 |
| commit | 8083aeb07167a1a68a168f16ac951b6de7b197ea (patch) | |
| tree | e32ce77901c14cde263870298ab503af4a81fe4c /src/stm-flash | |
| parent | 5187bb4402874f654fcef5ffdf237edf97a26b8c (diff) | |
altos: Make stm-flash capable of switching to application
This shrinks the base OS load down a bit as well so that stm-flash
fits comfortably in the first 8kB of memory.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm-flash')
| -rw-r--r-- | src/stm-flash/ao_pins.h | 13 | ||||
| -rw-r--r-- | src/stm-flash/ao_stm_flash.c | 22 |
2 files changed, 16 insertions, 19 deletions
diff --git a/src/stm-flash/ao_pins.h b/src/stm-flash/ao_pins.h index b232f373..ca53d844 100644 --- a/src/stm-flash/ao_pins.h +++ b/src/stm-flash/ao_pins.h @@ -20,7 +20,9 @@ #define HAS_TASK_QUEUE 0 -#define AO_HSE 8000000 +/* Bridge SB17 on the board and use the MCO from the other chip */ +#define AO_HSE 8000000 +#define AO_HSE_BYPASS 1 /* PLLVCO = 96MHz (so that USB will work) */ #define AO_PLLMUL 12 @@ -61,11 +63,12 @@ #define AO_TICK_SIGNED int32_t #define HAS_TASK_INFO 0 +#define HAS_VERSION 0 -#define AO_BOOT_APPLICATION_GPIO stm_gpiob -#define AO_BOOT_APPLICATION_PIN 5 -#define AO_BOOT_APPLICATION_VALUE 0 -#define AO_BOOT_APPLICATION_MODE AO_EXTI_MODE_PULL_UP +#define AO_BOOT_APPLICATION_GPIO stm_gpioa +#define AO_BOOT_APPLICATION_PIN 0 +#define AO_BOOT_APPLICATION_VALUE 1 +#define AO_BOOT_APPLICATION_MODE 0 #define AO_BOOT_APPLICATION_BASE 0x2000 #endif /* _AO_PINS_H_ */ diff --git a/src/stm-flash/ao_stm_flash.c b/src/stm-flash/ao_stm_flash.c index 617c6d79..16dd1189 100644 --- a/src/stm-flash/ao_stm_flash.c +++ b/src/stm-flash/ao_stm_flash.c @@ -17,25 +17,18 @@ #include "ao.h" #include <ao_exti.h> +#include <ao_boot.h> void -ao_panic(uint8_t c) +ao_panic(uint8_t reason) { + for (;;); } -void -ao_test(void) -{ - char c; - - for (;;) { - c = ao_usb_getchar(); - ao_usb_putchar(c); - ao_usb_flush(); - } -} - -struct ao_task ao_test_task; +__code struct ao_cmds ao_flash_cmds[] = { + { ao_reboot_application, "A\0Switch to application" }, + { 0, NULL }, +}; int main(void) @@ -47,6 +40,7 @@ main(void) // ao_exti_init(); ao_usb_init(); + ao_cmd_register(&ao_flash_cmds[0]); ao_start_scheduler(); return 0; } |
