summaryrefslogtreecommitdiff
path: root/src/stm/ao_interrupt.c
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2013-05-16 00:36:23 -0600
committerBdale Garbee <bdale@gag.com>2013-05-16 00:36:23 -0600
commit02d111b1b53ef01fc6e9ab6c4bc60b8af1be0067 (patch)
tree8356f4a019969ee99a45e264c87d38555cf316cc /src/stm/ao_interrupt.c
parent7a2e1f05adad990a6b161865267abf07ffec7a7e (diff)
parent7699a55aed3a9a7daeb4c6a5a9a280f43edf455f (diff)
Merge branch 'branch-1.2' into debian
Diffstat (limited to 'src/stm/ao_interrupt.c')
-rw-r--r--src/stm/ao_interrupt.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/stm/ao_interrupt.c b/src/stm/ao_interrupt.c
index 6b4a9700..969e6a0f 100644
--- a/src/stm/ao_interrupt.c
+++ b/src/stm/ao_interrupt.c
@@ -15,8 +15,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+#include <ao.h>
#include "stm32l.h"
#include <string.h>
+#include <ao_boot.h>
extern void main(void);
extern char __stack__;
@@ -28,14 +30,26 @@ extern char __bss_start__, __bss_end__;
void stm_halt_isr(void)
{
- for(;;);
+ ao_panic(AO_PANIC_CRASH);
}
void stm_ignore_isr(void)
{
}
-void start(void) {
+const void *stm_interrupt_vector[];
+
+void start(void)
+{
+#ifdef AO_BOOT_CHAIN
+ if (ao_boot_check_chain()) {
+#ifdef AO_BOOT_PIN
+ ao_boot_check_pin();
+#endif
+ }
+#endif
+ /* Set interrupt vector table offset */
+ stm_nvic.vto = (uint32_t) &stm_interrupt_vector;
memcpy(&__data_start__, &__text_end__, &__data_end__ - &__data_start__);
memset(&__bss_start__, '\0', &__bss_end__ - &__bss_start__);
main();