diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-01-24 17:59:51 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-01-24 17:59:51 +0000 |
commit | 8fa109243e5d626a941db8e7d6dc30bb64f9bc9f (patch) | |
tree | ac92dda23f29f7f49078904b111e2c2679347a1b /ports/ARM7-LPC214x/lpc214x_serial.c | |
parent | f29ada23c52c611b840cd7321fe52e1aa18f5ce9 (diff) | |
download | ChibiOS-8fa109243e5d626a941db8e7d6dc30bb64f9bc9f.tar.gz ChibiOS-8fa109243e5d626a941db8e7d6dc30bb64f9bc9f.tar.bz2 ChibiOS-8fa109243e5d626a941db8e7d6dc30bb64f9bc9f.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@675 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'ports/ARM7-LPC214x/lpc214x_serial.c')
-rw-r--r-- | ports/ARM7-LPC214x/lpc214x_serial.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/ports/ARM7-LPC214x/lpc214x_serial.c b/ports/ARM7-LPC214x/lpc214x_serial.c index 527f99f59..62c602dfd 100644 --- a/ports/ARM7-LPC214x/lpc214x_serial.c +++ b/ports/ARM7-LPC214x/lpc214x_serial.c @@ -43,9 +43,9 @@ static void SetError(IOREG32 err, FullDuplexDriver *com) { sts |= SD_FRAMING_ERROR;
if (err & LSR_BREAK)
sts |= SD_BREAK_DETECTED;
- chSysLockI();
+ chSysLockFromIsr();
chFDDAddFlagsI(com, sts);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
/*
@@ -66,36 +66,36 @@ static void ServeInterrupt(UART *u, FullDuplexDriver *com) { case IIR_SRC_TIMEOUT:
case IIR_SRC_RX:
while (u->UART_LSR & LSR_RBR_FULL) {
- chSysLockI();
+ chSysLockFromIsr();
if (chIQPutI(&com->sd_iqueue, u->UART_RBR) < Q_OK)
chFDDAddFlagsI(com, SD_OVERRUN_ERROR);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
- chSysLockI();
+ chSysLockFromIsr();
chEvtBroadcastI(&com->sd_ievent);
- chSysUnlockI();
+ chSysUnlockFromIsr();
break;
case IIR_SRC_TX:
{
#ifdef FIFO_PRELOAD
int i = FIFO_PRELOAD;
do {
- chSysLockI();
+ chSysLockFromIsr();
msg_t b = chOQGetI(&com->sd_oqueue);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK) {
u->UART_IER &= ~IER_THRE;
- chSysLockI();
+ chSysLockFromIsr();
chEvtBroadcastI(&com->sd_oevent);
- chSysUnlockI();
+ chSysUnlockFromIsr();
break;
}
u->UART_THR = b;
} while (--i);
#else
- chSysLockI();
+ chSysLockFromIsr();
msg_t b = chFDDRequestDataI(com);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK)
u->UART_IER &= ~IER_THRE;
else
@@ -135,13 +135,13 @@ static void preload(UART *u, FullDuplexDriver *com) { if (u->UART_LSR & LSR_THRE) {
int i = FIFO_PRELOAD;
do {
- chSysLockI();
+ chSysLockFromIsr();
msg_t b = chOQGetI(&com->sd_oqueue);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK) {
- chSysLockI();
+ chSysLockFromIsr();
chEvtBroadcastI(&com->sd_oevent);
- chSysUnlockI();
+ chSysUnlockFromIsr();
return;
}
u->UART_THR = b;
@@ -163,9 +163,9 @@ static void OutNotify1(void) { UART *u = U0Base;
if (u->UART_LSR & LSR_THRE) {
- chSysLockI();
+ chSysLockFromIsr();
u->UART_THR = chOQGetI(&COM1.sd_oqueue);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
u->UART_IER |= IER_THRE;
#endif
@@ -191,7 +191,7 @@ static void OutNotify2(void) { /*
* UART setup, must be invoked with interrupts disabled.
*/
-void SetUARTI(UART *u, int speed, int lcr, int fcr) {
+void SetUART(UART *u, int speed, int lcr, int fcr) {
int div = PCLK / (speed << 4);
u->UART_LCR = lcr | LCR_DLAB;
@@ -216,10 +216,10 @@ void InitSerial(int vector1, int vector2) { PCONP = (PCONP & PCALL) | PCUART0 | PCUART1;
chFDDInit(&COM1, ib1, sizeof ib1, NULL, ob1, sizeof ob1, OutNotify1);
- SetUARTI(U0Base, 38400, LCR_WL8 | LCR_STOP1 | LCR_NOPARITY, FCR_TRIGGER0);
+ SetUART(U0Base, 38400, LCR_WL8 | LCR_STOP1 | LCR_NOPARITY, FCR_TRIGGER0);
chFDDInit(&COM2, ib2, sizeof ib2, NULL, ob2, sizeof ob2, OutNotify2);
- SetUARTI(U1Base, 38400, LCR_WL8 | LCR_STOP1 | LCR_NOPARITY, FCR_TRIGGER0);
+ SetUART(U1Base, 38400, LCR_WL8 | LCR_STOP1 | LCR_NOPARITY, FCR_TRIGGER0);
VICIntEnable = INTMASK(SOURCE_UART0) | INTMASK(SOURCE_UART1);
}
|