Repository navigation
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
|
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 |
Summary
Add explicit TX lifecycle operations on top of PR #9.
This layer introduces:
QUIESCING/QUIESCEDTX lifecycle transitions;DRAIN,DROP_QUEUED, andABORT_ALLpolicies;RT_CAN_CAP_TX_ABORTcapability;RT_CAN_CMD_ABORT_TX;RT_CAN_CMD_FLUSH_TX;Quiesce semantics
New TX admission is rejected as soon as lifecycle enters
QUIESCING.DRAIN: already accepted queued requests continue through the normal scheduler until TX becomes idle.DROP_QUEUED: software-queued requests are cancelled; hardware-owned requests are allowed to terminate normally.ABORT_ALL: software-queued requests are cancelled and hardware-owned requests are moved toABORTING, then the driver is asked to abort each mailbox.A successful hardware abort request is not treated as terminal by itself. The request remains owned until the driver reports the mailbox terminal event, preserving exactly-once retirement in abort/TX_DONE races.
Full flush
RT_CAN_CMD_FLUSH_TXmaps toRT_CAN_QUIESCE_ABORT_ALL. It returns only after the TX engine reachesQUIESCED, or returns timeout if hardware-owned work cannot be retired.Runtime bitrate
RT_CAN_CMD_SET_BAUDis performed from a quiesced TX boundary and resumes admission after a successful driver reconfiguration.Compatibility
rt_hw_can_isr()calls remain unchanged.Tests
The fake-controller test covers an ABORT_ALL quiesce with one hardware-owned request and one software-queued request, synchronous abort completion, transition to QUIESCED, and explicit resume.
No target-board/hardware validation has been performed in this PR.
Stack
PR 5/7. Base: PR #9 (
refactor/can-strict-tx-order).