Rev 408 | Rev 492 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 408 | Rev 415 | ||
|---|---|---|---|
| Line 90... | Line 90... | ||
| 90 | #elif TIMEBASE_PRESCALE == 256 |
90 | #elif TIMEBASE_PRESCALE == 256 |
| 91 | TCCR2B = (1<<CS22)|(1<<CS21); // prescaler: 256 |
91 | TCCR2B = (1<<CS22)|(1<<CS21); // prescaler: 256 |
| 92 | #endif |
92 | #endif |
| 93 | OCR2A = TIMEBASE_HITS_PER_1MS; // set timer period |
93 | OCR2A = TIMEBASE_HITS_PER_1MS; // set timer period |
| 94 | TIFR2 |= (1<<OCF2A); // clear ouput compare match flag |
94 | TIFR2 |= (1<<OCF2A); // clear ouput compare match flag |
| 95 | TIMSK2 |= (1<< |
95 | TIMSK2 |= (1<<OCIE2A); // enable output compare match interrupt |
| 96 | #endif |
96 | #endif |
| 97 | #else /* Use timer0 */ |
97 | #else /* Use timer0 */ |
| 98 | #if defined(__AVR_ATmega8__) |
98 | #if defined(__AVR_ATmega8__) |
| 99 | #error TIMER0 not supported in ATmega8 with TIMEBASE_NEW_IMPLEMENTATION set! |
99 | #error TIMER0 not supported in ATmega8 with TIMEBASE_NEW_IMPLEMENTATION set! |
| 100 | #endif |
100 | #endif |