下图为串口接收处理接口和串口初始化,为什么总是在第一个字节丢,后面多了一个字节,是实际最后一个字节填充的
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你尝试一下
把sem_wait(&sem);
移动到UART2_read()函数之后,
这样可以确保读取每个字节之前,等待回调完成数据写入操作
我继续查一下其他函数使用
https://downloads.ti.com/mctools/esd/docs/opencl/debug/debug_printf.html
debug_printf()可以看一下这个
这里的Debug_printf是自己封装的,本质上是调用uart2_write接口