Skip to content

Commit f9a3b5c

Browse files
committed
1280 -> 1280/2560.
1 parent 4bbd4f7 commit f9a3b5c

12 files changed

+23
-23
lines changed

cores/arduino/HardwareSerial.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct ring_buffer {
4242

4343
ring_buffer rx_buffer = { { 0 }, 0, 0 };
4444

45-
#if defined(__AVR_ATmega1280__)
45+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
4646
ring_buffer rx_buffer1 = { { 0 }, 0, 0 };
4747
ring_buffer rx_buffer2 = { { 0 }, 0, 0 };
4848
ring_buffer rx_buffer3 = { { 0 }, 0, 0 };
@@ -62,7 +62,7 @@ inline void store_char(unsigned char c, ring_buffer *rx_buffer)
6262
}
6363
}
6464

65-
#if defined(__AVR_ATmega1280__)
65+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
6666

6767
SIGNAL(SIG_USART0_RECV)
6868
{
@@ -229,7 +229,7 @@ HardwareSerial Serial(&rx_buffer, &UBRRH, &UBRRL, &UCSRA, &UCSRB, &UDR, RXEN, TX
229229
HardwareSerial Serial(&rx_buffer, &UBRR0H, &UBRR0L, &UCSR0A, &UCSR0B, &UDR0, RXEN0, TXEN0, RXCIE0, UDRE0, U2X0);
230230
#endif
231231

232-
#if defined(__AVR_ATmega1280__)
232+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
233233
HardwareSerial Serial1(&rx_buffer1, &UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UDR1, RXEN1, TXEN1, RXCIE1, UDRE1, U2X1);
234234
HardwareSerial Serial2(&rx_buffer2, &UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UDR2, RXEN2, TXEN2, RXCIE2, UDRE2, U2X2);
235235
HardwareSerial Serial3(&rx_buffer3, &UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UDR3, RXEN3, TXEN3, RXCIE3, UDRE3, U2X3);

cores/arduino/HardwareSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class HardwareSerial : public Stream
5858

5959
extern HardwareSerial Serial;
6060

61-
#if defined(__AVR_ATmega1280__)
61+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
6262
extern HardwareSerial Serial1;
6363
extern HardwareSerial Serial2;
6464
extern HardwareSerial Serial3;

cores/arduino/Tone.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ volatile long timer2_toggle_count;
6666
volatile uint8_t *timer2_pin_port;
6767
volatile uint8_t timer2_pin_mask;
6868

69-
#if defined(__AVR_ATmega1280__)
69+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
7070
volatile long timer3_toggle_count;
7171
volatile uint8_t *timer3_pin_port;
7272
volatile uint8_t timer3_pin_mask;
@@ -79,7 +79,7 @@ volatile uint8_t timer5_pin_mask;
7979
#endif
8080

8181

82-
#if defined(__AVR_ATmega1280__)
82+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
8383

8484
#define AVAILABLE_TONE_PINS 1
8585

@@ -164,7 +164,7 @@ static int8_t toneBegin(uint8_t _pin)
164164
timer2_pin_mask = digitalPinToBitMask(_pin);
165165
break;
166166

167-
#if defined(__AVR_ATmega1280__)
167+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
168168
case 3:
169169
// 16 bit timer
170170
TCCR3A = 0;
@@ -279,7 +279,7 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration)
279279

280280
if (_timer == 1)
281281
TCCR1B = (TCCR1B & 0b11111000) | prescalarbits;
282-
#if defined(__AVR_ATmega1280__)
282+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
283283
else if (_timer == 3)
284284
TCCR3B = (TCCR3B & 0b11111000) | prescalarbits;
285285
else if (_timer == 4)
@@ -326,7 +326,7 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration)
326326
bitWrite(TIMSK2, OCIE2A, 1);
327327
break;
328328

329-
#if defined(__AVR_ATmega1280__)
329+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
330330
case 3:
331331
OCR3A = ocr;
332332
timer3_toggle_count = toggle_count;
@@ -370,7 +370,7 @@ void disableTimer(uint8_t _timer)
370370
TCCR2B = (TCCR2B & 0b11111000) | (1 << CS22);
371371
OCR2A = 0;
372372
break;
373-
#if defined(__AVR_ATmega1280__)
373+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
374374
case 3:
375375
TIMSK3 = 0;
376376
break;
@@ -461,7 +461,7 @@ ISR(TIMER2_COMPA_vect)
461461

462462

463463

464-
//#if defined(__AVR_ATmega1280__)
464+
//#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
465465
#if 0
466466

467467
ISR(TIMER3_COMPA_vect)

cores/arduino/WInterrupts.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
5252
// Enable the interrupt.
5353

5454
switch (interruptNum) {
55-
#if defined(__AVR_ATmega1280__)
55+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
5656
case 2:
5757
EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00);
5858
EIMSK |= (1 << INT0);
@@ -105,7 +105,7 @@ void detachInterrupt(uint8_t interruptNum) {
105105
// to the number of the EIMSK bit to clear, as this isn't true on the
106106
// ATmega8. There, INT0 is 6 and INT1 is 7.)
107107
switch (interruptNum) {
108-
#if defined(__AVR_ATmega1280__)
108+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
109109
case 2:
110110
EIMSK &= ~(1 << INT0);
111111
break;
@@ -150,7 +150,7 @@ void attachInterruptTwi(void (*userFunc)(void) ) {
150150
}
151151
*/
152152

153-
#if defined(__AVR_ATmega1280__)
153+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
154154

155155
SIGNAL(INT0_vect) {
156156
if(intFunc[EXTERNAL_INT_2])

cores/arduino/WProgram.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ long random(long, long);
2929
void randomSeed(unsigned int);
3030
long map(long, long, long, long, long);
3131

32-
#if defined(__AVR_ATmega1280__)
32+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
3333
const static uint8_t A0 = 54;
3434
const static uint8_t A1 = 55;
3535
const static uint8_t A2 = 56;

cores/arduino/pins_arduino.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
#define PL 12
7979

8080

81-
#if defined(__AVR_ATmega1280__)
81+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
8282
const uint16_t PROGMEM port_to_mode_PGM[] = {
8383
NOT_A_PORT,
8484
&DDRA,

cores/arduino/pins_arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#define TIMER5B 15
5050
#define TIMER5C 16
5151

52-
#if defined(__AVR_ATmega1280__)
52+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
5353
const static uint8_t SS = 53;
5454
const static uint8_t MOSI = 51;
5555
const static uint8_t MISO = 50;

cores/arduino/wiring.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void init()
209209
sbi(TCCR2A, WGM20);
210210
#endif
211211

212-
#if defined(__AVR_ATmega1280__)
212+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
213213
// set timer 3, 4, 5 prescale factor to 64
214214
sbi(TCCR3B, CS31); sbi(TCCR3B, CS30);
215215
sbi(TCCR4B, CS41); sbi(TCCR4B, CS40);

cores/arduino/wiring.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extern "C"{
5858
#define FALLING 2
5959
#define RISING 3
6060

61-
#if defined(__AVR_ATmega1280__)
61+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
6262
#define INTERNAL1V1 2
6363
#define INTERNAL2V56 3
6464
#else

cores/arduino/wiring_analog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int analogRead(uint8_t pin)
3939
{
4040
uint8_t low, high;
4141

42-
#if defined(__AVR_ATmega1280__)
42+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
4343
if (pin >= 54) pin -= 54; // allow for channel or pin numbers
4444

4545
// the MUX5 bit of ADCSRB selects whether we're reading from channels
@@ -133,7 +133,7 @@ void analogWrite(uint8_t pin, int val)
133133
// set pwm duty
134134
OCR2B = val;
135135
#endif
136-
#if defined(__AVR_ATmega1280__)
136+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
137137
// XXX: need to handle other timers here
138138
} else if (digitalPinToTimer(pin) == TIMER3A) {
139139
// connect pwm to pin on timer 3, channel A

cores/arduino/wiring_digital.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static inline void turnOffPWM(uint8_t timer)
7171
if (timer == TIMER2B) cbi(TCCR2A, COM2B1);
7272
#endif
7373

74-
#if defined(__AVR_ATmega1280__)
74+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
7575
if (timer == TIMER3A) cbi(TCCR3A, COM3A1);
7676
if (timer == TIMER3B) cbi(TCCR3A, COM3B1);
7777
if (timer == TIMER3C) cbi(TCCR3A, COM3C1);

cores/arduino/wiring_private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extern "C"{
5353
#define EXTERNAL_INT_6 6
5454
#define EXTERNAL_INT_7 7
5555

56-
#if defined(__AVR_ATmega1280__)
56+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
5757
#define EXTERNAL_NUM_INTERRUPTS 8
5858
#else
5959
#define EXTERNAL_NUM_INTERRUPTS 2

0 commit comments

Comments
 (0)