diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2010-09-08 22:33:33 +0000 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2010-09-08 22:33:33 +0000 |
commit | f9a3b5cfa9b591096b80a7541323c4319da2d32d (patch) | |
tree | e371a9e83e28c3eeb7113b963c44cd11fe0135ee /cores/arduino/Tone.cpp | |
parent | 4bbd4f7448907ed0133ef737fc694751f9f97ea3 (diff) |
1280 -> 1280/2560.
Diffstat (limited to 'cores/arduino/Tone.cpp')
-rwxr-xr-x | cores/arduino/Tone.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cores/arduino/Tone.cpp b/cores/arduino/Tone.cpp index 3da5eb8..e221ecf 100755 --- a/cores/arduino/Tone.cpp +++ b/cores/arduino/Tone.cpp @@ -66,7 +66,7 @@ volatile long timer2_toggle_count; volatile uint8_t *timer2_pin_port; volatile uint8_t timer2_pin_mask; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) volatile long timer3_toggle_count; volatile uint8_t *timer3_pin_port; volatile uint8_t timer3_pin_mask; @@ -79,7 +79,7 @@ volatile uint8_t timer5_pin_mask; #endif -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #define AVAILABLE_TONE_PINS 1 @@ -164,7 +164,7 @@ static int8_t toneBegin(uint8_t _pin) timer2_pin_mask = digitalPinToBitMask(_pin); break; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) case 3: // 16 bit timer TCCR3A = 0; @@ -279,7 +279,7 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration) if (_timer == 1) TCCR1B = (TCCR1B & 0b11111000) | prescalarbits; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) else if (_timer == 3) TCCR3B = (TCCR3B & 0b11111000) | prescalarbits; else if (_timer == 4) @@ -326,7 +326,7 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration) bitWrite(TIMSK2, OCIE2A, 1); break; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) case 3: OCR3A = ocr; timer3_toggle_count = toggle_count; @@ -370,7 +370,7 @@ void disableTimer(uint8_t _timer) TCCR2B = (TCCR2B & 0b11111000) | (1 << CS22); OCR2A = 0; break; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) case 3: TIMSK3 = 0; break; @@ -461,7 +461,7 @@ ISR(TIMER2_COMPA_vect) -//#if defined(__AVR_ATmega1280__) +//#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #if 0 ISR(TIMER3_COMPA_vect) |