Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

I2C bus mutex name exceeded the default RT_NAME_MAX (12), causing assertion failures on registration.

  • I2C mutex name: Shortened mutex registration string from i2c_bus_lock to i2c_lock to fit RT_NAME_MAX without requiring configuration changes.
/* before */
rt_mutex_init(&bus->lock, "i2c_bus_lock", RT_IPC_FLAG_PRIO);

/* after */
rt_mutex_init(&bus->lock, "i2c_lock", RT_IPC_FLAG_PRIO);
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug] I2C mutex 注册名长度超出 RT_NAME_MAX 默认值</issue_title>
<issue_description>### RT-Thread Version

5.2.2

Hardware Type/Architectures

apm32f103vb-miniboard

Develop Toolchain

GCC

Describe the bug

I2C 的 mutex 注册名为 "i2c_bus_lock",包含结束符的长度为 13 字节,而 RT_NAME_MAX 的默认值是 12,在不修改 RT_NAME_MAX 的情况下,会导致断言失败。

rt_mutex_init(&bus->lock, "i2c_bus_lock", RT_IPC_FLAG_PRIO);

Other additional context

No response</issue_description>

<agent_instructions>改名成 i2c_lock</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: BernardXiong <1241087+BernardXiong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix I2C mutex registration name length issue [drivers][i2c] Rename I2C mutex within RT_NAME_MAX Feb 2, 2026
Copilot AI requested a review from BernardXiong February 2, 2026 09:46
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

📌 Code Review Assignment

🏷️ Tag: components

Reviewers: @Maihuanyi

Changed Files (Click to expand)
  • components/drivers/i2c/dev_i2c_core.c

🏷️ Tag: components_driver_i2c

Reviewers: @wdfk-prog

Changed Files (Click to expand)
  • components/drivers/i2c/dev_i2c_core.c

📊 Current Review Status (Last Updated: 2026-02-02 18:38 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] I2C mutex 注册名长度超出 RT_NAME_MAX 默认值

3 participants