X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Ftimer_avr.h;h=15bf8730f476ce61dc7b11eb45bd1c94c5635fe7;hb=d0c3b9f14ce6bcf214e6957b888183a30baae13d;hp=acaeff6d5105ae04d96bffbe52f9e0b2c81eaf58;hpb=93f604197657bbeab793d2a345a347c32f01d2be;p=bertos.git diff --git a/drv/timer_avr.h b/drv/timer_avr.h index acaeff6d..15bf8730 100755 --- a/drv/timer_avr.h +++ b/drv/timer_avr.h @@ -15,6 +15,15 @@ /* * $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. + * + * Revision 1.5 2004/07/18 22:16:35 bernie + * Add missing header; Prevent warning for project_ks-specific code. + * * Revision 1.4 2004/06/27 15:22:15 aleph * Fix spacing * @@ -33,8 +42,9 @@ #define DRV_TIMER_AVR_H #include +#include -#if (ARCH & ARCH_BOARD_KC) +#if defined(ARCH_BOARD_KC) && (ARCH & ARCH_BOARD_KC) #include #endif @@ -45,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) @@ -78,7 +88,6 @@ //! Frequency of the hardware high precision timer #define TIMER_HW_HPTICKS_PER_SEC (CLOCK_FREQ / 64) - INLINE hptime_t timer_hw_hpread(void); INLINE hptime_t timer_hw_hpread(void) { return TCNT0; @@ -115,7 +124,6 @@ //! Frequency of the hardware high precision timer #define TIMER_HW_HPTICKS_PER_SEC (24000ul * 512) - INLINE hptime_t timer_hw_hpread(void); INLINE hptime_t timer_hw_hpread(void) { return TCNT1; @@ -151,7 +159,6 @@ //! Frequency of the hardware high precision timer #define TIMER_HW_HPTICKS_PER_SEC (CLOCK_FREQ / 64) - INLINE hptime_t timer_hw_hpread(void); INLINE hptime_t timer_hw_hpread(void) { return TCNT2;