Skip to content

Commit 21dbd09

Browse files
NagaHimanshubuha
authored andcommitted
drivers:stm32:pwm: Add PWM Stop IT when irq id is used
Signed-off-by: Naga Himanshu Indraganti <naga.indraganti@analog.com>
1 parent 42dfdcc commit 21dbd09

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/platform/stm32/stm32_pwm.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -987,10 +987,17 @@ int32_t stm32_pwm_disable(struct no_os_pwm_desc *desc)
987987
if (sparam->dma_enable)
988988
__HAL_TIM_DISABLE_DMA(htimer, timer_map[sparam->timer_chn]);
989989

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+
}
9941001

9951002
if (ret != HAL_OK) {
9961003
return -EIO;

0 commit comments

Comments
 (0)