[bsp/Infineon] Fix PWM macro mismatches left by the CHx_PORTy rename - #11802
mengxinyuan638 wants to merge 1 commit into
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
|
e5382cb#diff-52bb1c0931033bbf40d9eca0fb13bb8df29611d8d594855039b3e676e948f7c4 |
Commit e5382cb renamed the PWM table guards in drv_pwm.c to the CHx_PORTy convention but only adapted the psoc6-evk Kconfig, leaving several mismatches behind: - The psoc6-evaluationkit-062S2 slider sample still tested the old flat name BSP_USING_PWM0_PORT0 while the board Kconfig defines BSP_USING_PWM0_CH0_PORT0, so the PWM init was compiled out. - The PORT13 entry was renamed to BSP_USING_PWM0_CH7_PORT13, a macro that no Kconfig defines, and the channel is wrong anyway: PWM0_CH3_PORT13_CONFIG carries .channel = 3, PORT13 sits under the PWM0 CH3 menu, and the slider demo selects CH3 + PORT13. - The PSOC62 template and five psoc6 boards (cy8ckit-062-BLE, cy8ckit-062-WIFI-BT, cy8ckit-062S2-43012, cy8ckit-062s4, cy8cproto-062S3-4343W) still define the old flat names. Fix all of them by migrating the evaluationkit sample to BSP_USING_PWM0_CH0_PORT0 and renaming the PORT13 group to BSP_USING_PWM0_CH3_PORT13 across drv_pwm.c, the PSOC62 template and the five boards' Kconfigs/slider samples, so Kconfig, driver table and samples match again. Note: the sibling guards BSP_USING_PWM0_CH7_PORT2/5/7/9/10/12 are still not generated by these boards' Kconfigs; left untouched for a separate discussion.
c1ea875 to
4cef957
Compare
拉取/合并请求描述:(PR description)为什么提交这份PR (why to submit this PR)Commit e5382cb 将 drv_pwm.c 中 PWM 配置表的宏重命名为 CHx_PORTy 规范,但只适配了
以上任一情况都会导致使能相应 PWM 通道或 slider demo 后无法正常找到/配置 pwm 设备。 你的解决方案是什么 (what is your solution)将 evaluationkit 的 slider_sample.c 迁移到 说明: 请提供验证的bsp和config (provide the config and bsp)
当前拉取/合并请求的状态 Intent for your PR必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
|
拉取/合并请求描述:(PR description)
为什么提交这份PR (why to submit this PR)
bsp/Infineon/psoc6-evaluationkit-062S2/board/ports/slider_sample.c 中,PWM 初始化代码的
条件编译宏写成了
BSP_USING_PWM0_PORT0,但该宏在整个仓库中并不存在。板级 Kconfig 实际定义的是
BSP_USING_PWM0_CH0_PORT0("Enable PWM0-CH0-PORT0 output pwm"),且启用slider 示例(BSP_USING_SLIDER_SAMPLE)时会自动选中它。由于宏名不匹配,PWM 初始化代码
整段被编译掉,slider 示例始终找不到 PWM 设备。
你的解决方案是什么 (what is your solution)
将 slider_sample.c 中的
BSP_USING_PWM0_PORT0替换为正确的宏名BSP_USING_PWM0_CH0_PORT0,使 slider 示例使能时能正常初始化并查找到 PWM 设备。
请提供验证的bsp和config (provide the config and bsp)
BSP: bsp/Infineon/psoc6-evaluationkit-062S2
.config: CONFIG_BSP_USING_SLIDER=y,CONFIG_BSP_USING_SLIDER_SAMPLE=y
(BSP_USING_SLIDER_SAMPLE 会自动选中 BSP_USING_PWM / BSP_USING_PWM0 / BSP_USING_PWM0_CH0 / BSP_USING_PWM0_CH0_PORT0)
action: https://github.com/mengxinyuan638/rt-thread/actions/runs/34977091405
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up