diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2015-07-13 16:45:32 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2015-07-13 16:45:32 +0900 |
commit | 3ba8234cecde90467fb75d72055fa0c226ed16df (patch) | |
tree | f6c184a72d8759a59b3b4db109fe1bfaab6d8032 /example-led/sys.c | |
parent | 2bb0e0de5d7d25d0bb036e6ee9cc0c94b62375ec (diff) |
sys_board and stm32 primer2
Diffstat (limited to 'example-led/sys.c')
-rw-r--r-- | example-led/sys.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/example-led/sys.c b/example-led/sys.c index f8bfa58..06af0c6 100644 --- a/example-led/sys.c +++ b/example-led/sys.c @@ -363,8 +363,6 @@ nvic_system_reset (void) static void __attribute__ ((naked)) reset (void) { - extern const unsigned long *FT0, *FT1, *FT2; - /* * This code may not be at the start of flash ROM, because of DFU. * So, we take the address from PC. @@ -391,6 +389,7 @@ reset (void) "1: .word 0x20000000" : /* no output */ : /* no input */ : "memory"); #else + extern const unsigned long *FT0, *FT1, *FT2; asm volatile ("cpsid i\n\t" /* Mask all interrupts. */ "ldr r0, 1f\n\t" /* r0 = SCR */ "mov r1, pc\n\t" /* r1 = (PC + 0x1000) & ~0x0fff */ @@ -406,12 +405,11 @@ reset (void) ".align 2\n" "1: .word 0xe000ed00" : /* no output */ : /* no input */ : "memory"); -#endif - - /* Never reach here. */ /* Artificial entry to refer FT0, FT1, and FT2. */ asm volatile ("" : : "r" (FT0), "r" (FT1), "r" (FT2)); +#endif + /* Never reach here. */ } typedef void (*handler)(void); |