-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[drv]a new serial driver - serialX #5798
Conversation
730f239
to
e55208c
Compare
components/drivers/Kconfig
Outdated
depends on RT_USING_SERIAL_V1 | ||
default 64 | ||
|
||
config RT_SERIAL_FIFO_BUFSZ | ||
int "Set SerialX FIFO buffer size" | ||
depends on RT_USING_SERIAL_X | ||
default 128 | ||
|
||
config RT_SERIAL_HARD_FIFO | ||
int "Set Hard FIFO buffer size, useful only if the chip supported" | ||
depends on RT_USING_SERIAL_X | ||
default 64 | ||
|
||
config RT_SERIAL_DMA_BUFSZ | ||
int "Set SerialX DMA buffer size" | ||
depends on RT_USING_SERIAL_X && RT_SERIAL_USING_DMA |
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.
多个config depends on RT_USING_SERIAL_X就不要用depends on了
用
if RT_USING_SERIAL_X
config xxxx
endif
的句式,更清晰
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.
嗯,是
大佬,有没有可能和V2版本融合起来啊,目前V2版本历史包袱还没那么重,应该比较容易调整的。如果再加一个版本的串口框架进来,如果我是用户,我都不知道该用哪个了😂 |
{ | ||
rt_set_errno(-RT_ERROR); | ||
return 0; | ||
} |
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_set_errno(-RT_ERROR); | |
return 0; | |
} | |
{ | |
return -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.
保持和 read write 一致的代码逻辑
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.
在设备未打开、或者底层未实现 flush 接口的情况下返回什么值?
/* set error code */ | ||
rt_set_errno(-RT_ENOSYS); | ||
|
||
return 0; |
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.
/* set error code */ | |
rt_set_errno(-RT_ENOSYS); | |
return 0; | |
return -RT_ENOSYS; |
交给使用者去选择吧。usb 协议栈那么多,总不能只留一个其它都不支持了吧,modbus 库那么多也不能只让用一个吧。 |
选择太多的话,做成软件包比较合适。 |
别做软件包了吧,这个是关键性核心功能,如果谁都不妥协的话,就先这样放着吧,先百家争鸣。经过一段时间的收敛,再最终汇总成一个新版本的串口框架。16年了,RT-Thread串口框架还是有问题,没有收敛下来,串口框架是个大问题呀。 |
支持在内置的V2上继续改进,直到能解决所有已知问题。 |
作为 RT-Thread 上游软件更多要考虑长期的兼容性和可维护性,发散、灵活、自由的组件选择交给软件包。 另外,现在串口 V2 还有什么问题? |
|
这个具体指的是什么?举个例子?
这个具体指的是什么,你期望做成什么样子?举个例子?
@Guozhanxin 这个请确认一下
这个可以加
可否举个例子? |
@armink 看论坛文章,有更详细的说明。 |
不建议分裂,这样做整体都乱掉了 |
如果框架本身没有什么重大问题,仅仅是因为结构上的问题的话,可以在下次社区会议上讨论一下,商量出一个解决方案来。直接关掉人家的pr太打击人了。可以投-1票,但是别直接关PR. |
不会通过的,上面已经写得很清楚,之前几位都是一致性的投反对票 |
请再考虑一下这份PR, 经过几个月的观察,在本PR关闭后,作者出出 @thewon86 依然在社区和论坛上致力于维护这个框架,而且反馈也很好,应该予以考虑合并进去。serial_v2是官方写的,根据目前的维护经验来说,官方维护存在一个后续维护问题。炸弹哥写的这个框架,请问后续发现这个框架有问题的时候,炸弹哥项目这么多,还能抽出时间来维护吗?从炸弹哥写完这个框架之后,这个框架就一直在没有被维护过。 反观Serialx框架,一直在作者自己的仓库中不断的维护。 https://gitee.com/thewon/serialX |
之前提到过,既然是这样,是否可以融入到v2中呢? 这个是发展的原则性问题,一些点上需要收敛,如果都是各种版本,还都合并到主干中,那么主干变成了大杂烩吗。 如果觉得v2不好,也可以是v3,当出现v3的时候,依然一样的需要考虑到所有的情况,所有BSP的情况。 |
最近刚好在项目中用到了serial_v2,也发现了一些问题,正在梳理看怎么改能适用于更多的项目并有利于后面的维护。 我的理解,V2目前还在初级阶段,只能在很小一部分BSP和其应用中测试,不说覆盖所有的场景,连大部分场景都不够。 所以我认为:serial_v2不一定只能是当前仓库中这个版本,而是下一个更好的版本。 |
开会的时候再讨论一下吧,反正这个PR不会在4.1.1中合并的。 |
拉取/合并请求描述:(PR description)
[
经过一段时间的使用,serialX 有非常优异的表现。
几个串口驱动版本的对比测试请移步论坛 https://club.rt-thread.org/ask/article/3676.html
]
以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.
当前拉取/合并请求的状态 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