diff options
-rw-r--r-- | demos/ARMCM3-STM32F103-GCC/board.h | 2 | ||||
-rw-r--r-- | ports/ARM7-AT91SAM7X/sam7x_serial.c | 4 | ||||
-rw-r--r-- | ports/ARM7-AT91SAM7X/sam7x_serial.h | 2 | ||||
-rw-r--r-- | ports/ARMCM3-STM32F103/stm32_serial.c | 4 | ||||
-rw-r--r-- | ports/MSP430/msp430_serial.c | 8 | ||||
-rw-r--r-- | ports/MSP430/msp430_serial.h | 4 |
6 files changed, 13 insertions, 11 deletions
diff --git a/demos/ARMCM3-STM32F103-GCC/board.h b/demos/ARMCM3-STM32F103-GCC/board.h index 8d240d02e..81e918ae3 100644 --- a/demos/ARMCM3-STM32F103-GCC/board.h +++ b/demos/ARMCM3-STM32F103-GCC/board.h @@ -29,6 +29,8 @@ #ifndef __STM32F10x_MAP_H
#include "stm32lib/stm32f10x_map.h"
#endif
+#define FALSE 0
+#define TRUE (!FALSE)
#define BOARD_OLIMEX_STM32_P103
diff --git a/ports/ARM7-AT91SAM7X/sam7x_serial.c b/ports/ARM7-AT91SAM7X/sam7x_serial.c index 146d73f1b..6b904225a 100644 --- a/ports/ARM7-AT91SAM7X/sam7x_serial.c +++ b/ports/ARM7-AT91SAM7X/sam7x_serial.c @@ -140,11 +140,11 @@ void sam7x_set_usart(AT91PS_USART u, int speed, int mr) { u->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RSTSTA;
/* New parameters setup.*/
- if (mode & AT91C_US_OVER)
+ if (mr & AT91C_US_OVER)
u->US_BRGR = MCK / (speed * 8);
else
u->US_BRGR = MCK / (speed * 16);
- u->US_MR = mode;
+ u->US_MR = mr;
u->US_RTOR = 0;
u->US_TTGR = 0;
diff --git a/ports/ARM7-AT91SAM7X/sam7x_serial.h b/ports/ARM7-AT91SAM7X/sam7x_serial.h index 397fc9d3f..21db13635 100644 --- a/ports/ARM7-AT91SAM7X/sam7x_serial.h +++ b/ports/ARM7-AT91SAM7X/sam7x_serial.h @@ -70,7 +70,7 @@ extern "C" {
#endif
void sam7x_serial_init(int prio0, int prio1);
- void sam7x_set_usart(AT91PS_USART u, int speed, int mode);
+ void sam7x_set_usart(AT91PS_USART u, int speed, int mr);
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 d39cf8b27..571c35fc1 100644 --- a/ports/ARMCM3-STM32F103/stm32_serial.c +++ b/ports/ARMCM3-STM32F103/stm32_serial.c @@ -161,8 +161,8 @@ static void OutNotify3(void) { * @note Must be invoked with interrupts disabled. * @note Does not reset the I/O queues. */ -void SetUSART(USART_TypeDef *u, uint32_t speed, uint16_t cr1, - uint16_t cr2, uint16_t cr3) { +void stm32_set_usart(USART_TypeDef *u, uint32_t speed, uint16_t cr1, + uint16_t cr2, uint16_t cr3) { /* * Baud rate setting. diff --git a/ports/MSP430/msp430_serial.c b/ports/MSP430/msp430_serial.c index 9c7303e72..60cd00af6 100644 --- a/ports/MSP430/msp430_serial.c +++ b/ports/MSP430/msp430_serial.c @@ -102,7 +102,7 @@ static void OutNotify1(void) { * @param ctl The value for the @p U0CTL register.
* @note Does not reset the I/O queues.
*/
-void SetUSART0(uint16_t div, uint8_t mod, uint8_t ctl) {
+void msp430_set_usart0(uint16_t div, uint8_t mod, uint8_t ctl) {
U0CTL = SWRST; /* Resets the USART, it should already be */
/* USART init */
@@ -176,7 +176,7 @@ static void OutNotify2(void) { * @note Must be invoked with interrupts disabled.
* @note Does not reset the I/O queues.
*/
-void SetUSART1(uint16_t div, uint8_t mod, uint8_t ctl) {
+void msp430_set_usart1(uint16_t div, uint8_t mod, uint8_t ctl) {
U1CTL = SWRST; /* Resets the USART, it should already be */
/* USART init */
@@ -204,12 +204,12 @@ void msp430_serial_init(void) { /* I/O queues setup.*/
#if USE_MSP430_USART0
chFDDInit(&COM1, ib1, sizeof ib1, NULL, ob1, sizeof ob1, OutNotify1);
- SetUSART0(UBR(38400), 0, CHAR);
+ msp430_set_usart0(UBR(38400), 0, CHAR);
#endif
#if USE_MSP430_USART1
chFDDInit(&COM2, ib2, sizeof ib2, NULL, ob2, sizeof ob2, OutNotify2);
- SetUSART1(UBR(38400), 0, CHAR);
+ msp430_set_usart1(UBR(38400), 0, CHAR);
#endif
}
diff --git a/ports/MSP430/msp430_serial.h b/ports/MSP430/msp430_serial.h index 50146686b..3ea1730a7 100644 --- a/ports/MSP430/msp430_serial.h +++ b/ports/MSP430/msp430_serial.h @@ -65,8 +65,8 @@ extern "C" {
#endif
void msp430_serial_init(void);
- void SetUSART0(uint16_t div, uint8_t mod, uint8_t ctl);
- void SetUSART1(uint16_t div, uint8_t mod, uint8_t ctl);
+ void msp430_set_usart0(uint16_t div, uint8_t mod, uint8_t ctl);
+ void msp430_set_usart1(uint16_t div, uint8_t mod, uint8_t ctl);
#ifdef __cplusplus
}
#endif
|