File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -987,10 +987,17 @@ int32_t stm32_pwm_disable(struct no_os_pwm_desc *desc)
987
987
if (sparam -> dma_enable )
988
988
__HAL_TIM_DISABLE_DMA (htimer , timer_map [sparam -> timer_chn ]);
989
989
990
- if (sparam -> complementary_channel )
991
- ret = HAL_TIMEx_PWMN_Stop (htimer , chn_num );
992
- else
993
- ret = HAL_TIM_PWM_Stop (htimer , chn_num );
990
+ if (desc -> irq_id ) {
991
+ if (sparam -> complementary_channel )
992
+ ret = HAL_TIMEx_PWMN_Stop_IT (htimer , chn_num );
993
+ else
994
+ ret = HAL_TIM_PWM_Stop_IT (htimer , chn_num );
995
+ } else {
996
+ if (sparam -> complementary_channel )
997
+ ret = HAL_TIMEx_PWMN_Stop (htimer , chn_num );
998
+ else
999
+ ret = HAL_TIM_PWM_Stop (htimer , chn_num );
1000
+ }
994
1001
995
1002
if (ret != HAL_OK ) {
996
1003
return - EIO ;
You can’t perform that action at this time.
0 commit comments