From 64431d076bc0c3415b54960a518289ec99ef9cbd Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 23 Dec 2012 09:53:42 +0000 Subject: Fixed bug 3598177. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4952 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/icu_lld.c | 3 ++- os/hal/platforms/STM32/pwm_lld.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'os') diff --git a/os/hal/platforms/STM32/icu_lld.c b/os/hal/platforms/STM32/icu_lld.c index 82fb39769..703c9dea5 100644 --- a/os/hal/platforms/STM32/icu_lld.c +++ b/os/hal/platforms/STM32/icu_lld.c @@ -103,7 +103,8 @@ ICUDriver ICUD8; static void icu_lld_serve_interrupt(ICUDriver *icup) { uint16_t sr; - sr = icup->tim->SR & icup->tim->DIER; + sr = icup->tim->SR; + sr &= icup->tim->DIER; icup->tim->SR = ~sr; if (icup->config->channel == ICU_CHANNEL_1) { if ((sr & TIM_SR_CC1IF) != 0) diff --git a/os/hal/platforms/STM32/pwm_lld.c b/os/hal/platforms/STM32/pwm_lld.c index dcd0d166f..a90c0b44a 100644 --- a/os/hal/platforms/STM32/pwm_lld.c +++ b/os/hal/platforms/STM32/pwm_lld.c @@ -104,7 +104,8 @@ PWMDriver PWMD8; static void pwm_lld_serve_interrupt(PWMDriver *pwmp) { uint16_t sr; - sr = pwmp->tim->SR & pwmp->tim->DIER; + sr = pwmp->tim->SR; + sr &= pwmp->tim->DIER; pwmp->tim->SR = ~sr; if ((sr & TIM_SR_CC1IF) != 0) pwmp->config->channels[0].callback(pwmp); -- cgit v1.2.3