From 577d33e5301ad23a3ef46811fcb20218d81e8f0e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 13 Sep 2016 13:14:03 +0000 Subject: [PATCH] Fixed bug #775. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9765 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c | 1 + readme.txt | 2 ++ 2 files changed, 3 insertions(+) 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)) ; diff --git a/readme.txt b/readme.txt index 9303fa888..68181af0c 100644 --- a/readme.txt +++ b/readme.txt @@ -126,6 +126,8 @@ - RT: Merged RT4. - NIL: Merged NIL2. - NIL: Added STM32F7 demo. +- HAL: Fixed function gpt_lld_polled_delay() is broken on STM32 (bug #775) + (backported to 16.1.6, 3.0.6). - HAL: Fixed invalid output initialization for STM32 DACx channels 2 (bug #773)(backported to 16.1.6). - HAL: Fixed CAN inclusion path missing for STM32F107 (bug #772)(backported