From 0bf0705e3357e72047f08ae2fe047ca5a3abfdd7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Jul 2011 16:32:03 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3175 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/pwm_lld.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'os/hal/platforms/STM32/pwm_lld.c') diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index 85cef0553..efe215458 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -519,10 +519,12 @@ void pwm_lld_start(PWMDriver *pwmp) { pwmp->tim->EGR = TIM_EGR_UG; /* Update event. */ pwmp->tim->DIER = pwmp->config->callback == NULL ? 0 : TIM_DIER_UIE; pwmp->tim->SR = 0; /* Clear pending IRQs. */ +#if STM32_PWM_USE_TIM1 || STM32_PWM_USE_TIM8 #if STM32_PWM_USE_ADVANCED pwmp->tim->BDTR = pwmp->config->bdtr | TIM_BDTR_MOE; #else pwmp->tim->BDTR = TIM_BDTR_MOE; +#endif #endif /* Timer configured and started.*/ pwmp->tim->CR1 = TIM_CR1_ARPE | TIM_CR1_URS | TIM_CR1_CEN; @@ -542,7 +544,9 @@ void pwm_lld_stop(PWMDriver *pwmp) { pwmp->tim->CR1 = 0; /* Timer disabled. */ pwmp->tim->DIER = 0; /* All IRQs disabled. */ pwmp->tim->SR = 0; /* Clear eventual pending IRQs. */ +#if STM32_PWM_USE_TIM1 || STM32_PWM_USE_TIM8 pwmp->tim->BDTR = 0; +#endif #if STM32_PWM_USE_TIM1 if (&PWMD1 == pwmp) { -- cgit v1.2.3