Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]

env:
IDE_VERSION: 1.8.19
TEENSY_VERSION: 159
TEENSY_VERSION: 160
IDE_LOCATION: /usr/local/share/arduino

jobs:
Expand All @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Install Arduino IDE
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is meant to be used in conjunction with the [ArduinoXInput library](https:/

You must have both [the Arduino IDE](https://www.arduino.cc/en/main/software) and [Teensyduino](https://www.pjrc.com/teensy/td_download.html) installed before proceeding.

Double-check that your installed Teensyduino version matches the files provided in this repository. This repository is currently using [**Teensyduino 1.59**](https://www.pjrc.com/teensy/td_159). You can download older versions on [the releases page](../../releases).
Double-check that your installed Teensyduino version matches the files provided in this repository. This repository is currently using [**Teensyduino 1.60**](https://www.pjrc.com/teensy/td_160). You can download older versions on [the releases page](../../releases).

If you don't know your Teensyduino version, compile a blank sketch with a Teensy board selected and the Teensy Loader will open. In the Teensy Loader window select `Help -> About` and it will tell you the version number. If your version does not match you will have to reinstall or update the Teensyduino software.

Expand Down
36 changes: 18 additions & 18 deletions teensy/avr/boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ teensy41.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdl
teensy41.build.flags.dep=-MMD
teensy41.build.flags.optimize=-Os
teensy41.build.flags.cpu=-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16
teensy41.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=159
teensy41.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing
teensy41.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=160
teensy41.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -Wno-psabi
teensy41.build.flags.c=
teensy41.build.flags.S=-x assembler-with-cpp
teensy41.build.flags.libs=-larm_cortexM7lfsp_math -lm -lstdc++
Expand Down Expand Up @@ -271,8 +271,8 @@ teensyMM.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdl
teensyMM.build.flags.dep=-MMD
teensyMM.build.flags.optimize=-Os
teensyMM.build.flags.cpu=-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16
teensyMM.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=159
teensyMM.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing
teensyMM.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=160
teensyMM.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -Wno-psabi
teensyMM.build.flags.c=
teensyMM.build.flags.S=-x assembler-with-cpp
teensyMM.build.flags.libs=-larm_cortexM7lfsp_math -lm -lstdc++
Expand Down Expand Up @@ -501,8 +501,8 @@ teensy40.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdl
teensy40.build.flags.dep=-MMD
teensy40.build.flags.optimize=-Os
teensy40.build.flags.cpu=-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16
teensy40.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=159
teensy40.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing
teensy40.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=160
teensy40.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -Wno-psabi
teensy40.build.flags.c=
teensy40.build.flags.S=-x assembler-with-cpp
teensy40.build.flags.libs=-larm_cortexM7lfsp_math -lm -lstdc++
Expand Down Expand Up @@ -727,8 +727,8 @@ teensy36.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdl
teensy36.build.flags.dep=-MMD
teensy36.build.flags.optimize=-Os
teensy36.build.flags.cpu=-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
teensy36.build.flags.defs=-D__MK66FX1M0__ -DTEENSYDUINO=159
teensy36.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti
teensy36.build.flags.defs=-D__MK66FX1M0__ -DTEENSYDUINO=160
teensy36.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -Wno-psabi
teensy36.build.flags.c=
teensy36.build.flags.S=-x assembler-with-cpp
teensy36.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk66fx1m0.ld"
Expand Down Expand Up @@ -967,8 +967,8 @@ teensy35.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdl
teensy35.build.flags.dep=-MMD
teensy35.build.flags.optimize=-Os
teensy35.build.flags.cpu=-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
teensy35.build.flags.defs=-D__MK64FX512__ -DTEENSYDUINO=159
teensy35.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti
teensy35.build.flags.defs=-D__MK64FX512__ -DTEENSYDUINO=160
teensy35.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -Wno-psabi
teensy35.build.flags.c=
teensy35.build.flags.S=-x assembler-with-cpp
teensy35.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk64fx512.ld"
Expand Down Expand Up @@ -1198,8 +1198,8 @@ teensy31.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdl
teensy31.build.flags.dep=-MMD
teensy31.build.flags.optimize=-Os
teensy31.build.flags.cpu=-mthumb -mcpu=cortex-m4 -fsingle-precision-constant
teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=159
teensy31.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti
teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=160
teensy31.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -Wno-psabi
teensy31.build.flags.c=
teensy31.build.flags.S=-x assembler-with-cpp
teensy31.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk20dx256.ld"
Expand Down Expand Up @@ -1439,8 +1439,8 @@ teensy30.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdl
teensy30.build.flags.dep=-MMD
teensy30.build.flags.optimize=-Os
teensy30.build.flags.cpu=-mthumb -mcpu=cortex-m4 -fsingle-precision-constant
teensy30.build.flags.defs=-D__MK20DX128__ -DTEENSYDUINO=159
teensy30.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti
teensy30.build.flags.defs=-D__MK20DX128__ -DTEENSYDUINO=160
teensy30.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -Wno-psabi
teensy30.build.flags.c=
teensy30.build.flags.S=-x assembler-with-cpp
teensy30.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk20dx128.ld"
Expand Down Expand Up @@ -1615,8 +1615,8 @@ teensyLC.build.command.size=arm-none-eabi-size
teensyLC.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access
teensyLC.build.flags.dep=-MMD
teensyLC.build.flags.cpu=-mthumb -mcpu=cortex-m0plus -fsingle-precision-constant
teensyLC.build.flags.defs=-D__MKL26Z64__ -DTEENSYDUINO=159
teensyLC.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti
teensyLC.build.flags.defs=-D__MKL26Z64__ -DTEENSYDUINO=160
teensyLC.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -Wno-psabi
teensyLC.build.flags.c=
teensyLC.build.flags.S=-x assembler-with-cpp
teensyLC.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mkl26z64.ld"
Expand Down Expand Up @@ -1790,7 +1790,7 @@ teensypp2.build.flags.common=-g -Wall -ffunction-sections -fdata-sections
teensypp2.build.flags.dep=-MMD
teensypp2.build.flags.optimize=-Os
teensypp2.build.flags.cpu=-mmcu=at90usb1286
teensypp2.build.flags.defs=-DTEENSYDUINO=159 -DARDUINO_ARCH_AVR
teensypp2.build.flags.defs=-DTEENSYDUINO=160 -DARDUINO_ARCH_AVR
teensypp2.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++11
teensypp2.build.flags.c=
teensypp2.build.flags.S=-x assembler-with-cpp
Expand Down Expand Up @@ -1918,7 +1918,7 @@ teensy2.build.flags.common=-g -Wall -ffunction-sections -fdata-sections
teensy2.build.flags.dep=-MMD
teensy2.build.flags.optimize=-Os
teensy2.build.flags.cpu=-mmcu=atmega32u4
teensy2.build.flags.defs=-DTEENSYDUINO=159 -DARDUINO_ARCH_AVR
teensy2.build.flags.defs=-DTEENSYDUINO=160 -DARDUINO_ARCH_AVR
teensy2.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++11
teensy2.build.flags.c=
teensy2.build.flags.S=-x assembler-with-cpp
Expand Down
2 changes: 1 addition & 1 deletion teensy/avr/cores/teensy4/WProgram.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include "usb_midi.h"
#include "usb_rawhid.h"
#include "usb_flightsim.h"
//#include "usb_mtp.h"
#include "MTP_Teensy.h"
#include "usb_audio.h"
#include "usb_touch.h"
//#include "usb_undef.h" // do not allow usb_desc.h stuff to leak to user programs
Expand Down
32 changes: 31 additions & 1 deletion teensy/avr/cores/teensy4/usb.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
/* Teensyduino Core Library
* http://www.pjrc.com/teensy/
* Copyright (c) 2019 PJRC.COM, LLC.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* 1. The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* 2. If the Software is incorporated into a build system that allows
* selection among a list of target devices, then similar target
* devices manufactured by PJRC.COM must be included in the list of
* target devices and selectable in the same manner.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#include "usb_dev.h"
#define USB_DESC_LIST_DEFINE
#include "usb_desc.h"
Expand Down Expand Up @@ -1097,7 +1127,7 @@ void usb_receive(int endpoint_number, transfer_t *transfer)

uint32_t usb_transfer_status(const transfer_t *transfer)
{
#if defined(USB_MTPDISK) || defined(USB_MTPDISK_SERIAL)
#if defined(MTP_INTERFACE)
uint32_t status, cmd;
//int count=0;
cmd = USB1_USBCMD;
Expand Down
13 changes: 13 additions & 0 deletions teensy/avr/cores/teensy4/usb_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ static uint8_t keyboard_report_desc[] = {
0x15, 0x00, // Logical Minimum (0),
0x25, 0x01, // Logical Maximum (1),
0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier keys
#if KEYBOARD_SIZE == 8
0x95, 0x01, // Report Count (1),
0x75, 0x08, // Report Size (8),
0x81, 0x03, // Input (Constant), ;Reserved byte
#endif
0x95, 0x05, // Report Count (5),
0x75, 0x01, // Report Size (1),
0x05, 0x08, // Usage Page (LEDs),
Expand All @@ -194,6 +196,7 @@ static uint8_t keyboard_report_desc[] = {
0x95, 0x01, // Report Count (1),
0x75, 0x03, // Report Size (3),
0x91, 0x03, // Output (Constant), ;LED report padding
#if KEYBOARD_SIZE == 8
0x95, 0x06, // Report Count (6),
0x75, 0x08, // Report Size (8),
0x15, 0x00, // Logical Minimum (0),
Expand All @@ -202,6 +205,16 @@ static uint8_t keyboard_report_desc[] = {
0x19, 0x00, // Usage Minimum (0),
0x29, 0x7F, // Usage Maximum (104),
0x81, 0x00, // Input (Data, Array), ;Normal keys
#elif KEYBOARD_SIZE == 16
0x95, 0x78, // Report Count (120),
0x75, 0x01, // Report Size (1),
0x19, 0x00, // Usage Minimum (0),
0x29, 0xE7, // Usage Maximum (119),
0x05, 0x07, // Usage Page (Key Codes),
0x15, 0x00, // Logical Minimum (0),
0x25, 0x01, // Logical Maximum (1),
0x81, 0x02, // Input (Data, Variable, Absolute), ;Normal keys NKRO
#endif
0xC0 // End Collection
};
#endif
Expand Down
12 changes: 6 additions & 6 deletions teensy/avr/cores/teensy4/usb_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define SEREMU_RX_INTERVAL 2 // TODO: is this ok for 480 Mbit speed
#define KEYBOARD_INTERFACE 0 // Keyboard
#define KEYBOARD_ENDPOINT 3
#define KEYBOARD_SIZE 8
#define KEYBOARD_SIZE 8 // 8 = normal boot protocol, 16 = NKRO
#define KEYBOARD_INTERVAL 1 // TODO: is this ok for 480 Mbit speed
#define KEYMEDIA_INTERFACE 2 // Keyboard Media Keys
#define KEYMEDIA_ENDPOINT 4
Expand Down Expand Up @@ -257,7 +257,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define SEREMU_RX_INTERVAL 2
#define KEYBOARD_INTERFACE 0 // Keyboard
#define KEYBOARD_ENDPOINT 3
#define KEYBOARD_SIZE 8
#define KEYBOARD_SIZE 8 // 8 = normal boot protocol, 16 = NKRO
#define KEYBOARD_INTERVAL 1
#define KEYMEDIA_INTERFACE 4 // Keyboard Media Keys
#define KEYMEDIA_ENDPOINT 4
Expand Down Expand Up @@ -303,7 +303,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define CDC_TX_SIZE_12 64
#define KEYBOARD_INTERFACE 2 // Keyboard
#define KEYBOARD_ENDPOINT 4
#define KEYBOARD_SIZE 8
#define KEYBOARD_SIZE 8 // 8 = normal boot protocol, 16 = NKRO
#define KEYBOARD_INTERVAL 1
#define KEYMEDIA_INTERFACE 5 // Keyboard Media Keys
#define KEYMEDIA_ENDPOINT 5
Expand Down Expand Up @@ -343,7 +343,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define SEREMU_RX_INTERVAL 2
#define KEYBOARD_INTERFACE 0 // Keyboard
#define KEYBOARD_ENDPOINT 3
#define KEYBOARD_SIZE 8
#define KEYBOARD_SIZE 8 // 8 = normal boot protocol, 16 = NKRO
#define KEYBOARD_INTERVAL 1
#define KEYMEDIA_INTERFACE 2 // Keyboard Media Keys
#define KEYMEDIA_ENDPOINT 4
Expand Down Expand Up @@ -377,7 +377,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define SEREMU_RX_INTERVAL 2
#define KEYBOARD_INTERFACE 0 // Keyboard
#define KEYBOARD_ENDPOINT 3
#define KEYBOARD_SIZE 8
#define KEYBOARD_SIZE 8 // 8 = normal boot protocol, 16 = NKRO
#define KEYBOARD_INTERVAL 1
#define KEYMEDIA_INTERFACE 3 // Keyboard Media Keys
#define KEYMEDIA_ENDPOINT 4
Expand Down Expand Up @@ -885,7 +885,7 @@ let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
#define MIDI_RX_SIZE 64
#define KEYBOARD_INTERFACE 3 // Keyboard
#define KEYBOARD_ENDPOINT 4
#define KEYBOARD_SIZE 8
#define KEYBOARD_SIZE 8 // 8 = normal boot protocol, 16 = NKRO
#define KEYBOARD_INTERVAL 1
#define MOUSE_INTERFACE 4 // Mouse
#define MOUSE_ENDPOINT 5
Expand Down
2 changes: 1 addition & 1 deletion teensy/avr/cores/teensy4/usb_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class usb_serial_class : public Stream
};

extern usb_serial_class Serial;
extern void serialEvent(void) __attribute__((weak));
extern void serialEvent(void) __attribute__((weak)); // required for XInput compatibility
#endif // __cplusplus

#endif // !defined(USB_DISABLED)
Expand Down