clock.c: Add a comment about interrupt priorities.

This commit is contained in:
Markus Hitter 2010-10-04 13:58:00 +02:00
parent 2fac65d172
commit bdfc4c5507
1 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,13 @@ void clock_setup() {
// no compare match, CTC mode
TCCR2A = MASK(WGM21);
// TODO: Timer 2 has higher priority than Timer 1 used for the stepper
// interrupts, which is bad. See AVR Reference Manual p. 9:
// "The interrupts have priority in accordance
// with their Interrupt Vector position. The
// lower the Interrupt Vector address, the higher
// the priority."
// in conjunction with p. 63 (interrupt vector table).
// 128 prescaler (16MHz / 128 = 125KHz)
TCCR2B = MASK(CS22) | MASK(CS20);