aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/pwm_lld.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-09 10:15:25 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-09 10:15:25 +0000
commit1bcc0f1dc26c3358ca0c17f0b52e8b44dbc89d42 (patch)
treeba16188b80e3ed6bceac77805ff42349987a55d4 /os/hal/platforms/STM32/pwm_lld.c
parent0752e9d7e973161c32e4b667c7a8d06c68b0a9eb (diff)
downloadChibiOS-1bcc0f1dc26c3358ca0c17f0b52e8b44dbc89d42.tar.gz
ChibiOS-1bcc0f1dc26c3358ca0c17f0b52e8b44dbc89d42.tar.bz2
ChibiOS-1bcc0f1dc26c3358ca0c17f0b52e8b44dbc89d42.zip
I2C. Syncing with trunk (step 2)
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3216 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/pwm_lld.c')
-rw-r--r--os/hal/platforms/STM32/pwm_lld.c4
1 files changed, 4 insertions, 0 deletions
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,11 +519,13 @@ 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) {