mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
SITL: don't define __AVR_ATmega2560__ on desktop build
this allows us to properly separate the desktop build in the code
This commit is contained in:
parent
1229cb06c0
commit
df19bef23c
@ -27,7 +27,7 @@
|
|||||||
#include "WProgram.h"
|
#include "WProgram.h"
|
||||||
#endif
|
#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.
|
# error Please check the Tools/Board menu to ensure you have selected Arduino Mega as your target.
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "WProgram.h"
|
#include "WProgram.h"
|
||||||
#endif
|
#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.
|
# error Please check the Tools/Board menu to ensure you have selected Arduino Mega as your target.
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ extern "C" {
|
|||||||
#define DF_LAST_PAGE 4096
|
#define DF_LAST_PAGE 4096
|
||||||
|
|
||||||
// arduino mega SPI pins
|
// 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_DATAOUT 51 // MOSI
|
||||||
#define DF_DATAIN 50 // MISO
|
#define DF_DATAIN 50 // MISO
|
||||||
#define DF_SPICLOCK 52 // SCK
|
#define DF_SPICLOCK 52 // SCK
|
||||||
@ -145,7 +145,7 @@ void DataFlash_APM1::Init(void)
|
|||||||
pinMode(DF_DATAIN, INPUT);
|
pinMode(DF_DATAIN, INPUT);
|
||||||
pinMode(DF_SPICLOCK,OUTPUT);
|
pinMode(DF_SPICLOCK,OUTPUT);
|
||||||
pinMode(DF_SLAVESELECT,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);
|
pinMode(DF_RESET,OUTPUT);
|
||||||
// Reset the chip
|
// Reset the chip
|
||||||
digitalWrite(DF_RESET,LOW);
|
digitalWrite(DF_RESET,LOW);
|
||||||
|
@ -58,7 +58,7 @@ extern "C" {
|
|||||||
# //*/
|
# //*/
|
||||||
|
|
||||||
// DataFlash is connected to Serial Port 3 (we will use SPI mode)
|
// 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_DATAOUT 14 // MOSI
|
||||||
#define DF_DATAIN 15 // MISO
|
#define DF_DATAIN 15 // MISO
|
||||||
#define DF_SPICLOCK PJ2 // SCK
|
#define DF_SPICLOCK PJ2 // SCK
|
||||||
|
@ -121,7 +121,7 @@ OPTFLAGS = -g -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-stri
|
|||||||
DEPFLAGS = -MD -MT $@
|
DEPFLAGS = -MD -MT $@
|
||||||
|
|
||||||
# XXX warning options TBD
|
# 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
|
COPTS = -I$(SKETCHBOOK)/libraries/Desktop/include -DDESKTOP_BUILD=1
|
||||||
ASOPTS = -assembler-with-cpp
|
ASOPTS = -assembler-with-cpp
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
# error "Attempt to include more than one <avr/ioXXX.h> file."
|
# error "Attempt to include more than one <avr/ioXXX.h> file."
|
||||||
#endif
|
#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__
|
# define __ATmegaxx0__
|
||||||
#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
|
#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
|
||||||
# define __ATmegaxx1__
|
# define __ATmegaxx1__
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#define TIMER5B 15
|
#define TIMER5B 15
|
||||||
#define TIMER5C 16
|
#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 SS = 53;
|
||||||
const static uint8_t MOSI = 51;
|
const static uint8_t MOSI = 51;
|
||||||
const static uint8_t MISO = 50;
|
const static uint8_t MISO = 50;
|
||||||
|
@ -58,7 +58,7 @@ extern "C"{
|
|||||||
#define FALLING 2
|
#define FALLING 2
|
||||||
#define RISING 3
|
#define RISING 3
|
||||||
|
|
||||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(DESKTOP_BUILD)
|
||||||
#define INTERNAL1V1 2
|
#define INTERNAL1V1 2
|
||||||
#define INTERNAL2V56 3
|
#define INTERNAL2V56 3
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user