diff options
Diffstat (limited to 'demos/ARM7-LPC214x-GCC')
-rw-r--r-- | demos/ARM7-LPC214x-GCC/chcore.c | 13 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC/chcore2.s | 19 |
2 files changed, 16 insertions, 16 deletions
diff --git a/demos/ARM7-LPC214x-GCC/chcore.c b/demos/ARM7-LPC214x-GCC/chcore.c index 05305b24e..5313ecdb4 100644 --- a/demos/ARM7-LPC214x-GCC/chcore.c +++ b/demos/ARM7-LPC214x-GCC/chcore.c @@ -151,19 +151,6 @@ void _IdleThread(void *p) { }
/*
- * System halt.
- * Yellow LED only.
- */
-void chSysHalt(void) {
-
- chSysLock();
- IO0SET = 0x00000C00;
- IO0CLR = 0x80000000;
- while (TRUE)
- ;
-}
-
-/*
* System console message (not implemented).
*/
void chSysPuts(char *msg) {
diff --git a/demos/ARM7-LPC214x-GCC/chcore2.s b/demos/ARM7-LPC214x-GCC/chcore2.s index 2a7888387..7c9d1d0d7 100644 --- a/demos/ARM7-LPC214x-GCC/chcore2.s +++ b/demos/ARM7-LPC214x-GCC/chcore2.s @@ -72,12 +72,25 @@ AbortHandler: .weak FiqHandler
.globl FiqHandler
FiqHandler:
+ b halt32
+
+.weak chSysHalt
#ifdef THUMB_NO_INTERWORKING
- ldr r0, =chSysHalt
+.code 16
+.globl chSysHalt
+chSysHalt:
+ mov r0, pc
bx r0
+.code 32
#else
- b chSysHalt
+.globl chSysHalt
+chSysHalt:
#endif
+halt32:
+ mrs r0, CPSR
+ orr r0, #I_BIT | F_BIT
+ msr CPSR_c, r0
+.loop: b .loop
#ifdef THUMB
.globl chSysLock
@@ -157,7 +170,7 @@ IrqCommon: #endif
cmp r0, #0 // Simply returns if a
ldmeqfd sp!, {r0-r3, r12, lr} // reschedule is not
- subeqs pc, lr, #4 // required.
+ subeqs pc, lr, #4 // required.
// Saves the IRQ mode registers in the system stack.
ldmfd sp!, {r0-r3, r12, lr} // IRQ stack now empty.
|