From: bernie Date: Tue, 20 Jul 2004 23:49:40 +0000 (+0000) Subject: Compute value of OCR_DIVISOR from CLOCK_FREQ. X-Git-Tag: 1.0.0~1169 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d0c3b9f14ce6bcf214e6957b888183a30baae13d;p=bertos.git Compute value of OCR_DIVISOR from CLOCK_FREQ. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@72 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/timer_avr.h b/drv/timer_avr.h index 4f842eef..15bf8730 100755 --- a/drv/timer_avr.h +++ b/drv/timer_avr.h @@ -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)