aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2009-07-21 06:05:02 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2009-07-21 06:05:02 +0000
commitf504460fc47cbd8d0e127e410263558912259f64 (patch)
tree219e675b39074f1e4619e78f1b94f4b971429d54
parent456d3eb8401acd8f818d2485c07a1270c17e4168 (diff)
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.
-rwxr-xr-xlibraries/Servo/Servo.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libraries/Servo/Servo.cpp b/libraries/Servo/Servo.cpp
index 32cc0e7..9f58d64 100755
--- a/libraries/Servo/Servo.cpp
+++ b/libraries/Servo/Servo.cpp
@@ -128,11 +128,11 @@ static void initISR(servoTimer_t timer)
TCCR1B = _BV(CS11); // set prescaler of 8
TCNT1 = 0; // clear the timer count
#if defined(__AVR_ATmega8__)
- TIFR = _BV(OCF1A); // clear any pending interrupts;
- TIMSK = _BV(OCIE1A) ; // enable the output compare interrupt
+ TIFR |= _BV(OCF1A); // clear any pending interrupts;
+ TIMSK |= _BV(OCIE1A) ; // enable the output compare interrupt
#else
- TIFR1 = _BV(OCF1A); // clear any pending interrupts;
- TIMSK1 = _BV(OCIE1A) ; // enable the output compare interrupt
+ TIFR1 |= _BV(OCF1A); // clear any pending interrupts;
+ TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
#endif
}
#if defined(__AVR_ATmega1280__)