Switch from GPLv2 to GPLv2+
[fw/altos] / src / stm / ao_fast_timer.c
index d61b40c99bed32f5a25af6010f41ad1e93ef9869..f4378ca874575676c7f105b4af28622b20074e7f 100644 (file)
@@ -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;