Restore a few macros that were lost in the way.
[bertos.git] / drv / timer_avr.h
index b536c95393e4a6744e327a86387779c6c355b7ff..aa0911fee193c3b29354e12e381d83da401d4b94 100755 (executable)
 
 /*
  * $Log$
+ * Revision 1.12  2004/08/10 06:59:45  bernie
+ * CONFIG_TIMER_STROBE: Define no-op default macros.
+ *
+ * Revision 1.11  2004/08/03 15:53:17  aleph
+ * Fix spacing
+ *
+ * Revision 1.10  2004/08/02 20:20:29  aleph
+ * Merge from project_ks
+ *
  * Revision 1.9  2004/07/22 02:01:14  bernie
  * Use TIMER_PRESCALER consistently.
  *
 #endif
 
 
+/*!
+ * \def CONFIG_TIMER_STROBE
+ *
+ * This is a debug facility that can be used to
+ * monitor timer interrupt activity on an external pin.
+ *
+ * To use strobes, redefine the macros TIMER_STROBE_ON,
+ * TIMER_STROBE_OFF and TIMER_STROBE_INIT and set
+ * CONFIG_TIMER_STROBE to 1.
+ */
+#ifndef CONFIG_TIMER_STROBE
+       #define TIMER_STROBE_ON    do {/*nop*/} while(0)
+       #define TIMER_STROBE_OFF   do {/*nop*/} while(0)
+       #define TIMER_STROBE_INIT  do {/*nop*/} while(0)
+#endif
+
+
 /* Not needed, IRQ timer flag cleared automatically */
 #define timer_hw_irq() do {} while (0)
 
                TIFR = BV(OCF2) | BV(TOV2);
 
                /* Setup Timer/Counter interrupt */
-#warning Aleph, please use TIMER_PRESCALER here
-               TCCR2 = BV(WGM21) | BV(CS21) | BV(CS20);
+               TCCR2 = BV(WGM21)
+                       #if TIMER_PRESCALER == 64
+                               | BV(CS21) | BV(CS20)
+                       #else
+                               #error Unsupported value of TIMER_PRESCALER
+                       #endif
+               ;
                /* Clear on Compare match & prescaler = 64, internal sys clock.
                   When changing prescaler change TIMER_HW_HPTICKS_PER_SEC too */
                TCNT2 = 0x00;         /* initialization of Timer/Counter */