Skip to content

Commit 8f696ca

Browse files
committed
[更新]更新串口示例
1 parent f485f5e commit 8f696ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uart_sample.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ static int uart_sample(int argc, char *argv[])
7575

7676
/* 初始化信号量 */
7777
rt_sem_init(&rx_sem, "rx_sem", 0, RT_IPC_FLAG_FIFO);
78-
/* 以读写及中断接收方式打开串口设备 */
79-
rt_device_open(serial, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX);
78+
/* 以中断接收及轮询发送方式打开串口设备 */
79+
rt_device_open(serial, RT_DEVICE_FLAG_INT_RX);
8080
/* 设置接收回调函数 */
8181
rt_device_set_rx_indicate(serial, uart_input);
8282
/* 发送字符串 */

0 commit comments

Comments
 (0)