Merge branch 'master' into ESP8266

* master:
  millis() is 64-bits on the Arduino/Genuino 101
  CLOCK_SPEED is now correctly defined as an int instead of a double
  Define CLOCK_SPEED as type int
  Add genuino101 to travis, remove call to setClockDivider (obsolete)
  Remove duplicate code
  Add Arduino 101 mods from https://github.com/KitPan/USB_Host_Shield_2.0

# Conflicts:
#	.travis.yml
This commit is contained in:
Kristian Sloth Lauszus 2017-02-06 14:45:33 +01:00
commit 4cb265e9a8
4 changed files with 58 additions and 2 deletions

View file

@ -74,6 +74,6 @@ install:
- platformio lib install 62 416 417 - platformio lib install 62 416 417
script: script:
- platformio ci --lib="." --board=uno --board=due --board=teensy30 --board=teensy31 --board=teensy35 --board=teensy36 --board=teensylc - platformio ci --lib="." --board=uno --board=due --board=genuino101 --board=teensy30 --board=teensy31 --board=teensy35 --board=teensy36 --board=teensylc
- export PLATFORMIO_BUILD_FLAGS="$PLATFORMIO_BUILD_FLAGS -Wno-unused-function" # Workaround https://github.com/esp8266/Arduino/pull/2881 - export PLATFORMIO_BUILD_FLAGS="$PLATFORMIO_BUILD_FLAGS -Wno-unused-function" # Workaround https://github.com/esp8266/Arduino/pull/2881
- platformio ci --lib="." --board=esp12e --board=nodemcu - platformio ci --lib="." --board=esp12e --board=nodemcu

View file

@ -1167,6 +1167,58 @@ MAKE_PIN(P19, GPIOC, GPIO_PIN_0); // A5
#endif #endif
#elif defined(__ARDUINO_ARC__)
#include <avr/pgmspace.h>
// Pointers are 32 bits on arc
#define pgm_read_pointer(p) pgm_read_dword(p)
#define MAKE_PIN(className, pin) \
class className { \
public: \
static void Set() { \
digitalWrite(pin, HIGH);\
} \
static void Clear() { \
digitalWrite(pin, LOW); \
} \
static void SetDirRead() { \
pinMode(pin, INPUT); \
} \
static void SetDirWrite() { \
pinMode(pin, OUTPUT); \
} \
static uint8_t IsSet() { \
return digitalRead(pin); \
} \
};
MAKE_PIN(P0, 0);
MAKE_PIN(P1, 1);
MAKE_PIN(P2, 2);
MAKE_PIN(P3, 3); //PWM
MAKE_PIN(P4, 4);
MAKE_PIN(P5, 5); //PWM
MAKE_PIN(P6, 6); //PWM
MAKE_PIN(P7, 7);
MAKE_PIN(P8, 8);
MAKE_PIN(P9, 9); //PWM
MAKE_PIN(P10, 10); //SPI SS
MAKE_PIN(P11, 11); //SPI MOSI
MAKE_PIN(P12, 12); //SPI MISO
MAKE_PIN(P13, 13); //SPI SCK / BUILTIN LED
MAKE_PIN(P14, 14); // A0
MAKE_PIN(P15, 15); // A1
MAKE_PIN(P16, 16); // A2
MAKE_PIN(P17, 17); // A3
MAKE_PIN(P18, 18); // A4 SDA
MAKE_PIN(P19, 19); // A5 SCL
MAKE_PIN(P20, 20); // ATN
#undef MAKE_PIN
#elif defined(__ARDUINO_X86__) // Intel Galileo, Intel Galileo 2 and Intel Edison #elif defined(__ARDUINO_X86__) // Intel Galileo, Intel Galileo 2 and Intel Edison
#include <avr/pgmspace.h> #include <avr/pgmspace.h>

View file

@ -69,7 +69,11 @@ void MIDI_poll()
pid = Midi.pid; pid = Midi.pid;
} }
if (Midi.RecvData( &rcvd, bufMidi) == 0 ) { if (Midi.RecvData( &rcvd, bufMidi) == 0 ) {
#ifdef __ARDUINO_ARC__
sprintf(buf, "%016llX: ", millis()); // millis() is 64-bits on the Arduino/Genuino 101
#else
sprintf(buf, "%08lX: ", millis()); sprintf(buf, "%08lX: ", millis());
#endif
Serial.print(buf); Serial.print(buf);
Serial.print(rcvd); Serial.print(rcvd);
Serial.print(':'); Serial.print(':');

View file

@ -103,7 +103,7 @@ typedef SPi< Pb1, Pb2, Pb3, Pb0 > spi;
typedef SPi< Pb5, Pb3, Pb4, Pb2 > spi; typedef SPi< Pb5, Pb3, Pb4, Pb2 > spi;
#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
typedef SPi< Pb7, Pb5, Pb6, Pb4 > spi; typedef SPi< Pb7, Pb5, Pb6, Pb4 > spi;
#elif (defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__MKL26Z64__))) || defined(__ARDUINO_X86__) || defined(__MIPSEL__) || defined(STM32F4) #elif (defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__MKL26Z64__))) || defined(__ARDUINO_ARC__) || defined(__ARDUINO_X86__) || defined(__MIPSEL__) || defined(STM32F4)
typedef SPi< P13, P11, P12, P10 > spi; typedef SPi< P13, P11, P12, P10 > spi;
#elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__) #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)
typedef SPi< P76, P75, P74, P10 > spi; typedef SPi< P76, P75, P74, P10 > spi;