diff options
-rwxr-xr-x | cores/arduino/HardwareSerial.cpp | 6 | ||||
-rwxr-xr-x | cores/arduino/HardwareSerial.h | 2 | ||||
-rwxr-xr-x | cores/arduino/Tone.cpp | 14 | ||||
-rwxr-xr-x | cores/arduino/WInterrupts.c | 6 | ||||
-rwxr-xr-x | cores/arduino/WProgram.h | 2 | ||||
-rwxr-xr-x | cores/arduino/pins_arduino.c | 2 | ||||
-rw-r--r-- | cores/arduino/pins_arduino.h | 2 | ||||
-rwxr-xr-x | cores/arduino/wiring.c | 2 | ||||
-rwxr-xr-x | cores/arduino/wiring.h | 2 | ||||
-rwxr-xr-x | cores/arduino/wiring_analog.c | 4 | ||||
-rwxr-xr-x | cores/arduino/wiring_digital.c | 2 | ||||
-rwxr-xr-x | cores/arduino/wiring_private.h | 2 |
12 files changed, 23 insertions, 23 deletions
diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 43322ae..e7ac21f 100755 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -42,7 +42,7 @@ struct ring_buffer { ring_buffer rx_buffer = { { 0 }, 0, 0 }; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) ring_buffer rx_buffer1 = { { 0 }, 0, 0 }; ring_buffer rx_buffer2 = { { 0 }, 0, 0 }; ring_buffer rx_buffer3 = { { 0 }, 0, 0 }; @@ -62,7 +62,7 @@ inline void store_char(unsigned char c, ring_buffer *rx_buffer) } } -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) SIGNAL(SIG_USART0_RECV) { @@ -229,7 +229,7 @@ HardwareSerial Serial(&rx_buffer, &UBRRH, &UBRRL, &UCSRA, &UCSRB, &UDR, RXEN, TX HardwareSerial Serial(&rx_buffer, &UBRR0H, &UBRR0L, &UCSR0A, &UCSR0B, &UDR0, RXEN0, TXEN0, RXCIE0, UDRE0, U2X0); #endif -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) HardwareSerial Serial1(&rx_buffer1, &UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UDR1, RXEN1, TXEN1, RXCIE1, UDRE1, U2X1); HardwareSerial Serial2(&rx_buffer2, &UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UDR2, RXEN2, TXEN2, RXCIE2, UDRE2, U2X2); HardwareSerial Serial3(&rx_buffer3, &UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UDR3, RXEN3, TXEN3, RXCIE3, UDRE3, U2X3); diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h index 1770a63..29898b9 100755 --- a/cores/arduino/HardwareSerial.h +++ b/cores/arduino/HardwareSerial.h @@ -58,7 +58,7 @@ class HardwareSerial : public Stream extern HardwareSerial Serial; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) extern HardwareSerial Serial1; extern HardwareSerial Serial2; extern HardwareSerial Serial3; 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) diff --git a/cores/arduino/WInterrupts.c b/cores/arduino/WInterrupts.c index 69a78b0..9c57411 100755 --- a/cores/arduino/WInterrupts.c +++ b/cores/arduino/WInterrupts.c @@ -52,7 +52,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) { // Enable the interrupt. switch (interruptNum) { -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) case 2: EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00); EIMSK |= (1 << INT0); @@ -105,7 +105,7 @@ void detachInterrupt(uint8_t interruptNum) { // to the number of the EIMSK bit to clear, as this isn't true on the // ATmega8. There, INT0 is 6 and INT1 is 7.) switch (interruptNum) { -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) case 2: EIMSK &= ~(1 << INT0); break; @@ -150,7 +150,7 @@ void attachInterruptTwi(void (*userFunc)(void) ) { } */ -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) SIGNAL(INT0_vect) { if(intFunc[EXTERNAL_INT_2]) diff --git a/cores/arduino/WProgram.h b/cores/arduino/WProgram.h index 81a1a9b..5afecb4 100755 --- a/cores/arduino/WProgram.h +++ b/cores/arduino/WProgram.h @@ -29,7 +29,7 @@ long random(long, long); void randomSeed(unsigned int); long map(long, long, long, long, long); -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) const static uint8_t A0 = 54; const static uint8_t A1 = 55; const static uint8_t A2 = 56; diff --git a/cores/arduino/pins_arduino.c b/cores/arduino/pins_arduino.c index b662058..0c816e9 100755 --- a/cores/arduino/pins_arduino.c +++ b/cores/arduino/pins_arduino.c @@ -78,7 +78,7 @@ #define PL 12 -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) const uint16_t PROGMEM port_to_mode_PGM[] = { NOT_A_PORT, &DDRA, diff --git a/cores/arduino/pins_arduino.h b/cores/arduino/pins_arduino.h index 2e33565..bc931c5 100644 --- a/cores/arduino/pins_arduino.h +++ b/cores/arduino/pins_arduino.h @@ -49,7 +49,7 @@ #define TIMER5B 15 #define TIMER5C 16 -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) const static uint8_t SS = 53; const static uint8_t MOSI = 51; const static uint8_t MISO = 50; diff --git a/cores/arduino/wiring.c b/cores/arduino/wiring.c index 719e0e2..9cb6cf0 100755 --- a/cores/arduino/wiring.c +++ b/cores/arduino/wiring.c @@ -209,7 +209,7 @@ void init() sbi(TCCR2A, WGM20); #endif -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // set timer 3, 4, 5 prescale factor to 64 sbi(TCCR3B, CS31); sbi(TCCR3B, CS30); sbi(TCCR4B, CS41); sbi(TCCR4B, CS40); diff --git a/cores/arduino/wiring.h b/cores/arduino/wiring.h index 0118618..7245797 100755 --- a/cores/arduino/wiring.h +++ b/cores/arduino/wiring.h @@ -58,7 +58,7 @@ extern "C"{ #define FALLING 2 #define RISING 3 -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #define INTERNAL1V1 2 #define INTERNAL2V56 3 #else diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index 63be477..da0cf07 100755 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -39,7 +39,7 @@ int analogRead(uint8_t pin) { uint8_t low, high; -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) if (pin >= 54) pin -= 54; // allow for channel or pin numbers // the MUX5 bit of ADCSRB selects whether we're reading from channels @@ -133,7 +133,7 @@ void analogWrite(uint8_t pin, int val) // set pwm duty OCR2B = val; #endif -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // XXX: need to handle other timers here } else if (digitalPinToTimer(pin) == TIMER3A) { // connect pwm to pin on timer 3, channel A diff --git a/cores/arduino/wiring_digital.c b/cores/arduino/wiring_digital.c index 3529923..1475f0c 100755 --- a/cores/arduino/wiring_digital.c +++ b/cores/arduino/wiring_digital.c @@ -71,7 +71,7 @@ static inline void turnOffPWM(uint8_t timer) if (timer == TIMER2B) cbi(TCCR2A, COM2B1); #endif -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) if (timer == TIMER3A) cbi(TCCR3A, COM3A1); if (timer == TIMER3B) cbi(TCCR3A, COM3B1); if (timer == TIMER3C) cbi(TCCR3A, COM3C1); diff --git a/cores/arduino/wiring_private.h b/cores/arduino/wiring_private.h index 2dfe552..11f6f00 100755 --- a/cores/arduino/wiring_private.h +++ b/cores/arduino/wiring_private.h @@ -53,7 +53,7 @@ extern "C"{ #define EXTERNAL_INT_6 6 #define EXTERNAL_INT_7 7 -#if defined(__AVR_ATmega1280__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #define EXTERNAL_NUM_INTERRUPTS 8 #else #define EXTERNAL_NUM_INTERRUPTS 2 |