@@ -147,7 +147,7 @@ static const struct rt_uart_ops drv_uart_ops =
147147 drv_getc ,
148148};
149149
150- #if defined(RT_USING_UART1 )
150+ #if defined(BSP_USING_UART1 )
151151/* UART1 device driver structure */
152152static struct drv_uart uart1 ;
153153struct rt_serial_device serial1 ;
@@ -168,9 +168,9 @@ void USART1_IRQHandler(void)
168168 /* leave interrupt */
169169 rt_interrupt_leave ();
170170}
171- #endif /* RT_USING_UART1 */
171+ #endif /* BSP_USING_UART1 */
172172
173- #if defined(RT_USING_UART2 )
173+ #if defined(BSP_USING_UART2 )
174174/* UART2 device driver structure */
175175static struct drv_uart uart2 ;
176176struct rt_serial_device serial2 ;
@@ -191,9 +191,9 @@ void USART2_IRQHandler(void)
191191 /* leave interrupt */
192192 rt_interrupt_leave ();
193193}
194- #endif /* RT_USING_UART2 */
194+ #endif /* BSP_USING_UART2 */
195195
196- #if defined(RT_USING_UART3 )
196+ #if defined(BSP_USING_UART3 )
197197/* UART3 device driver structure */
198198static struct drv_uart uart3 ;
199199struct rt_serial_device serial3 ;
@@ -214,9 +214,9 @@ void USART3_IRQHandler(void)
214214 /* leave interrupt */
215215 rt_interrupt_leave ();
216216}
217- #endif /* RT_USING_UART3 */
217+ #endif /* BSP_USING_UART3 */
218218
219- #if defined(RT_USING_UART6 )
219+ #if defined(BSP_USING_UART6 )
220220/* UART6 device driver structure */
221221static struct drv_uart uart6 ;
222222struct rt_serial_device serial6 ;
@@ -237,7 +237,7 @@ void USART6_IRQHandler(void)
237237 /* leave interrupt */
238238 rt_interrupt_leave ();
239239}
240- #endif /* RT_USING_UART6 */
240+ #endif /* BSP_USING_UART6 */
241241
242242/**
243243* @brief UART MSP Initialization
@@ -365,7 +365,7 @@ int hw_usart_init(void)
365365{
366366 struct drv_uart * uart ;
367367 struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT ;
368- #ifdef RT_USING_UART1
368+ #ifdef BSP_USING_UART1
369369 uart = & uart1 ;
370370 uart -> UartHandle .Instance = USART1 ;
371371 uart -> irq = USART1_IRQn ;
@@ -375,8 +375,8 @@ int hw_usart_init(void)
375375 rt_hw_serial_register (& serial1 , "uart1" ,
376376 RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX ,
377377 uart );
378- #endif /* RT_USING_UART1 */
379- #ifdef RT_USING_UART2
378+ #endif /* BSP_USING_UART1 */
379+ #ifdef BSP_USING_UART2
380380 uart = & uart2 ;
381381 uart -> UartHandle .Instance = USART2 ;
382382 uart -> irq = USART2_IRQn ;
@@ -386,8 +386,8 @@ int hw_usart_init(void)
386386 rt_hw_serial_register (& serial2 , "uart2" ,
387387 RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX ,
388388 uart );
389- #endif /* RT_USING_UART2 */
390- #ifdef RT_USING_UART3
389+ #endif /* BSP_USING_UART2 */
390+ #ifdef BSP_USING_UART3
391391 uart = & uart3 ;
392392 uart -> UartHandle .Instance = USART3 ;
393393 uart -> irq = USART3_IRQn ;
@@ -397,18 +397,19 @@ int hw_usart_init(void)
397397 rt_hw_serial_register (& serial3 , "uart3" ,
398398 RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX ,
399399 uart );
400- #endif /* RT_USING_UART3 */
401- #ifdef RT_USING_UART6
400+ #endif /* BSP_USING_UART3 */
401+ #ifdef BSP_USING_UART6
402402 uart = & uart6 ;
403403 uart -> UartHandle .Instance = USART6 ;
404404 uart -> irq = USART6_IRQn ;
405405 serial6 .ops = & drv_uart_ops ;
406406 serial6 .config = config ;
407- /* register UART2 device */
407+ /* register UART6 device */
408408 rt_hw_serial_register (& serial6 , "uart6" ,
409409 RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX ,
410410 uart );
411- #endif /* RT_USING_UART6 */
411+ #endif /* BSP_USING_UART6 */
412+
412413 return 0 ;
413414}
414415INIT_BOARD_EXPORT (hw_usart_init );
0 commit comments