Skip to content

Conversation

@RCSN
Copy link
Contributor

@RCSN RCSN commented Dec 29, 2025

…iguration

将 SPI 位操作重构为独立配置选项

  • 添加 RT_USING_SPI_BITOPS 作为独立可配置选项
  • 使 RT_USING_SOFT_SPI 依赖于 RT_USING_SPI_BITOPS
  • 调整 SConscript 中的构建顺序以确保正确编译
  • 修正 dev_soft_spi.c 中的错误提示信息

拉取/合并请求描述:(PR description)

并确认并列出已经在什么情况或板卡上进行了测试。
And confirm in which case or board has been tested. -->

HPM6800EVK

为什么提交这份PR (why to submit this PR)

当用户只需要RT_USING_SPI_BITOPS时,想自己弄一个drv_soft_spi,但是会强加进来dev_soft_spi,导致有两份soft spi。

你的解决方案是什么 (what is your solution)

1、RT_USING_SPI_BITOPS 作为独立可配置选项
2、保留原先配置不动,当使能RT_USING_SOFT_SPI 会使能RT_USING_SPI_BITOPS

Copilot AI review requested due to automatic review settings December 29, 2025 06:26
@github-actions
Copy link

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:bugfix/spi_bitops_config_refactor
  • 设置PR number为 \ Set the PR number to:11102
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 bugfix/spi_bitops_config_refactor 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the bugfix/spi_bitops_config_refactor branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions
Copy link

github-actions bot commented Dec 29, 2025

📌 Code Review Assignment

🏷️ Tag: components

Reviewers: Maihuanyi

Changed Files (Click to expand)
  • components/drivers/spi/Kconfig
  • components/drivers/spi/SConscript
  • components/drivers/spi/dev_soft_spi.c

🏷️ Tag: components_driver_spi

Reviewers: Liang1795 wdfk-prog

Changed Files (Click to expand)
  • components/drivers/spi/Kconfig
  • components/drivers/spi/SConscript
  • components/drivers/spi/dev_soft_spi.c

📊 Current Review Status (Last Updated: 2025-12-29 14:35 CST)

  • Liang1795 Pending Review
  • Maihuanyi Pending Review
  • wdfk-prog Pending Review

📝 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.

@RCSN RCSN force-pushed the bugfix/spi_bitops_config_refactor branch from 2980689 to 8e0c6f3 Compare December 29, 2025 06:29
Copy link
Contributor

Copilot AI left a 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 refactors the SPI bit-bang operations into an independent configuration option to provide better modularity. Previously, users who only wanted the bit operations (RT_USING_SPI_BITOPS) were forced to include the full soft SPI implementation (dev_soft_spi.c), causing conflicts when implementing custom SPI drivers.

Key Changes:

  • Introduced RT_USING_SPI_BITOPS as an independent configuration option for bit-bang operation functions
  • Made RT_USING_SOFT_SPI depend on RT_USING_SPI_BITOPS through a select statement to maintain backward compatibility
  • Reorganized build script to compile dev_spi_bit_ops.c independently from dev_soft_spi.c

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
components/drivers/spi/Kconfig Added new RT_USING_SPI_BITOPS configuration option with dependencies
components/drivers/spi/SConscript Separated build conditions for bit operations and soft SPI implementation
components/drivers/spi/dev_soft_spi.c Fixed error message to reference correct menuconfig path (SPI instead of I2C)

Comment on lines 11 to 13
config RT_USING_SPI_BITOPS
bool "Use Software SPI bit-bang operations"
default n
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title should follow RT-Thread format with lowercase prefix: [module][subsystem] Description. The current title uses [fix] drivers: spi: format which doesn't match the standard.

Suggested title format: [spi] Refactor SPI bit operations into independent configuration option or [drivers][spi] Refactor SPI bit operations into independent configuration option

PR 标题应遵循 RT-Thread 格式,使用小写前缀:[模块][子系统] 描述。当前标题使用 [fix] drivers: spi: 格式,不符合标准。

建议标题格式:[spi] Refactor SPI bit operations into independent configuration option[drivers][spi] Refactor SPI bit operations into independent configuration option

Copilot generated this review using guidance from repository custom instructions.
…iguration

- Add RT_USING_SPI_BITOPS as a separate configurable option
- Make RT_USING_SOFT_SPI depend on RT_USING_SPI_BITOPS
- Adjust build order in SConscript for proper com

Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
@RCSN RCSN force-pushed the bugfix/spi_bitops_config_refactor branch from 8e0c6f3 to a10ecee Compare December 29, 2025 06:35
Copy link
Contributor

@wdfk-prog wdfk-prog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

2 participants