Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
scons.args: &scons
scons_arg:
- '--strict'

# ------ component CI ------
component.pwm:
kconfig:
- CONFIG_BSP_USING_PWM=y
- CONFIG_BSP_USING_PWM0=y
24 changes: 24 additions & 0 deletions bsp/gd32/risc-v/gd32vw553h-eval/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ menu "On-chip Peripheral Drivers"
default n
endif

menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
config BSP_USING_PWM0
bool "Enable PWM0"
default y
config BSP_USING_PWM1
bool "Enable PWM1"
default n
config BSP_USING_PWM2
bool "Enable PWM2"
default n
config BSP_USING_PWM15
bool "Enable PWM15"
default n
config BSP_USING_PWM16
bool "Enable PWM16"
default n
endif



source "$(BSP_DIR)/../libraries/gd32_drivers/Kconfig"

endmenu
Expand Down
4 changes: 4 additions & 0 deletions bsp/gd32/risc-v/libraries/gd32_drivers/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ if GetDepend('RT_USING_HWTIMER'):
if GetDepend('RT_USING_ADC'):
src += ['drv_adc.c']

# add pwm drivers.
if GetDepend(['RT_USING_PWM', 'SOC_GD32VW553H']):
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

[bug/类别]: PWM driver can be built without any BSP_USING_PWMx selected / 可能在未选择任何 PWMx 时仍编译驱动

English: SConscript currently adds drv_pwm.c when RT_USING_PWM is enabled, but the driver’s pin/device tables are only populated under BSP_USING_PWM0/1/2/15/16. If RT_USING_PWM is enabled (e.g., manually) without selecting any BSP_USING_PWMx, the arrays become empty initializers (non-standard in C) and/or the driver registers 0 PWM devices at runtime. Please gate the source on BSP_USING_PWM (or at least one BSP_USING_PWMx) and/or add a #error like other PWM drivers (e.g. bsp/nuclei/.../drv_pwm.c:18-22) to enforce selecting at least one instance.
中文:当前 SConscript 在启用 RT_USING_PWM 时就会编译 drv_pwm.c,但驱动里的 pin/device 表只有在定义了 BSP_USING_PWM0/1/2/15/16 时才会生成内容。如果用户仅开启 RT_USING_PWM(例如手动开启)但未选择任何 BSP_USING_PWMx,这些数组会变成空初始化(非标准 C,可能编译失败),并且运行时也可能注册 0 个 PWM 设备。建议在构建条件中增加 BSP_USING_PWM(或至少一个 BSP_USING_PWMx),并/或像其他 PWM 驱动一样增加 #error(参考 bsp/nuclei/.../drv_pwm.c:18-22)强制至少选择一个实例。

Suggested change
if GetDepend(['RT_USING_PWM', 'SOC_GD32VW553H']):
if GetDepend(['RT_USING_PWM', 'SOC_GD32VW553H']) and \
(GetDepend('BSP_USING_PWM0') or GetDepend('BSP_USING_PWM1') or \
GetDepend('BSP_USING_PWM2') or GetDepend('BSP_USING_PWM15') or \
GetDepend('BSP_USING_PWM16')):

Copilot uses AI. Check for mistakes.
src += ['drv_pwm.c']
Comment on lines +48 to +50
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

[discrepancy_with_pr_description/类别]: PR metadata incomplete/mismatched / PR 元信息不完整或不匹配

English: The PR description still contains the template placeholder block (the square-bracketed section) and does not clearly state What/Why/How or tested BSP/config as required. Also the PR title mentions "gd32vw533xx", but the code changes target gd32vw553h (e.g. SOC_GD32VW553H). Please update the PR title/description to match the actual SoC/BSP and include the required verification details.
中文:PR 描述仍包含模板占位的方括号内容,且未按要求补充 What/Why/How 以及已验证的 BSP/.config/测试信息。另外标题写的是“gd32vw533xx”,但本次修改实际针对的是 gd32vw553h(例如 SOC_GD32VW553H)。请更新 PR 标题/描述以匹配实际 SoC/BSP,并补充必要的验证信息。

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +50
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

[discrepancy_with_pr_description/类别]: PR title format/prefix should be adjusted / PR 标题前缀格式建议调整

English: PR title currently uses a colon ([bsp][gd32]:...) and mentions gd32vw533xx. RT-Thread PR titles are expected to follow the lowercase prefix format [module][subsystem] Description without punctuation in the prefix. Based on the modified files, a more accurate title would be like: [bsp][gd32] Add PWM support for gd32vw553h.
中文:当前 PR 标题使用了冒号([bsp][gd32]:...)且包含 gd32vw533xx。RT-Thread 通常要求标题使用小写前缀格式 [模块][子系统] 描述,前缀后不加标点。结合本次修改文件,更准确的标题建议类似:[bsp][gd32] Add PWM support for gd32vw553h

Copilot uses AI. Check for mistakes.

path = [cwd]

group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Expand Down
Loading
Loading