summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2015-04-15 20:26:09 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2015-04-15 20:26:09 +0200
commit4b23cb4850aa8f7b8a2823d053dd9369f90c8a9e (patch)
tree1cd332476beb357d1331a9a342fdcbc0e99166a3
parent187d01e3b299465d94de2ad44437cb8e1b5afcbb (diff)
downloadsecure-hid-4b23cb4850aa8f7b8a2823d053dd9369f90c8a9e.tar.gz
secure-hid-4b23cb4850aa8f7b8a2823d053dd9369f90c8a9e.tar.bz2
secure-hid-4b23cb4850aa8f7b8a2823d053dd9369f90c8a9e.zip
demo: timer: BUGFIX: TIM6 prescaler
TIM6 has clock running at 84MHz instead of 168MHz, so set the prescaler accordingly. Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
-rw-r--r--src/demo.c2
1 files changed, 1 insertions, 1 deletions
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);
}