-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
建议添加异步发送数据功能 #16
Comments
|
主要感觉这个功能放在串口设备层去实现会更加通用一些,当时设计 RBB 最早也是考虑到了 DMA 发送的需求。 |
是呢,最初接触到RTT也发现这个问题,串口驱动层对DMA发送的处理逻辑对应用层不是特别友好,尤其是新手,可能会直接使用 |
文档中说明建议不要打开
RT_DEVICE_FLAG_DMA_TX
,现实情况是一定不能打开该标志。原因是RTT串口发送时,是直接将数据地址传送给DMA(在打开DMA时并且开启RT_DEVICE_FLAG_DMA_TX),这样在DMA发送数据时,一定不能修改传给serial层的数据,如果是动态分配的内存更不能释放该内存,否则会导致发送数据出错或者崩溃。但是,某些情况下,需要开启DMA以节省CPU资源,这时需要ppp_device能够保证数据不出错而且还能异步(DMA)发送,这就需要简单实现一下异步发送的功能。我简单写了一个串口异步发送数据的示例,你看是否可行或者是否有必要:
The text was updated successfully, but these errors were encountered: