Compute value of OCR_DIVISOR from CLOCK_FREQ.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 20 Jul 2004 23:49:40 +0000 (23:49 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 20 Jul 2004 23:49:40 +0000 (23:49 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@72 38d2e660-2303-0410-9eaa-f027e97ec537

drv/timer_avr.h

index 4f842eefc0b4a7d152d3bfd5c72b6f9b809d2bb4..15bf8730f476ce61dc7b11eb45bd1c94c5635fe7 100755 (executable)
@@ -15,6 +15,9 @@
 
 /*
  * $Log$
+ * Revision 1.7  2004/07/20 23:49:40  bernie
+ * Compute value of OCR_DIVISOR from CLOCK_FREQ.
+ *
  * Revision 1.6  2004/07/20 23:48:16  bernie
  * Finally remove redundant protos.
  *
@@ -52,7 +55,7 @@
  * System timer: additional division after the prescaler
  * 12288000 / 64 / 192 (0..191) = 1 ms
  */
-#define OCR_DIVISOR 191
+#define OCR_DIVISOR  (CLOCK_FREQ / TIMER_PRESCALER / TICKS_PER_SEC - 1) /* 191 */
 
 /*! HW dependent timer initialization  */
 #if defined(CONFIG_TIMER_ON_TIMER0)