mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-18 12:54:25 +01:00
Fixing Servo library on the ATmega8 by changing assignments to TIMSK and TIFR into bitwise-or's. Otherwise, this broke millis() by disabling the timer 0 overflow interrupt.
This commit is contained in:
parent
262400962f
commit
4ee94a1800
@ -128,11 +128,11 @@ static void initISR(servoTimer_t timer)
|
|||||||
TCCR1B = _BV(CS11); // set prescaler of 8
|
TCCR1B = _BV(CS11); // set prescaler of 8
|
||||||
TCNT1 = 0; // clear the timer count
|
TCNT1 = 0; // clear the timer count
|
||||||
#if defined(__AVR_ATmega8__)
|
#if defined(__AVR_ATmega8__)
|
||||||
TIFR = _BV(OCF1A); // clear any pending interrupts;
|
TIFR |= _BV(OCF1A); // clear any pending interrupts;
|
||||||
TIMSK = _BV(OCIE1A) ; // enable the output compare interrupt
|
TIMSK |= _BV(OCIE1A) ; // enable the output compare interrupt
|
||||||
#else
|
#else
|
||||||
TIFR1 = _BV(OCF1A); // clear any pending interrupts;
|
TIFR1 |= _BV(OCF1A); // clear any pending interrupts;
|
||||||
TIMSK1 = _BV(OCIE1A) ; // enable the output compare interrupt
|
TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(__AVR_ATmega1280__)
|
#if defined(__AVR_ATmega1280__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user