From df19bef23ca454d99a930ed9baf5327631d83071 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Nov 2012 09:03:35 +1100 Subject: [PATCH] SITL: don't define __AVR_ATmega2560__ on desktop build this allows us to properly separate the desktop build in the code --- libraries/APM_RC/APM_RC_APM1.cpp | 2 +- libraries/APM_RC/APM_RC_APM2.cpp | 2 +- libraries/DataFlash/DataFlash_APM1.cpp | 4 ++-- libraries/DataFlash/DataFlash_APM2.cpp | 2 +- libraries/Desktop/Desktop.mk | 2 +- libraries/Desktop/include/avr/iomxx0_1.h | 2 +- libraries/Desktop/include/pins_arduino.h | 2 +- libraries/Desktop/include/wiring.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/APM_RC/APM_RC_APM1.cpp b/libraries/APM_RC/APM_RC_APM1.cpp index d47ad8df5f..7f648e50f6 100644 --- a/libraries/APM_RC/APM_RC_APM1.cpp +++ b/libraries/APM_RC/APM_RC_APM1.cpp @@ -27,7 +27,7 @@ #include "WProgram.h" #endif -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) && !defined(DESKTOP_BUILD) # error Please check the Tools/Board menu to ensure you have selected Arduino Mega as your target. #else diff --git a/libraries/APM_RC/APM_RC_APM2.cpp b/libraries/APM_RC/APM_RC_APM2.cpp index a9023e2332..aa6847fa96 100644 --- a/libraries/APM_RC/APM_RC_APM2.cpp +++ b/libraries/APM_RC/APM_RC_APM2.cpp @@ -27,7 +27,7 @@ #include "WProgram.h" #endif -#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) && !defined(DESKTOP_BUILD) # error Please check the Tools/Board menu to ensure you have selected Arduino Mega as your target. #else diff --git a/libraries/DataFlash/DataFlash_APM1.cpp b/libraries/DataFlash/DataFlash_APM1.cpp index cf22d8cc73..008fc791eb 100644 --- a/libraries/DataFlash/DataFlash_APM1.cpp +++ b/libraries/DataFlash/DataFlash_APM1.cpp @@ -64,7 +64,7 @@ extern "C" { #define DF_LAST_PAGE 4096 // arduino mega SPI pins -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(DESKTOP_BUILD) #define DF_DATAOUT 51 // MOSI #define DF_DATAIN 50 // MISO #define DF_SPICLOCK 52 // SCK @@ -145,7 +145,7 @@ void DataFlash_APM1::Init(void) pinMode(DF_DATAIN, INPUT); pinMode(DF_SPICLOCK,OUTPUT); pinMode(DF_SLAVESELECT,OUTPUT); -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(DESKTOP_BUILD) pinMode(DF_RESET,OUTPUT); // Reset the chip digitalWrite(DF_RESET,LOW); diff --git a/libraries/DataFlash/DataFlash_APM2.cpp b/libraries/DataFlash/DataFlash_APM2.cpp index d38f2cdba0..930b565baa 100644 --- a/libraries/DataFlash/DataFlash_APM2.cpp +++ b/libraries/DataFlash/DataFlash_APM2.cpp @@ -58,7 +58,7 @@ extern "C" { # //*/ // DataFlash is connected to Serial Port 3 (we will use SPI mode) -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(DESKTOP_BUILD) #define DF_DATAOUT 14 // MOSI #define DF_DATAIN 15 // MISO #define DF_SPICLOCK PJ2 // SCK diff --git a/libraries/Desktop/Desktop.mk b/libraries/Desktop/Desktop.mk index b515868d05..d52cf86158 100644 --- a/libraries/Desktop/Desktop.mk +++ b/libraries/Desktop/Desktop.mk @@ -121,7 +121,7 @@ OPTFLAGS = -g -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-stri DEPFLAGS = -MD -MT $@ # XXX warning options TBD -CXXOPTS = -fno-exceptions -D__AVR_ATmega2560__ -I$(SKETCHBOOK)/libraries/Desktop/include -DDESKTOP_BUILD=1 +CXXOPTS = -fno-exceptions -I$(SKETCHBOOK)/libraries/Desktop/include -DDESKTOP_BUILD=1 COPTS = -I$(SKETCHBOOK)/libraries/Desktop/include -DDESKTOP_BUILD=1 ASOPTS = -assembler-with-cpp diff --git a/libraries/Desktop/include/avr/iomxx0_1.h b/libraries/Desktop/include/avr/iomxx0_1.h index 7b9e6ed3a9..4cd54ff9fa 100644 --- a/libraries/Desktop/include/avr/iomxx0_1.h +++ b/libraries/Desktop/include/avr/iomxx0_1.h @@ -48,7 +48,7 @@ # error "Attempt to include more than one file." #endif -#if defined(__AVR_ATmega640__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(__AVR_ATmega640__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(DESKTOP_BUILD) # define __ATmegaxx0__ #elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) # define __ATmegaxx1__ diff --git a/libraries/Desktop/include/pins_arduino.h b/libraries/Desktop/include/pins_arduino.h index bc931c597c..7bfa0f09aa 100644 --- a/libraries/Desktop/include/pins_arduino.h +++ b/libraries/Desktop/include/pins_arduino.h @@ -49,7 +49,7 @@ #define TIMER5B 15 #define TIMER5C 16 -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(DESKTOP_BUILD) const static uint8_t SS = 53; const static uint8_t MOSI = 51; const static uint8_t MISO = 50; diff --git a/libraries/Desktop/include/wiring.h b/libraries/Desktop/include/wiring.h index 8cf2fd7023..462c2fa5af 100644 --- a/libraries/Desktop/include/wiring.h +++ b/libraries/Desktop/include/wiring.h @@ -58,7 +58,7 @@ extern "C"{ #define FALLING 2 #define RISING 3 -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(DESKTOP_BUILD) #define INTERNAL1V1 2 #define INTERNAL2V56 3 #else