Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
Summary
Add strict local TX wire ordering on top of PR #8.
The generic CAN framework now defaults to at most one hardware-pending TX request at a time. This prevents a later request from being preloaded into another controller mailbox and overtaking an earlier request because of controller-specific mailbox/identifier priority.
Drivers that can prove ordered transmission with multiple hardware mailboxes may opt into:
RT_CAN_CAP_TX_ORDERED_MAILBOXand retain multi-mailbox preload.
Ordering contract
For the generic fallback:
RT_CAN_CAP_TX_ORDERED_MAILBOX, the next request is submitted only after the previous hardware-owned request reaches a terminal event.This addresses the class of ordering problems discussed in RT-Thread issue/PR RT-Thread#11270 while keeping the hardware capability explicit.
Compatibility
The capability is queried through
control(RT_CAN_CMD_GET_CAPABILITIES, ...). Existing BSPs that do not implement the command naturally fall back to strict single-pending ordering and require no ISR call-site changes.Tests
The fake-controller test exposes three mailboxes and submits CAN IDs in the order
0x700 -> 0x100 -> 0x300. With no ordered-mailbox capability, the test verifies that only one request is submitted to hardware at a time and the same application order is preserved across TX_DONE events.No target-board/hardware validation has been performed in this PR.
Stack
PR 4/7. Base: PR #8 (
refactor/can-tx-terminal-timeout).