Skip to content

Conversation

unicornx
Copy link
Contributor

@unicornx unicornx commented Jul 15, 2024

注意,这个 PR 包含了两个 commit,merge 时请务必保留两个 commit,不要压缩。设计为两个 commit 也是为了方便以后回溯。

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

[

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

原先的管脚复用配置机制设计不好,会导致我们在 Kconfig 中写大量 board 区分代码,导致 Kconfig 文件过大。现修改为新的配置方式。具体见 commit 的描述。

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

具体见 commit 的描述。

请提供验证的bsp和config (provide the config and bsp)

  • BSP: bsp/cvitek
  • .config: 默认
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

@unicornx unicornx changed the title Dev new pinmux [bsp/cvitek] new pinmux design Jul 15, 2024
@unicornx unicornx added BSP: Cvitek BSP related with cvitek Arch: RISC-V BSP related with risc-v labels Jul 15, 2024
@unicornx unicornx self-assigned this Jul 15, 2024
@unicornx unicornx requested review from polarvid and heyuanjie87 July 15, 2024 08:50
@unicornx
Copy link
Contributor Author

注意,这个 PR 包含了两个 commit,merge 时请务必保留两个 commit,不要压缩。设计为两个 commit 也是为了方便以后回溯。

@unicornx
Copy link
Contributor Author

fixed #8934

Copy link
Contributor

Choose a reason for hiding this comment

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

这个文件缺少版权头吧?这个应该是源文件强制的。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个文件缺少版权头吧?这个应该是源文件强制的。

accept

Comment on lines 432 to 445
/*
* @whitelist: pin name whilelist which is allowed to set. Ignore check if NULL.
* NOTE: whitelist should be a string list ended with NULL.
* RETURN:
* - RT_EOK
* - else: something wrong occurred and config is abandoned.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

建议与 src 目录代码保持一致,使用 doxygen 语法注释 API。这样也可以自动生成文档。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

建议与 src 目录代码保持一致,使用 doxygen 语法注释 API。这样也可以自动生成文档。

accept

unicornx added 2 commits July 16, 2024 11:02
The contents of the SOC type part in the Kconfig configuration
are retained, and other parts related to I2C pin multiplexing
selection have been rolled back.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Reviewed-by: Yuanjie He <943313837@qq.com>
Reviewed-by: Shell <smokewood@qq.com>
In the new design, we require the user to manually enter the
PinName (as a string) in menuconfig instead of being given
menu items to select.

The original method will lead to too many menu item-related
macros being defined in the code, causing ifdef and other
codes scatter everywhere in the driver code, which is
inconvenient to maintain.

The new design adds a pinmux driver module to manage the
multiplexing of pins. This patch provides this driver module.

P.S., the reason why users are allowed to specify pinname
in a string instead of the pin number is mainly because
the technical manual provided by the SOC manufacturer
does not have numbers for some pins, only names.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Reviewed-by: Yuanjie He <943313837@qq.com>
Reviewed-by: Shell <smokewood@qq.com>
@polarvid polarvid added +1 Agree +1 +2 Agree +2 labels Jul 16, 2024
@Rbb666 Rbb666 merged commit a63c07f into RT-Thread:master Jul 16, 2024
@unicornx unicornx deleted the dev-new-pinmux branch July 16, 2024 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: RISC-V BSP related with risc-v BSP: Cvitek BSP related with cvitek +1 Agree +1 +2 Agree +2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants