|
|
@@ -78,7 +78,7 @@ static int DTU_uart2_init(void)
|
|
|
rt_device_control(dtuserial, RT_DEVICE_CTRL_CONFIG, &dtuconfig);
|
|
|
/* step4:打开串口设备。以DMA接收及轮询发送模式打开串口设备 */
|
|
|
#ifdef RT_USING_SERIAL_V2
|
|
|
- rt_err_t uart_res = rt_device_open(dtuserial, RT_DEVICE_FLAG_RX_NON_BLOCKING | RT_DEVICE_FLAG_TX_BLOCKING); // 串口设备使用模式为 (发送阻塞 接收非阻塞) 模式
|
|
|
+ rt_err_t uart_res = rt_device_open(dtuserial, RT_DEVICE_FLAG_RX_NON_BLOCKING | RT_DEVICE_FLAG_TX_NON_BLOCKING); // 串口设备使用模式为 (发送阻塞 接收非阻塞) 模式
|
|
|
#else
|
|
|
rt_err_t uart_res = rt_device_open(dtuserial, RT_DEVICE_FLAG_DMA_RX); //RT_DEVICE_FLAG_DMA_RX
|
|
|
#endif
|
|
|
@@ -107,7 +107,7 @@ void DTU_Write(char *fmt, ...)
|
|
|
if (str_length > 1024 - 1)
|
|
|
str_length = 1024 - 1;
|
|
|
rt_device_write(dtuserial, 0, dtu_str, str_length);
|
|
|
- rt_thread_mdelay(20);
|
|
|
+ rt_thread_mdelay(100);
|
|
|
// if(strstr(dtu_str,"volume")!=RT_NULL)
|
|
|
// {
|
|
|
// rt_device_write(dtuserial,0,dtu_conf,4);
|