Some changes to fix compile errors when using ATmega2560.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1187 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
c78e001087
commit
a257c51a09
@ -23,7 +23,7 @@
|
||||
#include <avr/interrupt.h>
|
||||
#include "WProgram.h"
|
||||
|
||||
#if !defined(__AVR_ATmega1280__)
|
||||
#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
|
||||
# error Please check the Tools/Board menu to ensure you have selected Arduino Mega as your target.
|
||||
#else
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
DataFlash.cpp - DataFlash log library for AT45DB161
|
||||
Code by Jordi Muñoz and Jose Julio. DIYDrones.com
|
||||
This code works with boards based on ATMega168/328 and ATMega1280 using SPI port
|
||||
This code works with boards based on ATMega168/328 and ATMega1280/2560 using SPI port
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -74,7 +74,7 @@ void DataFlash_Class::Init(void)
|
||||
pinMode(DF_DATAIN, INPUT);
|
||||
pinMode(DF_SPICLOCK,OUTPUT);
|
||||
pinMode(DF_SLAVESELECT,OUTPUT);
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
pinMode(DF_RESET,OUTPUT);
|
||||
// Reset the chip
|
||||
digitalWrite(DF_RESET,LOW);
|
||||
|
@ -5,7 +5,7 @@
|
||||
#define DataFlash_h
|
||||
|
||||
// arduino mega SPI pins
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
#define DF_DATAOUT 51 // MOSI
|
||||
#define DF_DATAIN 50 // MISO
|
||||
#define DF_SPICLOCK 52 // SCK
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "FastSerial.h"
|
||||
#include "WProgram.h"
|
||||
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
# define FS_MAX_PORTS 4
|
||||
#else
|
||||
# define FS_MAX_PORTS 1
|
||||
|
@ -25,8 +25,8 @@ void GPS_IMU_Class::Init(void)
|
||||
|
||||
IMU_timer = millis(); //Restarting timer...
|
||||
// Initialize serial port
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280/2560
|
||||
#else
|
||||
Serial.begin(38400);
|
||||
#endif
|
||||
@ -42,7 +42,7 @@ void GPS_IMU_Class::Read(void)
|
||||
int numc = 0;
|
||||
static byte message_num = 0;
|
||||
|
||||
#if defined(__AVR_ATmega1280__) // If AtMega1280 then Serial port 1...
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // If AtMega1280/2560 then Serial port 1...
|
||||
numc = Serial.available();
|
||||
#else
|
||||
numc = Serial.available();
|
||||
@ -51,7 +51,7 @@ void GPS_IMU_Class::Read(void)
|
||||
if (numc > 0){
|
||||
for (int i=0;i<numc;i++){ // Process bytes received
|
||||
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
data = Serial.read();
|
||||
#else
|
||||
data = Serial.read();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
GPS_MTK.cpp - Ublox GPS library for Arduino
|
||||
Code by Jordi Muñoz and Jose Julio. DIYDrones.com
|
||||
This code works with boards based on ATMega168/328 and ATMega1280 (Serial port 1)
|
||||
This code works with boards based on ATMega168/328 and ATMega1280/2560 (Serial port 1)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -50,8 +50,8 @@ void GPS_MTK_Class::Init(void)
|
||||
PrintErrors=0;
|
||||
GPS_timer=millis(); //Restarting timer...
|
||||
// Initialize serial port
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280/2560
|
||||
#else
|
||||
Serial.begin(38400);
|
||||
#endif
|
||||
@ -68,7 +68,7 @@ void GPS_MTK_Class::Read(void)
|
||||
byte data;
|
||||
int numc;
|
||||
|
||||
#if defined(__AVR_ATmega1280__) // If AtMega1280 then Serial port 1...
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // If AtMega1280/2560 then Serial port 1...
|
||||
numc = Serial1.available();
|
||||
#else
|
||||
numc = Serial.available();
|
||||
@ -76,7 +76,7 @@ void GPS_MTK_Class::Read(void)
|
||||
if (numc > 0)
|
||||
for (int i=0;i<numc;i++) // Process bytes received
|
||||
{
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
data = Serial1.read();
|
||||
#else
|
||||
data = Serial.read();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
GPS_NMEA.cpp - Generic NMEA GPS library for Arduino
|
||||
Code by Jordi Muñoz and Jose Julio. DIYDrones.com
|
||||
This code works with boards based on ATMega168/328 and ATMega1280 (Serial port 1)
|
||||
This code works with boards based on ATMega168/328 and ATMega1280/2560 (Serial port 1)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -59,8 +59,8 @@ void GPS_NMEA_Class::Init(void)
|
||||
Quality=0;
|
||||
PrintErrors=0;
|
||||
// Initialize serial port
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280
|
||||
#if defined(__AVR_ATmega1280__)|| defined(__AVR_ATmega2560__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280/2560
|
||||
#else
|
||||
Serial.begin(38400);
|
||||
#endif
|
||||
@ -76,14 +76,14 @@ void GPS_NMEA_Class::Read(void)
|
||||
int i;
|
||||
|
||||
|
||||
#if defined(__AVR_ATmega1280__) // If AtMega1280 then Serial port 1...
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // If AtMega1280/2560 then Serial port 1...
|
||||
numc = Serial1.available();
|
||||
#else
|
||||
numc = Serial.available();
|
||||
#endif
|
||||
if (numc > 0)
|
||||
for (i=0;i<numc;i++){
|
||||
#if defined(__AVR_ATmega1280__) // If AtMega1280 then Serial port 1...
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // If AtMega1280/2560 then Serial port 1...
|
||||
c = Serial1.read();
|
||||
#else
|
||||
c = Serial.read();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
GPS_UBLOX.cpp - Ublox GPS library for Arduino
|
||||
Code by Jordi Muñoz and Jose Julio. DIYDrones.com
|
||||
This code works with boards based on ATMega168 / 328 and ATMega1280 (Serial port 1)
|
||||
This code works with boards based on ATMega168 / 328 and ATMega1280/2560 (Serial port 1)
|
||||
|
||||
This library is free software; you can redistribute it and / or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -56,8 +56,8 @@ void GPS_UBLOX_Class::Init(void)
|
||||
PrintErrors = 0;
|
||||
GPS_timer = millis(); // Restarting timer...
|
||||
// Initialize serial port
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
Serial1.begin(38400); // Serial port 1 on ATMega1280/2560
|
||||
#else
|
||||
Serial.begin(38400);
|
||||
#endif
|
||||
@ -72,7 +72,7 @@ void GPS_UBLOX_Class::Read(void)
|
||||
byte data;
|
||||
int numc;
|
||||
|
||||
#if defined(__AVR_ATmega1280__) // If AtMega1280 then Serial port 1...
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // If AtMega1280/2560 then Serial port 1...
|
||||
numc = Serial1.available();
|
||||
#else
|
||||
numc = Serial.available();
|
||||
@ -80,7 +80,7 @@ void GPS_UBLOX_Class::Read(void)
|
||||
if (numc > 0)
|
||||
for (int i = 0; i < numc; i++) // Process bytes received
|
||||
{
|
||||
#if defined(__AVR_ATmega1280__)
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
data = Serial1.read();
|
||||
#else
|
||||
data = Serial.read();
|
||||
|
Loading…
Reference in New Issue
Block a user