提交 aaf1abf2 编写于 作者: 哈哈哈可是开电脑's avatar 哈哈哈可是开电脑 提交者: mysterywolf

[fix][stm32]修复输出高电平异常的问题

上级 dea34be0
...@@ -278,9 +278,10 @@ static rt_err_t drv_pwm_set(TIM_HandleTypeDef *htim, struct rt_pwm_configuration ...@@ -278,9 +278,10 @@ static rt_err_t drv_pwm_set(TIM_HandleTypeDef *htim, struct rt_pwm_configuration
{ {
pulse = MIN_PULSE; pulse = MIN_PULSE;
} }
else if (pulse > period) /*To determine user input, output high level is required*/
else if (pulse >= period)
{ {
pulse = period; pulse = period + 1;
} }
__HAL_TIM_SET_COMPARE(htim, channel, pulse - 1); __HAL_TIM_SET_COMPARE(htim, channel, pulse - 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册