From d0c3b9f14ce6bcf214e6957b888183a30baae13d Mon Sep 17 00:00:00 2001 From: bernie Date: Tue, 20 Jul 2004 23:49:40 +0000 Subject: [PATCH] Compute value of OCR_DIVISOR from CLOCK_FREQ. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@72 38d2e660-2303-0410-9eaa-f027e97ec537 --- drv/timer_avr.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.25.1