From 4b23cb4850aa8f7b8a2823d053dd9369f90c8a9e Mon Sep 17 00:00:00 2001 From: Amir Hammad Date: Wed, 15 Apr 2015 20:26:09 +0200 Subject: demo: timer: BUGFIX: TIM6 prescaler TIM6 has clock running at 84MHz instead of 168MHz, so set the prescaler accordingly. Signed-off-by: Amir Hammad --- src/demo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/demo.c b/src/demo.c index d1f2d84..d4368c9 100644 --- a/src/demo.c +++ b/src/demo.c @@ -72,7 +72,7 @@ static void clock_setup(void) static void tim6_setup(void) { timer_reset(TIM6); - timer_set_prescaler(TIM6, 16800 - 1); // 168Mhz/10000hz - 1 + timer_set_prescaler(TIM6, 8400 - 1); // 84Mhz/10kHz - 1 timer_set_period(TIM6, 65535); // Overflow in ~6.5 seconds timer_enable_counter(TIM6); } -- cgit