diff options
Diffstat (limited to 'ports')
-rw-r--r-- | ports/ARM7-AT91SAM7X/sam7x_emac.c | 8 | ||||
-rw-r--r-- | ports/ARM7-AT91SAM7X/sam7x_serial.c | 34 | ||||
-rw-r--r-- | ports/ARM7-AT91SAM7X/sam7x_serial.h | 2 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/lpc214x_serial.c | 42 | ||||
-rw-r--r-- | ports/ARM7-LPC214x/lpc214x_serial.h | 2 | ||||
-rw-r--r-- | ports/ARMCM3-STM32F103/stm32_serial.c | 22 | ||||
-rw-r--r-- | ports/ARMCM3-STM32F103/stm32_serial.h | 4 | ||||
-rw-r--r-- | ports/ARMCM3/chcore.c | 8 | ||||
-rw-r--r-- | ports/AVR/avr_serial.c | 26 | ||||
-rw-r--r-- | ports/AVR/avr_serial.h | 4 | ||||
-rw-r--r-- | ports/MSP430/msp430_serial.c | 32 | ||||
-rw-r--r-- | ports/MSP430/msp430_serial.h | 4 |
12 files changed, 94 insertions, 94 deletions
diff --git a/ports/ARM7-AT91SAM7X/sam7x_emac.c b/ports/ARM7-AT91SAM7X/sam7x_emac.c index 21c7808b0..681919a88 100644 --- a/ports/ARM7-AT91SAM7X/sam7x_emac.c +++ b/ports/ARM7-AT91SAM7X/sam7x_emac.c @@ -106,18 +106,18 @@ static void ServeInterrupt(void) { if ((isr & AT91C_EMAC_RCOMP) || (rsr & RSR_BITS)) {
if (rsr & AT91C_EMAC_REC) {
// received++;
- chSysLockI();
+ chSysLockFromIsr();
chEvtBroadcastI(&EMACFrameReceived);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
AT91C_BASE_EMAC->EMAC_RSR = RSR_BITS;
}
if ((isr & AT91C_EMAC_TCOMP) || (tsr & TSR_BITS)) {
if (tsr & AT91C_EMAC_COMP) {
- chSysLockI();
+ chSysLockFromIsr();
chEvtBroadcastI(&EMACFrameTransmitted);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
AT91C_BASE_EMAC->EMAC_TSR = TSR_BITS;
}
diff --git a/ports/ARM7-AT91SAM7X/sam7x_serial.c b/ports/ARM7-AT91SAM7X/sam7x_serial.c index c13701847..7aa57f126 100644 --- a/ports/ARM7-AT91SAM7X/sam7x_serial.c +++ b/ports/ARM7-AT91SAM7X/sam7x_serial.c @@ -42,9 +42,9 @@ static void SetError(AT91_REG csr, FullDuplexDriver *com) { sts |= SD_FRAMING_ERROR;
if (csr & AT91C_US_RXBRK)
sts |= SD_BREAK_DETECTED;
- chSysLockI();
+ chSysLockFromIsr();
chFDDAddFlagsI(com, sts);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
/*
@@ -54,14 +54,14 @@ __attribute__((noinline)) static void ServeInterrupt(AT91PS_USART u, FullDuplexDriver *com) {
if (u->US_CSR & AT91C_US_RXRDY) {
- chSysLockI();
+ chSysLockFromIsr();
chFDDIncomingDataI(com, u->US_RHR);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
if (u->US_CSR & AT91C_US_TXRDY) {
- chSysLockI();
+ chSysLockFromIsr();
msg_t b = chFDDRequestDataI(com);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK)
u->US_IDR = AT91C_US_TXRDY;
else
@@ -114,7 +114,7 @@ static void OutNotify2(void) { * USART setup, must be invoked with interrupts disabled.
* NOTE: Does not reset I/O queues.
*/
-void SetUSARTI(AT91PS_USART u, int speed, int mode) {
+void SetUSART(AT91PS_USART u, int speed, int mode) {
/* Disables IRQ sources and stop operations.*/
u->US_IDR = 0xFFFFFFFF;
@@ -169,14 +169,14 @@ void InitSerial(int prio0, int prio1) { USART1IrqHandler);
AIC_EnableIT(AT91C_ID_US1);
- SetUSARTI(AT91C_BASE_US0, 38400, AT91C_US_USMODE_NORMAL |
- AT91C_US_CLKS_CLOCK |
- AT91C_US_CHRL_8_BITS |
- AT91C_US_PAR_NONE |
- AT91C_US_NBSTOP_1_BIT);
- SetUSARTI(AT91C_BASE_US1, 38400, AT91C_US_USMODE_NORMAL |
- AT91C_US_CLKS_CLOCK |
- AT91C_US_CHRL_8_BITS |
- AT91C_US_PAR_NONE |
- AT91C_US_NBSTOP_1_BIT);
+ SetUSART(AT91C_BASE_US0, 38400, AT91C_US_USMODE_NORMAL |
+ AT91C_US_CLKS_CLOCK |
+ AT91C_US_CHRL_8_BITS |
+ AT91C_US_PAR_NONE |
+ AT91C_US_NBSTOP_1_BIT);
+ SetUSART(AT91C_BASE_US1, 38400, AT91C_US_USMODE_NORMAL |
+ AT91C_US_CLKS_CLOCK |
+ AT91C_US_CHRL_8_BITS |
+ AT91C_US_PAR_NONE |
+ AT91C_US_NBSTOP_1_BIT);
}
diff --git a/ports/ARM7-AT91SAM7X/sam7x_serial.h b/ports/ARM7-AT91SAM7X/sam7x_serial.h index f526f7840..18e4a5f88 100644 --- a/ports/ARM7-AT91SAM7X/sam7x_serial.h +++ b/ports/ARM7-AT91SAM7X/sam7x_serial.h @@ -30,7 +30,7 @@ extern "C" {
#endif
void InitSerial(int prio0, int prio1);
- void SetUSARTI(AT91PS_USART u, int speed, int mode);
+ void SetUSART(AT91PS_USART u, int speed, int mode);
CH_IRQ_HANDLER(UART0IrqHandler);
CH_IRQ_HANDLER(UART1IrqHandler);
#ifdef __cplusplus
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);
}
diff --git a/ports/ARM7-LPC214x/lpc214x_serial.h b/ports/ARM7-LPC214x/lpc214x_serial.h index d7844a49d..ce457dadf 100644 --- a/ports/ARM7-LPC214x/lpc214x_serial.h +++ b/ports/ARM7-LPC214x/lpc214x_serial.h @@ -41,7 +41,7 @@ extern "C" {
#endif
void InitSerial(int vector1, int vector2);
- void SetUARTI(UART *u, int speed, int lcr, int fcr);
+ void SetUART(UART *u, int speed, int lcr, int fcr);
CH_IRQ_HANDLER(UART0IrqHandler);
CH_IRQ_HANDLER(UART1IrqHandler);
#ifdef __cplusplus
diff --git a/ports/ARMCM3-STM32F103/stm32_serial.c b/ports/ARMCM3-STM32F103/stm32_serial.c index d54291b75..725fe3480 100644 --- a/ports/ARMCM3-STM32F103/stm32_serial.c +++ b/ports/ARMCM3-STM32F103/stm32_serial.c @@ -55,9 +55,9 @@ static void SetError(uint16_t sr, FullDuplexDriver *com) { sts |= SD_FRAMING_ERROR; if (sr & SR_LBD) sts |= SD_BREAK_DETECTED; - chSysLockI(); + chSysLockFromIsr(); chFDDAddFlagsI(com, sts); - chSysUnlockI(); + chSysUnlockFromIsr(); } static void ServeInterrupt(USART_TypeDef *u, FullDuplexDriver *com) { @@ -66,14 +66,14 @@ static void ServeInterrupt(USART_TypeDef *u, FullDuplexDriver *com) { if (sr & (SR_ORE | SR_FE | SR_PE | SR_LBD)) SetError(sr, com); if (sr & SR_RXNE) { - chSysLockI(); + chSysLockFromIsr(); chFDDIncomingDataI(com, u->DR); - chSysUnlockI(); + chSysUnlockFromIsr(); } if (sr & SR_TXE) { - chSysLockI(); + chSysLockFromIsr(); msg_t b = chFDDRequestDataI(com); - chSysUnlockI(); + chSysUnlockFromIsr(); if (b < Q_OK) u->CR1 &= ~CR1_TXEIE; else @@ -154,8 +154,8 @@ static void OutNotify3(void) { * USART setup, must be invoked with interrupts disabled. * NOTE: Does not reset I/O queues. */ -void SetUSARTI(USART_TypeDef *u, uint32_t speed, uint16_t cr1, - uint16_t cr2, uint16_t cr3) { +void SetUSART(USART_TypeDef *u, uint32_t speed, uint16_t cr1, + uint16_t cr2, uint16_t cr3) { /* * Baud rate setting. @@ -183,7 +183,7 @@ void InitSerial(uint32_t prio1, uint32_t prio2, uint32_t prio3) { #ifdef USE_USART1 chFDDInit(&COM1, ib1, sizeof ib1, NULL, ob1, sizeof ob1, OutNotify1); RCC->APB2ENR |= 0x00004000; - SetUSARTI(USART1, USART_BITRATE, 0, CR2_STOP1_BITS | CR2_LINEN, 0); + SetUSART(USART1, USART_BITRATE, 0, CR2_STOP1_BITS | CR2_LINEN, 0); GPIOA->CRH = (GPIOA->CRH & 0xFFFFF00F) | 0x000004B0; NVICEnableVector(USART1_IRQChannel, prio1); #endif @@ -191,7 +191,7 @@ void InitSerial(uint32_t prio1, uint32_t prio2, uint32_t prio3) { #ifdef USE_USART2 chFDDInit(&COM2, ib2, sizeof ib2, NULL, ob2, sizeof ob2, OutNotify2); RCC->APB1ENR |= 0x00020000; - SetUSARTI(USART2, USART_BITRATE, 0, CR2_STOP1_BITS | CR2_LINEN, 0); + SetUSART(USART2, USART_BITRATE, 0, CR2_STOP1_BITS | CR2_LINEN, 0); GPIOA->CRL = (GPIOA->CRL & 0xFFFF00FF) | 0x00004B00; NVICEnableVector(USART2_IRQChannel, prio2); #endif @@ -199,7 +199,7 @@ void InitSerial(uint32_t prio1, uint32_t prio2, uint32_t prio3) { #ifdef USE_USART3 chFDDInit(&COM3, ib3, sizeof ib3, NULL, ob3, sizeof ob3, OutNotify3); RCC->APB1ENR |= 0x00040000; - SetUSARTI(USART3, USART_BITRATE, 0, CR2_STOP1_BITS | CR2_LINEN, 0); + SetUSART(USART3, USART_BITRATE, 0, CR2_STOP1_BITS | CR2_LINEN, 0); GPIOB->CRH = (GPIOB->CRH & 0xFFFF00FF) | 0x00004B00; NVICEnableVector(USART3_IRQChannel, prio3); #endif diff --git a/ports/ARMCM3-STM32F103/stm32_serial.h b/ports/ARMCM3-STM32F103/stm32_serial.h index d14e372bd..93163dc50 100644 --- a/ports/ARMCM3-STM32F103/stm32_serial.h +++ b/ports/ARMCM3-STM32F103/stm32_serial.h @@ -99,8 +99,8 @@ extern FullDuplexDriver COM3; extern "C" {
#endif
void InitSerial(uint32_t prio1, uint32_t prio2, uint32_t prio3);
- void SetUSARTI(USART_TypeDef *u, uint32_t speed, uint16_t cr1,
- uint16_t cr2, uint16_t cr3);
+ void SetUSART(USART_TypeDef *u, uint32_t speed, uint16_t cr1,
+ uint16_t cr2, uint16_t cr3);
#ifdef __cplusplus
}
#endif
diff --git a/ports/ARMCM3/chcore.c b/ports/ARMCM3/chcore.c index 91971b866..8edbb658a 100644 --- a/ports/ARMCM3/chcore.c +++ b/ports/ARMCM3/chcore.c @@ -75,9 +75,9 @@ CH_IRQ_HANDLER(SysTickVector) { CH_IRQ_PROLOGUE();
- chSysLockI();
+ chSysLockFromIsr();
chSysTimerHandlerI();
- chSysUnlockI();
+ chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
@@ -163,10 +163,10 @@ void PendSVVector(void) { Thread *otp;
register struct intctx *sp_thd asm("r12");
- chSysLockI();
+ chSysLockFromIsr();
asm volatile ("push {lr}");
if (!chSchRescRequiredI()) {
- chSysUnlockI();
+ chSysUnlockFromIsr();
asm volatile ("pop {pc}");
}
asm volatile ("pop {lr}");
diff --git a/ports/AVR/avr_serial.c b/ports/AVR/avr_serial.c index 628067e83..c9e2b0b10 100644 --- a/ports/AVR/avr_serial.c +++ b/ports/AVR/avr_serial.c @@ -30,9 +30,9 @@ static void SetError(uint8_t sra, FullDuplexDriver *com) { sts |= SD_PARITY_ERROR;
if (sra & (1 << FE))
sts |= SD_FRAMING_ERROR;
- chSysLockI();
+ chSysLockFromIsr();
chFDDAddFlagsI(com, sts);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
#ifdef USE_AVR_USART0
@@ -48,9 +48,9 @@ CH_IRQ_HANDLER(USART0_RX_vect) { sra = UCSR0A;
if (sra & ((1 << DOR) | (1 << UPE) | (1 << FE)))
SetError(sra, &SER1);
- chSysLockI();
+ chSysLockFromIsr();
chFDDIncomingDataI(&SER1, UDR0);
- chSysUnlockI();
+ chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
@@ -60,9 +60,9 @@ CH_IRQ_HANDLER(USART0_UDRE_vect) { CH_IRQ_PROLOGUE();
- chSysLockI();
+ chSysLockFromIsr();
b = chFDDRequestDataI(&SER1);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK)
UCSR0B &= ~(1 << UDRIE);
else
@@ -107,9 +107,9 @@ CH_IRQ_HANDLER(USART1_RX_vect) { sra = UCSR1A;
if (sra & ((1 << DOR) | (1 << UPE) | (1 << FE)))
SetError(sra, &SER2);
- chSysLockI();
+ chSysLockFromIsr();
chFDDIncomingDataI(&SER2, UDR1);
- chSysUnlockI();
+ chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
@@ -119,9 +119,9 @@ CH_IRQ_HANDLER(USART1_UDRE_vect) { CH_IRQ_PROLOGUE();
- chSysLockI();
+ chSysLockFromIsr();
b = chFDDRequestDataI(&SER2);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK)
UCSR1B &= ~(1 << UDRIE);
else
@@ -143,7 +143,7 @@ static void OutNotify2(void) { * USART setup, must be invoked with interrupts disabled.
* NOTE: Does not reset I/O queues.
*/
-void SetUSART1I(uint16_t brr, uint8_t csrc) {
+void SetUSART1(uint16_t brr, uint8_t csrc) {
UBRR1L = brr;
UBRR1H = brr >> 8;
@@ -158,11 +158,11 @@ void InitSerial(void) { #ifdef USE_AVR_USART0
/* I/O queues setup.*/
chFDDInit(&SER1, ib1, sizeof ib1, NULL, ob1, sizeof ob1, OutNotify1);
- SetUSART0I(UBRR(38400), (1 << UCSZ1) | (1 << UCSZ0));
+ SetUSART0(UBRR(38400), (1 << UCSZ1) | (1 << UCSZ0));
#endif
#ifdef USE_AVR_USART1
chFDDInit(&SER2, ib2, sizeof ib2, NULL, ob2, sizeof ob2, OutNotify2);
- SetUSART1I(UBRR(38400), (1 << UCSZ1) | (1 << UCSZ0));
+ SetUSART1(UBRR(38400), (1 << UCSZ1) | (1 << UCSZ0));
#endif
}
diff --git a/ports/AVR/avr_serial.h b/ports/AVR/avr_serial.h index 19e66f18a..555dae522 100644 --- a/ports/AVR/avr_serial.h +++ b/ports/AVR/avr_serial.h @@ -38,8 +38,8 @@ extern "C" {
#endif
void InitSerial(void);
- void SetUSART0I(uint16_t brr, uint8_t csrc);
- void SetUSART1I(uint16_t brr, uint8_t csrc);
+ void SetUSART0(uint16_t brr, uint8_t csrc);
+ void SetUSART1(uint16_t brr, uint8_t csrc);
#ifdef __cplusplus
}
#endif
diff --git a/ports/MSP430/msp430_serial.c b/ports/MSP430/msp430_serial.c index 81ef18c54..7326a4a8e 100644 --- a/ports/MSP430/msp430_serial.c +++ b/ports/MSP430/msp430_serial.c @@ -34,9 +34,9 @@ static void SetError(uint8_t urctl, FullDuplexDriver *com) { sts |= SD_FRAMING_ERROR;
if (urctl & BRK)
sts |= SD_BREAK_DETECTED;
- chSysLockI();
+ chSysLockFromIsr();
chFDDAddFlagsI(com, sts);
- chSysUnlockI();
+ chSysUnlockFromIsr();
}
#ifdef USE_MSP430_USART0
@@ -49,9 +49,9 @@ CH_IRQ_HANDLER(USART0TX_VECTOR) { CH_IRQ_PROLOGUE();
- chSysLockI();
+ chSysLockFromIsr();
b = chFDDRequestDataI(&COM1);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK)
U0IE &= ~UTXIE0;
else
@@ -67,9 +67,9 @@ CH_IRQ_HANDLER(USART0RX_VECTOR) { if ((urctl = U0RCTL) & RXERR)
SetError(urctl, &COM1);
- chSysLockI();
+ chSysLockFromIsr();
chFDDIncomingDataI(&COM1, U0RXBUF);
- chSysUnlockI();
+ chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
@@ -81,9 +81,9 @@ CH_IRQ_HANDLER(USART0RX_VECTOR) { static void OutNotify1(void) {
if (!(U0IE & UTXIE0)) {
- chSysLockI();
+ chSysLockFromIsr();
U0TXBUF = (uint8_t)chFDDRequestDataI(&COM1);
- chSysUnlockI();
+ chSysUnlockFromIsr();
U0IE |= UTXIE0;
}
}
@@ -92,7 +92,7 @@ static void OutNotify1(void) { * USART setup, must be invoked with interrupts disabled.
* NOTE: Does not reset I/O queues.
*/
-void SetUSART0I(uint16_t div, uint8_t mod, uint8_t ctl) {
+void SetUSART0(uint16_t div, uint8_t mod, uint8_t ctl) {
U0CTL = SWRST; /* Resets the USART, it should already be */
/* USART init */
@@ -121,9 +121,9 @@ CH_IRQ_HANDLER(USART1TX_VECTOR) { CH_IRQ_PROLOGUE();
- chSysLockI();
+ chSysLockFromIsr();
b = chFDDRequestDataI(&COM2);
- chSysUnlockI();
+ chSysUnlockFromIsr();
if (b < Q_OK)
U1IE &= ~UTXIE1;
else
@@ -139,9 +139,9 @@ CH_IRQ_HANDLER(USART1RX_VECTOR) { if ((urctl = U1RCTL) & RXERR)
SetError(urctl, &COM2);
- chSysLockI();
+ chSysLockFromIsr();
chFDDIncomingDataI(&COM2, U1RXBUF);
- chSysUnlockI();
+ chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
@@ -162,7 +162,7 @@ static void OutNotify2(void) { * USART setup, must be invoked with interrupts disabled.
* NOTE: Does not reset I/O queues.
*/
-void SetUSART1I(uint16_t div, uint8_t mod, uint8_t ctl) {
+void SetUSART1(uint16_t div, uint8_t mod, uint8_t ctl) {
U1CTL = SWRST; /* Resets the USART, it should already be */
/* USART init */
@@ -186,11 +186,11 @@ void InitSerial(void) { /* I/O queues setup.*/
#ifdef USE_MSP430_USART0
chFDDInit(&COM1, ib1, sizeof ib1, NULL, ob1, sizeof ob1, OutNotify1);
- SetUSART0I(UBR(38400), 0, CHAR);
+ SetUSART0(UBR(38400), 0, CHAR);
#endif
#ifdef USE_MSP430_USART1
chFDDInit(&COM2, ib2, sizeof ib2, NULL, ob2, sizeof ob2, OutNotify2);
- SetUSART1I(UBR(38400), 0, CHAR);
+ SetUSART1(UBR(38400), 0, CHAR);
#endif
}
diff --git a/ports/MSP430/msp430_serial.h b/ports/MSP430/msp430_serial.h index 4fd9fa009..c10f22738 100644 --- a/ports/MSP430/msp430_serial.h +++ b/ports/MSP430/msp430_serial.h @@ -38,8 +38,8 @@ extern "C" {
#endif
void InitSerial(void);
- void SetUSART0I(uint16_t div, uint8_t mod, uint8_t ctl);
- void SetUSART1I(uint16_t div, uint8_t mod, uint8_t ctl);
+ void SetUSART0(uint16_t div, uint8_t mod, uint8_t ctl);
+ void SetUSART1(uint16_t div, uint8_t mod, uint8_t ctl);
#ifdef __cplusplus
}
#endif
|