|
|
@@ -39,7 +39,7 @@ static void serial_thread_entry(void* parameter)
|
|
|
|
|
|
/* 查找系统中的串口设备 */
|
|
|
serial = rt_device_find(uart_name);
|
|
|
-
|
|
|
+
|
|
|
if (serial != RT_NULL)
|
|
|
{
|
|
|
rt_sem_init(&rx_sem, "rx_sem", 0, RT_IPC_FLAG_FIFO);
|
|
|
@@ -58,9 +58,9 @@ static void serial_thread_entry(void* parameter)
|
|
|
/* 阻塞等待接收信号量,等到信号量后再次读取数据 */
|
|
|
rt_sem_take(&rx_sem, RT_WAITING_FOREVER);
|
|
|
}
|
|
|
- /* 读取到的数据通过串口错位输出 */
|
|
|
- ch = ch + 1;
|
|
|
- rt_device_write(serial, 0, &ch, 1);
|
|
|
+ /* 读取到的数据通过串口错位输出 */
|
|
|
+ ch = ch + 1;
|
|
|
+ rt_device_write(serial, 0, &ch, 1);
|
|
|
}
|
|
|
}
|
|
|
else
|