From da04ccdf710dd9627b0933ad8afbb4b7f78987b5 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Tue, 18 Oct 2016 11:32:34 +0200 Subject: [PATCH] stm32: timer: Clarify some misleading comments. Start clearing up misleading/redundant commentary. --- examples/stm32/f1/stm32-h103/timer/timer.c | 2 +- examples/stm32/f4/stm32f4-discovery/timer/timer.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/stm32/f1/stm32-h103/timer/timer.c b/examples/stm32/f1/stm32-h103/timer/timer.c index 7ad832d..f228317 100644 --- a/examples/stm32/f1/stm32-h103/timer/timer.c +++ b/examples/stm32/f1/stm32-h103/timer/timer.c @@ -90,7 +90,7 @@ static void tim_setup(void) /* Reset prescaler value. */ timer_set_prescaler(TIM2, 36000); - /* Enable preload. */ + /* Disable preload. */ timer_disable_preload(TIM2); /* Continous mode. */ diff --git a/examples/stm32/f4/stm32f4-discovery/timer/timer.c b/examples/stm32/f4/stm32f4-discovery/timer/timer.c index 6486aa7..927228d 100644 --- a/examples/stm32/f4/stm32f4-discovery/timer/timer.c +++ b/examples/stm32/f4/stm32f4-discovery/timer/timer.c @@ -92,7 +92,7 @@ static void tim_setup(void) TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP); /* Reset prescaler value. - * Running the clock at 5kHz. + * Running the clock at 10kHz. */ /* * On STM32F4 the timers are not running directly from pure APB1 or @@ -104,17 +104,17 @@ static void tim_setup(void) * the APBx prescaler is set to 1 the derived timer APBx will equal the * original APBx frequencies. * - * In our case here the APB1 is devided by 4 system frequency and APB2 - * divided by 2. This means APB1 timer will be 2 x APB1 and APB2 will - * be 2 x APB2. So when we try to calculate the prescaler value we have - * to use rcc_apb1_freqency * 2!!! + * In our case here the APB1 is system frequency divided by 4 and APB2 + * is system frequency divided by 2. This means APB1 timer will be 2 x + * APB1 and APB2 will be 2 x APB2. So when we try to calculate the + * prescaler value we have to use rcc_apb1_freqency * 2!!! * * For additional information see reference manual for the stm32f4 * familiy of chips. Page 204 and 213 */ timer_set_prescaler(TIM2, ((rcc_apb1_frequency * 2) / 10000)); - /* Enable preload. */ + /* Disable preload. */ timer_disable_preload(TIM2); /* Continous mode. */