diff --git a/.travis.yml b/.travis.yml index 225e1c66..e716679e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,4 +74,4 @@ install: - platformio lib install 62 416 417 script: - - platformio ci --board=uno --board=teensy31 --board=due --board=esp12e --board=nodemcu --lib="." + - platformio ci --board=uno --board=due --board=teensy30 --board=teensy31 --board=teensy35 --board=teensy36 --board=teensylc --board=esp12e --board=nodemcu --lib="." diff --git a/UsbCore.h b/UsbCore.h index f9fc6641..3374b640 100644 --- a/UsbCore.h +++ b/UsbCore.h @@ -42,7 +42,7 @@ typedef MAX3421e MAX3421E; // The Intel Galileo supports much faster rea #elif defined(ESP8266) typedef MAX3421e MAX3421E; // ESP8266 boards #else -typedef MAX3421e MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo, Due etc.), Intel Edison, Intel Galileo 2 or Teensy 2.0 and 3.0 +typedef MAX3421e MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo, Due etc.), Intel Edison, Intel Galileo 2 or Teensy 2.0 and 3.x #endif /* Common setup data constant combinations */ diff --git a/XBOXONE.cpp b/XBOXONE.cpp index 0698a6aa..d3f1fd77 100644 --- a/XBOXONE.cpp +++ b/XBOXONE.cpp @@ -260,9 +260,9 @@ void XBOXONE::readReport() { if(readBuf[0] == 0x07) { // The XBOX button has a separate message if(readBuf[4] == 1) - ButtonState |= XBOX_BUTTONS[XBOX]; + ButtonState |= pgm_read_word(&XBOX_BUTTONS[XBOX]); else - ButtonState &= ~XBOX_BUTTONS[XBOX]; + ButtonState &= ~pgm_read_word(&XBOX_BUTTONS[XBOX]); } if(readBuf[0] != 0x20) { // Check if it's the correct report, otherwise return - the controller also sends different status reports #ifdef EXTRADEBUG @@ -272,7 +272,7 @@ void XBOXONE::readReport() { return; } - uint16_t xbox = ButtonState & XBOX_BUTTONS[XBOX]; // Since the XBOX button is separate, save it and add it back in + uint16_t xbox = ButtonState & pgm_read_word(&XBOX_BUTTONS[XBOX]); // Since the XBOX button is separate, save it and add it back in // xbox button from before, dpad, abxy, start/back, sync, stick click, shoulder buttons ButtonState = xbox | (((uint16_t)readBuf[5] & 0xF) << 8) | (readBuf[4] & 0xF0) | (((uint16_t)readBuf[4] & 0x0C) << 10) | ((readBuf[4] & 0x01) << 3) | (((uint16_t)readBuf[5] & 0xC0) << 8) | ((readBuf[5] & 0x30) >> 4); diff --git a/avrpins.h b/avrpins.h index 76445e47..41b11abd 100644 --- a/avrpins.h +++ b/avrpins.h @@ -768,7 +768,7 @@ public: // pointers are 32 bits on ARM #define pgm_read_pointer(p) pgm_read_dword(p) -#if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__)) +#if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)) #include "core_pins.h" #include "avr_emulation.h" @@ -832,6 +832,38 @@ MAKE_PIN(P30, CORE_PIN30_PORTREG, CORE_PIN30_BIT, CORE_PIN30_CONFIG); MAKE_PIN(P31, CORE_PIN31_PORTREG, CORE_PIN31_BIT, CORE_PIN31_CONFIG); MAKE_PIN(P32, CORE_PIN32_PORTREG, CORE_PIN32_BIT, CORE_PIN32_CONFIG); MAKE_PIN(P33, CORE_PIN33_PORTREG, CORE_PIN33_BIT, CORE_PIN33_CONFIG); +#if defined(__MK64FX512__) || defined(__MK66FX1M0__) +MAKE_PIN(P34, CORE_PIN34_PORTREG, CORE_PIN34_BIT, CORE_PIN34_CONFIG); +MAKE_PIN(P35, CORE_PIN35_PORTREG, CORE_PIN35_BIT, CORE_PIN35_CONFIG); +MAKE_PIN(P36, CORE_PIN36_PORTREG, CORE_PIN36_BIT, CORE_PIN36_CONFIG); +MAKE_PIN(P37, CORE_PIN37_PORTREG, CORE_PIN37_BIT, CORE_PIN37_CONFIG); +MAKE_PIN(P38, CORE_PIN38_PORTREG, CORE_PIN38_BIT, CORE_PIN38_CONFIG); +MAKE_PIN(P39, CORE_PIN39_PORTREG, CORE_PIN39_BIT, CORE_PIN39_CONFIG); +MAKE_PIN(P40, CORE_PIN40_PORTREG, CORE_PIN40_BIT, CORE_PIN40_CONFIG); +MAKE_PIN(P41, CORE_PIN41_PORTREG, CORE_PIN41_BIT, CORE_PIN41_CONFIG); +MAKE_PIN(P42, CORE_PIN42_PORTREG, CORE_PIN42_BIT, CORE_PIN42_CONFIG); +MAKE_PIN(P43, CORE_PIN43_PORTREG, CORE_PIN43_BIT, CORE_PIN43_CONFIG); +MAKE_PIN(P44, CORE_PIN44_PORTREG, CORE_PIN44_BIT, CORE_PIN44_CONFIG); +MAKE_PIN(P45, CORE_PIN45_PORTREG, CORE_PIN45_BIT, CORE_PIN45_CONFIG); +MAKE_PIN(P46, CORE_PIN46_PORTREG, CORE_PIN46_BIT, CORE_PIN46_CONFIG); +MAKE_PIN(P47, CORE_PIN47_PORTREG, CORE_PIN47_BIT, CORE_PIN47_CONFIG); +MAKE_PIN(P48, CORE_PIN48_PORTREG, CORE_PIN48_BIT, CORE_PIN48_CONFIG); +MAKE_PIN(P49, CORE_PIN49_PORTREG, CORE_PIN49_BIT, CORE_PIN49_CONFIG); +MAKE_PIN(P50, CORE_PIN50_PORTREG, CORE_PIN50_BIT, CORE_PIN50_CONFIG); +MAKE_PIN(P51, CORE_PIN51_PORTREG, CORE_PIN51_BIT, CORE_PIN51_CONFIG); +MAKE_PIN(P52, CORE_PIN52_PORTREG, CORE_PIN52_BIT, CORE_PIN52_CONFIG); +MAKE_PIN(P53, CORE_PIN53_PORTREG, CORE_PIN53_BIT, CORE_PIN53_CONFIG); +MAKE_PIN(P54, CORE_PIN54_PORTREG, CORE_PIN54_BIT, CORE_PIN54_CONFIG); +MAKE_PIN(P55, CORE_PIN55_PORTREG, CORE_PIN55_BIT, CORE_PIN55_CONFIG); +MAKE_PIN(P56, CORE_PIN56_PORTREG, CORE_PIN56_BIT, CORE_PIN56_CONFIG); +MAKE_PIN(P57, CORE_PIN57_PORTREG, CORE_PIN57_BIT, CORE_PIN57_CONFIG); +MAKE_PIN(P58, CORE_PIN58_PORTREG, CORE_PIN58_BIT, CORE_PIN58_CONFIG); +MAKE_PIN(P59, CORE_PIN59_PORTREG, CORE_PIN59_BIT, CORE_PIN59_CONFIG); +MAKE_PIN(P60, CORE_PIN60_PORTREG, CORE_PIN60_BIT, CORE_PIN60_CONFIG); +MAKE_PIN(P61, CORE_PIN61_PORTREG, CORE_PIN61_BIT, CORE_PIN61_CONFIG); +MAKE_PIN(P62, CORE_PIN62_PORTREG, CORE_PIN62_BIT, CORE_PIN62_CONFIG); +MAKE_PIN(P63, CORE_PIN63_PORTREG, CORE_PIN63_BIT, CORE_PIN63_CONFIG); +#endif #undef MAKE_PIN diff --git a/settings.h b/settings.h index 068bceba..804725a4 100644 --- a/settings.h +++ b/settings.h @@ -71,8 +71,8 @@ e-mail : support@circuitsathome.com #define USE_SPI4TEENSY3 1 #endif -// disabled on the Teensy LC as it is incompatible for now -#if defined(__MKL26Z64__) +// Disabled on the Teensy LC, Teensy 3.5, and Teensy 3.6 as it is incompatible for now +#if defined(__MKL26Z64__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) #undef USE_SPI4TEENSY3 #define USE_SPI4TEENSY3 0 #endif @@ -129,7 +129,7 @@ e-mail : support@circuitsathome.com #define EXT_RAM 0 #endif -#if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__)) +#if defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__MKL26Z64__)) #define USING_SPI4TEENSY3 USE_SPI4TEENSY3 #else #define USING_SPI4TEENSY3 0 diff --git a/usbhost.h b/usbhost.h index 6eb8d663..85e0ceb9 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(__MKL26Z64__))) || defined(__ARDUINO_X86__) || defined(__MIPSEL__) || defined(STM32F4) +#elif (defined(CORE_TEENSY) && (defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__MKL26Z64__))) || 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;