-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Update drv_pwm.c #3607
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
Update drv_pwm.c #3607
Conversation
修复在STM32F103C8TX下,PWM 无法正常输出波形。
| tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; | ||
| #endif | ||
|
|
||
| #if defined(SOC_STM32F103C8TX) |
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.
感谢贡献代码,对于本次提交,我有如下两点建议:
首先,我们一般不会对某一个指定型号的芯片来修改驱动代码,一般是对应于某个系列,比如 F1 系列,由于 HAL 的兼容性,这样做是没有问题的。
第二点,你可以参考一下这个 ISSUE,然后检查一下本次修改是否也会造成同样的问题。
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.
同样的,可以参考该 PR ,检查是否会造成同样的问题。
SummerGift
left a comment
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.
请根据建议完善相关提交代码 🔎
|
@summerlife 我看了之前我修改的PR,这里主要是因为CubeMX的兼容性导致的差异,我在L4上生成出来的有独立的PWM初始化接口HAL_TIM_PWM_MspInit,但是在F2上又没有生成。 |
|
@summerlife 慎重考虑下这份PR,貌似确实存在这样的情况,如果这份PR确实时间久了推动不下去,请自行fix然后发出PR出来。 |
我尝试了一下,只要在 CubeMX 中为 Timer 设置了 Clock Source,那么就不会生成独立的 |
|
在一个pr里讨论吧: #5241 |
修复在STM32F103C8TX下,PWM 无法正常输出波形。
拉取/合并请求描述:(PR description)
[
在STM32F103C8T芯片上,使用PWM无法正常输出,在drv_pwm_.c 的stm32_hw_pwm_init函数内增加HAL_TIM_Base_Init即可正常输出PWM信号,在STM32F103C8T6核心板上验证成功。
]
以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use 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