From 69604e458be4d593ba4928c72ba2c262123411ba Mon Sep 17 00:00:00 2001 From: Francois Best Date: Thu, 6 Sep 2012 20:41:25 +0200 Subject: [PATCH] Made unique set of files, to avoid stupid branches. --- src/MIDI.cpp | 15 +++++++++++---- src/MIDI.h | 7 ++++++- src/midi_Defs.h | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/MIDI.cpp b/src/MIDI.cpp index c88d05f..c223443 100644 --- a/src/MIDI.cpp +++ b/src/MIDI.cpp @@ -27,13 +27,20 @@ #if MIDI_AUTO_INSTANCIATE # if MIDI_USE_SOFTWARE_SERIAL -# include "../SoftwareSerial/SoftwareSerial.h" - SoftwareSerial softSerialClass(MIDI_SOFTSERIAL_RX_PIN, - MIDI_SOFTSERIAL_TX_PIN); +# ifndef FSE_AVR +# include "../SoftwareSerial/SoftwareSerial.h" + SoftwareSerial softSerialClass(MIDI_SOFTSERIAL_RX_PIN, + MIDI_SOFTSERIAL_TX_PIN); +# else +# error Todo: implement SoftwareSerial for avr core. # undef MIDI_SERIAL_PORT # define MIDI_SERIAL_PORT softSerialClass # else -# include "HardwareSerial.h" +# ifdef FSE_AVR +# include +# else +# include "HardwareSerial.h" +# endif # endif // MIDI_USE_SOFTWARE_SERIAL MIDI_NAMESPACE::MidiInterface MIDI; diff --git a/src/MIDI.h b/src/MIDI.h index 12f9d79..3b55365 100644 --- a/src/MIDI.h +++ b/src/MIDI.h @@ -12,7 +12,12 @@ #include "midi_Settings.h" #include "midi_Defs.h" -#include "Arduino.h" + +#ifdef FSE_AVR +# include "hardware_Serial.h" +#else +# include "Arduino.h" +#endif // ----------------------------------------------------------------------------- diff --git a/src/midi_Defs.h b/src/midi_Defs.h index ca3c027..249aec5 100644 --- a/src/midi_Defs.h +++ b/src/midi_Defs.h @@ -10,9 +10,18 @@ #pragma once -#include #include "midi_Namespace.h" +// ----------------------------------------------------------------------------- + +#ifdef FSE_AVR +# include +#else +# include +#endif + +// ----------------------------------------------------------------------------- + BEGIN_MIDI_NAMESPACE // ----------------------------------------------------------------------------- @@ -26,8 +35,9 @@ BEGIN_MIDI_NAMESPACE // ----------------------------------------------------------------------------- // Type definitions +#ifndef FSE_AVR typedef uint8_t byte; -typedef uint16_t word; +#endif typedef byte StatusByte; typedef byte DataByte;