-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
提交stm32 bsp drv_pwm.c里面的一个小建议 #6517
Conversation
channel = 0x04 * (device->channel - 1) |
源文件的 |
嗯,感觉应该没啥问题 |
建议在pwm_config.h里面加点注释,说明下那个结构体的几个成员该如何设置值,合法范围是多少。 |
给stm32f4的pwm_config.h添加几句注释说明参数取值范围。
嗯嗯 可以增加注释 说实话 我都不知道那个channel成员变量是干啥的 看都设置为0 我也没管它 ,但是需要注意下 rt-thread的注释是用/**/ 而不是// |
更改注释方式,从//改为/**/
其它系列的pwm通道数,不是全都了解各有多少个,现在不确定是否都是每个定时器只有4个通道, 其它系列的pwm_config.h也需要改一改才行,我找个时间改改看,先不忙合并吧。 |
https://github.com/mysterywolf/formatting 可以用这个脚本扫描一下 |
如果PR 已经准备好 请告知 |
细节调整
This reverts commit a4eb5a5.
This reverts commit a4eb5a5.
This reverts commit a4eb5a5.
拉取/合并请求描述:(PR description)
[
在使用stm32的pwm驱动时,发现其初始化channel的时候是根据device->channel这个值去初始化的,device->channel这个值是在pwm_configh.h里面定义设置的,又根据rtt的pwm例程,和常规习惯,应该大多数人会更喜欢设置channel=1/2/3/4,而不是在pwm_configh.h中将channel设置为TIM_CHANNEL_1/2/3/4,因此建议drv_pwm.c做出PR中的修改。
在实际开发中,因pwm_configh.h的示例均是.channel=0,又没有做出解释说明要让.channel=TIM_CHANNEL_1/2/3/4的值,容易误操作导致没有成功输出PWM,这是我在实际开发中遇到的现实问题,因而提出此建议。
]
以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.
当前拉取/合并请求的状态 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