添加参数设置和自检命令
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include "if_uart_dma.h"
|
||||
|
||||
|
||||
|
||||
#ifndef RT_THREAD
|
||||
|
||||
#define rt_interrupt_enter()
|
||||
@@ -316,7 +315,7 @@ def_find_fun(uart_dtb,g_uartdtb)
|
||||
|
||||
|
||||
|
||||
static int init(uart_def *u)
|
||||
static int init(uart_def *u,int bsp)
|
||||
{
|
||||
param_check(u);
|
||||
if(u->private_data) return 0;
|
||||
@@ -334,7 +333,8 @@ static int init(uart_def *u)
|
||||
{
|
||||
u->private_data=self;
|
||||
dtb->uart_clock_fun(dtb->uart_rcc,ENABLE);
|
||||
init2.USART_BaudRate = dtb->baudrate;
|
||||
if(bsp==0) bsp=dtb->baudrate;
|
||||
init2.USART_BaudRate = bsp;
|
||||
USART_Init(dtb->uart, &init2);
|
||||
USART_Cmd(dtb->uart, ENABLE);
|
||||
|
||||
|
Reference in New Issue
Block a user