| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Hold the bus mutex while dispatching control commands and changing max_hz. Use a common unlock path and propagate mutex errors as in rt_i2c_transfer. Document the thread-context requirement. Fixes RT-Thread#11524
Sorry, something went wrong.
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_driver_i2cReviewers: @wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-09-22 18:48 CST)
📝 Review Instructions
|
Sorry, something went wrong.
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 fix/i2c-control-lock 分支,关联的 Pull Request 也会同步更新。 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
拉取/合并请求描述:(PR description)
rt_i2c_control() can change the controller configuration while rt_i2c_transfer() is using the bus. Take the same bus mutex around control commands, including SET_MAX_HZ, and release it through a common exit path. Error handling follows rt_i2c_transfer(); the API documentation now states that control requires thread context.
Fixes #11524.
Validation
GCC 16.1 compiled the complete I2C core and device wrapper against repository headers. Host tests with a pthread mutex adapter pass concurrent transfer/control combinations, control/control, max_hz updates, lock and callback errors, and a nested control-to-transfer call. The unpatched source fails the regression suite.
Configuration: RT_USING_I2C, RT_USING_DEVICE_OPS, RT_USING_MUTEX and RT_USING_SEMAPHORE. Changed-line clang-format and git diff --check pass. No target BSP, QEMU or I2C hardware test was run; the host adapter does not test RT-Thread priority inheritance.
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following: