aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-09-13 13:14:03 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-09-13 13:14:03 +0000
commit577d33e5301ad23a3ef46811fcb20218d81e8f0e (patch)
treed4db0e0e9d40c36cd53589dce9853005634c58dd /os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c
parentf676b7cb31b22941bb5e3417e3d38051970e7e10 (diff)
downloadChibiOS-577d33e5301ad23a3ef46811fcb20218d81e8f0e.tar.gz
ChibiOS-577d33e5301ad23a3ef46811fcb20218d81e8f0e.tar.bz2
ChibiOS-577d33e5301ad23a3ef46811fcb20218d81e8f0e.zip
Fixed bug #775.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9765 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c')
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c b/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c
index e34535b99..3e917e27a 100644
--- a/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c
@@ -863,6 +863,7 @@ void gpt_lld_polled_delay(GPTDriver *gptp, gptcnt_t interval) {
gptp->tim->ARR = (uint32_t)(interval - 1); /* Time constant. */
gptp->tim->EGR = STM32_TIM_EGR_UG; /* Update event. */
+ gptp->tim->SR = 0; /* Clear pending IRQs. */
gptp->tim->CR1 = STM32_TIM_CR1_OPM | STM32_TIM_CR1_URS | STM32_TIM_CR1_CEN;
while (!(gptp->tim->SR & STM32_TIM_SR_UIF))
;