diff --git a/.travis.yml b/.travis.yml index afd87022..b9c00915 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,6 +74,6 @@ install: - platformio lib install 62 416 417 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 - platformio ci --lib="." --board=esp12e --board=nodemcu diff --git a/avrpins.h b/avrpins.h index 41b11abd..8f329fa4 100644 --- a/avrpins.h +++ b/avrpins.h @@ -1167,6 +1167,58 @@ MAKE_PIN(P19, GPIOC, GPIO_PIN_0); // A5 #endif +#elif defined(__ARDUINO_ARC__) + +#include +// 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 #include diff --git a/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino b/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino index db8faadb..d5e3f1db 100644 --- a/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino +++ b/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino @@ -69,7 +69,11 @@ void MIDI_poll() pid = Midi.pid; } 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()); +#endif Serial.print(buf); Serial.print(rcvd); Serial.print(':'); diff --git a/usbhost.h b/usbhost.h index 85e0ceb9..62e4fbb2 100644 --- a/usbhost.h +++ b/usbhost.h @@ -103,7 +103,7 @@ typedef SPi< Pb1, Pb2, Pb3, Pb0 > spi; typedef SPi< Pb5, Pb3, Pb4, Pb2 > spi; #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) 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; #elif defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__) typedef SPi< P76, P75, P74, P10 > spi;