From 6f08d653f6359af9583415fe8ac175dfe5170123 Mon Sep 17 00:00:00 2001
From: gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>
Date: Tue, 22 Apr 2014 08:53:13 +0000
Subject: Fixed bug #486.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6874 35acf78f-673a-0410-8e92-d51de3d6d3f4
---
 os/hal/platforms/STM32/TIMv1/icu_lld.c | 2 +-
 os/hal/platforms/STM32/TIMv1/pwm_lld.c | 2 +-
 readme.txt                             | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/os/hal/platforms/STM32/TIMv1/icu_lld.c b/os/hal/platforms/STM32/TIMv1/icu_lld.c
index 0b1013a23..ded4f806c 100644
--- a/os/hal/platforms/STM32/TIMv1/icu_lld.c
+++ b/os/hal/platforms/STM32/TIMv1/icu_lld.c
@@ -469,7 +469,7 @@ void icu_lld_start(ICUDriver *icup) {
       rccResetTIM9();
       nvicEnableVector(STM32_TIM9_NUMBER,
                        CORTEX_PRIORITY_MASK(STM32_ICU_TIM9_IRQ_PRIORITY));
-      icup->clock = STM32_TIMCLK1;
+      icup->clock = STM32_TIMCLK2;
     }
 #endif
   }
diff --git a/os/hal/platforms/STM32/TIMv1/pwm_lld.c b/os/hal/platforms/STM32/TIMv1/pwm_lld.c
index 37ed835f5..1968ffcfb 100644
--- a/os/hal/platforms/STM32/TIMv1/pwm_lld.c
+++ b/os/hal/platforms/STM32/TIMv1/pwm_lld.c
@@ -475,7 +475,7 @@ void pwm_lld_start(PWMDriver *pwmp) {
       rccResetTIM9();
       nvicEnableVector(STM32_TIM9_NUMBER,
                        CORTEX_PRIORITY_MASK(STM32_PWM_TIM9_IRQ_PRIORITY));
-      pwmp->clock = STM32_TIMCLK1;
+      pwmp->clock = STM32_TIMCLK2;
     }
 #endif
 
diff --git a/readme.txt b/readme.txt
index 448031888..e486f007f 100644
--- a/readme.txt
+++ b/readme.txt
@@ -89,6 +89,8 @@
 *****************************************************************************
 
 *** 2.7.0 ***
+- FIX: Fixed wrong STM32 TIM9 clock source in PWM and ICU drivers (bug #486)
+  (backported to 2.6.4).
 - FIX: Fixed MMC_SPI driver block_addresses is not initialized after
   reconnection (bug #485)(backported to 2.6.4).
 - FIX: Fixed STM32L1 Plus Compilation Problems (bug #484)(backported to 2.6.4).
-- 
cgit v1.2.3