diff options
Diffstat (limited to 'ports')
-rw-r--r-- | ports/ARM7-LPC214x/GCC/lpc214x_serial.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/ports/ARM7-LPC214x/GCC/lpc214x_serial.c b/ports/ARM7-LPC214x/GCC/lpc214x_serial.c index cfd4f696e..43adab3b5 100644 --- a/ports/ARM7-LPC214x/GCC/lpc214x_serial.c +++ b/ports/ARM7-LPC214x/GCC/lpc214x_serial.c @@ -55,7 +55,6 @@ static void ServeInterrupt(UART *u, FullDuplexDriver *com) { switch (u->UART_IIR & IIR_SRC_MASK) {
case IIR_SRC_NONE:
- VICVectAddr = 0;
return;
case IIR_SRC_ERROR:
SetError(u->UART_LSR, com);
@@ -98,37 +97,21 @@ static void ServeInterrupt(UART *u, FullDuplexDriver *com) { __attribute__((naked, weak))
void UART0IrqHandler(void) {
- asm(".code 32 \n\t" \
- "stmfd sp!, {r0-r3, r12, lr} \n\t");
-#ifdef THUMB
- asm("add r0, pc, #1 \n\t" \
- "bx r0 \n\t" \
- ".code 16 \n\t");
- ServeInterrupt(U0Base, &COM1);
- asm("ldr r0, =IrqCommon \n\t" \
- "bx r0 \n\t");
-#else
+ chSysIRQEnterI();
+
ServeInterrupt(U0Base, &COM1);
- asm("b IrqCommon \n\t");
-#endif
+
+ chSysIRQExitI();
}
__attribute__((naked, weak))
void UART1IrqHandler(void) {
- asm(".code 32 \n\t" \
- "stmfd sp!, {r0-r3, r12, lr} \n\t");
-#ifdef THUMB
- asm("add r0, pc, #1 \n\t" \
- "bx r0 \n\t" \
- ".code 16 \n\t");
- ServeInterrupt(U1Base, &COM2);
- asm("ldr r0, =IrqCommon \n\t" \
- "bx r0 \n\t");
-#else
+ chSysIRQEnterI();
+
ServeInterrupt(U1Base, &COM2);
- asm("b IrqCommon \n\t");
-#endif
+
+ chSysIRQExitI();
}
#ifdef FIFO_PRELOAD
|