-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[bsp][gd32]:add gd32vw533xx pwm support #11155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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']): | ||
| src += ['drv_pwm.c'] | ||
|
Comment on lines
+48
to
+50
|
||
|
|
||
| path = [cwd] | ||
|
|
||
| group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) | ||
|
|
||
There was a problem hiding this comment.
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:
SConscriptcurrently addsdrv_pwm.cwhenRT_USING_PWMis enabled, but the driver’s pin/device tables are only populated underBSP_USING_PWM0/1/2/15/16. IfRT_USING_PWMis enabled (e.g., manually) without selecting anyBSP_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 onBSP_USING_PWM(or at least oneBSP_USING_PWMx) and/or add a#errorlike 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)强制至少选择一个实例。