2 #include <avr/interrupt.h>
6 volatile uint16_t jiffies;
7 #define PATTERN_DIV 5 // clk/10
8 static unsigned char pattern_div;
13 TCCR0B = _BV(CS02) | _BV(CS00); // CLK/1024 = 1 kHz
18 pattern_div = PATTERN_DIV;
24 TIMSK &= ~_BV(OCIE0A);
28 ISR(TIMER0_COMPA_vect)
32 if (--pattern_div == 0) {
33 timer_check_buttons();
35 pattern_div = PATTERN_DIV;