串口波特率默认为2400,修改成其他波特率方法如下:
DebugInit(UART_BUF_SIZE_BYTES_32, UartDataRxCallback, NULL);
/*主要添加下面两条*/
UartConfig(0x01d9,0);//115200 其他波特率值如下。
UartConfig(0x01d9,0);//115200 其他波特率值如下。
UartEnable(TRUE);//uartconfig设置完会默认把串口关闭,所以要重新使能串口。
/* UART Rx threshold is set to 1,
* so that every byte received will trigger the rx callback.
*/
UartRead(1, 0);