From ffe5c26d92ae568ee1c2719796180e459a66674b Mon Sep 17 00:00:00 2001 From: aleph Date: Thu, 2 Dec 2010 16:15:45 +0000 Subject: [PATCH] STM32, serial driver: add support for STM32F101C4, i.e. only 2 serials instead of 3 git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4609 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/drv/ser_stm32.c | 6 ++++++ bertos/cpu/cortex-m3/drv/ser_stm32.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bertos/cpu/cortex-m3/drv/ser_stm32.c b/bertos/cpu/cortex-m3/drv/ser_stm32.c index a74b7fe0..eb88e6e6 100644 --- a/bertos/cpu/cortex-m3/drv/ser_stm32.c +++ b/bertos/cpu/cortex-m3/drv/ser_stm32.c @@ -96,6 +96,7 @@ static const struct gpio_uart_info gpio_uart[SER_CNT] = .sysctl_gpio = RCC_APB2_GPIOA, .sysctl_usart = RCC_APB1_USART2, }, +#if CPU_CM3_STM32F103RB /* UART3 */ { .base = GPIOB_BASE, @@ -104,6 +105,7 @@ static const struct gpio_uart_info gpio_uart[SER_CNT] = .sysctl_gpio = RCC_APB2_GPIOB, .sysctl_usart = RCC_APB1_USART3, }, +#endif }; #define USART1_PORT 0 @@ -337,7 +339,9 @@ static void stm32_uartIRQDisable(int port) /* UART port instances */ UART_PORT(1) UART_PORT(2) +#if CPU_CM3_STM32F103RB UART_PORT(3) +#endif static struct CM3Serial UARTDesc[SER_CNT] = { @@ -365,6 +369,7 @@ static struct CM3Serial UARTDesc[SER_CNT] = .base = USART2_BASE, .irq = USART2_IRQHANDLER, }, +#if CPU_CM3_STM32F103RB { .hw = { .table = &USART3_VT, @@ -377,6 +382,7 @@ static struct CM3Serial UARTDesc[SER_CNT] = .base = USART3_BASE, .irq = USART3_IRQHANDLER, }, +#endif }; struct SerialHardware *ser_hw_getdesc(int port) diff --git a/bertos/cpu/cortex-m3/drv/ser_stm32.h b/bertos/cpu/cortex-m3/drv/ser_stm32.h index 03a94fec..68fb4d46 100644 --- a/bertos/cpu/cortex-m3/drv/ser_stm32.h +++ b/bertos/cpu/cortex-m3/drv/ser_stm32.h @@ -49,8 +49,9 @@ enum { SER_UART1 = 0, SER_UART2, +#if CPU_CM3_STM32F103RB SER_UART3, - +#endif SER_CNT //< Number of serial ports }; -- 2.25.1