X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fstm%2Fao_fast_timer.c;h=f4378ca874575676c7f105b4af28622b20074e7f;hp=d61b40c99bed32f5a25af6010f41ad1e93ef9869;hb=1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a;hpb=01f8df088759ee7e6bc3900a013e0ea4fafaf984 diff --git a/src/stm/ao_fast_timer.c b/src/stm/ao_fast_timer.c index d61b40c9..f4378ca8 100644 --- a/src/stm/ao_fast_timer.c +++ b/src/stm/ao_fast_timer.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -88,7 +89,11 @@ void stm_tim6_isr(void) #define TIMER_23467_SCALER 1 #endif -#define TIMER_10kHz ((AO_PCLK1 * TIMER_23467_SCALER) / 10000) +#ifndef FAST_TIMER_FREQ +#define FAST_TIMER_FREQ 10000 +#endif + +#define TIMER_FAST ((AO_PCLK1 * TIMER_23467_SCALER) / FAST_TIMER_FREQ) void ao_fast_timer_init(void) @@ -100,7 +105,7 @@ ao_fast_timer_init(void) /* Turn on timer 6 */ stm_rcc.apb1enr |= (1 << STM_RCC_APB1ENR_TIM6EN); - stm_tim6.psc = TIMER_10kHz; + stm_tim6.psc = TIMER_FAST; stm_tim6.arr = 9; stm_tim6.cnt = 0;