STM32, serial driver: add support for STM32F101C4, i.e. only 2 serials instead of 3
authoraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 2 Dec 2010 16:15:45 +0000 (16:15 +0000)
committeraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 2 Dec 2010 16:15:45 +0000 (16:15 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4609 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/ser_stm32.c
bertos/cpu/cortex-m3/drv/ser_stm32.h

index a74b7fe0d6d4430ea600880f65c53e1880f7ad0d..eb88e6e6efbc1b33ba6e8d70d378a8a0abac7d9c 100644 (file)
@@ -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)
index 03a94fecb01e5b1f3ca16c487d7a41aac120c9f4..68fb4d468f023b2351a98d35c778bec08ee99d9e 100644 (file)
@@ -49,8 +49,9 @@ enum
 {
        SER_UART1 = 0,
        SER_UART2,
+#if CPU_CM3_STM32F103RB
        SER_UART3,
-
+#endif
        SER_CNT //< Number of serial ports
 };