-
Notifications
You must be signed in to change notification settings - Fork 5.3k
feat(can): 实现非阻塞发送机制并增强CAN驱动功能 #10712
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
Conversation
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: @Liang1795 @hamburger-os @wdfk-prog Changed Files (Click to expand)
🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_driver_canReviewers: @wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-09-20 15:03 CST)
📝 Review Instructions
|
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.
Pull Request Overview
This PR implements a non-blocking send mechanism for the RT-Thread CAN driver framework, enhancing the existing blocking-only transmission capabilities. The implementation adds support for ISR-safe message transmission through software ring buffers and dynamic memory allocation options.
- Added non-blocking CAN message transmission with software ring buffer management
- Enhanced API documentation and example code with bilingual (English/Chinese) comments
- Introduced new configuration options for buffer sizing and memory allocation strategies
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.
File | Description |
---|---|
components/drivers/include/drivers/dev_can.h | Added non-blocking flag to rt_can_msg struct, new ring buffer fields to device struct, and comprehensive API documentation |
components/drivers/can/dev_can.c | Implemented core non-blocking transmission logic, enhanced error handling, and added ISR-safe buffer management |
components/drivers/can/Kconfig | Added configuration options for non-blocking buffer size and dynamic allocation |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_can.c | Implemented STM32-specific non-blocking send function and updated ops structure |
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: Liang1795 hamburger-os wdfk-prog Changed Files (Click to expand)
🏷️ Tag: componentsReviewers: Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_driver_canReviewers: wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-09-27 09:42 CST)
📝 Review Instructions
|
d1c21da
to
0c568ff
Compare
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.
目前我使用can的大部分场景都是非阻塞发送 支持作者
不过 我在想以下两种情况哪个更好一点
- 在设备打开的时候就选择阻塞或者非阻塞
- 作者目前的想法:发送can消息设置标志位
|
@unicornx 汪老师,涉及到 doxygen 部分可以帮忙review下吗? |
…er functionality - Added support for non-blocking mode CAN message sending, including software ring buffer management and dynamic memory allocation options. - Improved related comments and error handling. - Updated example code to demonstrate the usage of both blocking and non-blocking sending modes, and corrected some structure field naming and macro definitions.
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.
我只看了 doxygen 注释部分,LGTM。
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 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