-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[drivers][serial_v2]允许阻塞接收超过rx缓冲区大小的数据、增加超时时间、flush、获取缓冲区数据长度命令、数据溢出逻… #9389
base: master
Are you sure you want to change the base?
Conversation
…辑修复、稳定性细节优化、添加更多serial_v2测试用例
@Ryan-CW-Code 感谢PR,但CI的代码格式化检查没有通过,麻烦使用工具:https://github.com/mysterywolf/formatting 格式化下再提交下~ |
utest和at_socket都使用dma和int方式分别进行测试。 大家可以再测试测试,看看有什么问题是没发现的
|
at_client我们配合at_socket用了快一个月。 |
已在瑞萨RA8开发板测试,没问题 |
|
||
前四个测试用例的测试思路: | ||
默认测试串口为`**uart2**`请根据需要修改宏定义 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这块的格式不正确,不需要加上``
/* Reinitialize */ | ||
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; | ||
config.baud_rate = BAUD_RATE_115200; | ||
config.rx_bufsz = BSP_UART2_RX_BUFSIZE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试用例里面直接这么定义BSP_UART2_RX_BUFSIZE的宏是不是不太好,搞成menuconfig里面配置的宏吧,要不然板子没有串口2,还要改源码
components/net/at/src/at_client.c
Outdated
result = rt_device_read(client->device, 0, ch, 1); | ||
if(result <= 0) | ||
{ | ||
result = RT_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这块是不是应该返回错误了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
错误码应该返回负值 -RT_ERROR
现在驱动中关于ringbuff使用了大量的关中断,看了下ringbuff源码。 或许也可以把 |
这块内容要不下次在社区例会讨论下? |
可以呀,你们来主导就行,驱动规范这方面你们来主导最好。 |
留个联系方式?下次开会拉上你~ |
|
…辑修复、稳定性细节优化、添加更多serial_v2测试用例
当前只在STM32平台测试过,别的平台只是将
rt_ringbuffer_putchar
替换为rt_ringbuffer_putchar_force
理论上不会出问题,可以再检查一下拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
优化serial_v2驱动
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
STM32F407-lckfb-skystar进行utest、echo等测试
STM32F401RCT6进行at_socket测试
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up