From d6887bd9b5f73ffb7eb7531ed1db77ce4ea7402b Mon Sep 17 00:00:00 2001 From: David Madison Date: Mon, 11 Mar 2019 02:41:04 -0400 Subject: [PATCH] Teensyduino 1.45 Compatibility --- README.md | 2 +- teensy/avr/boards.txt | 16 +++++++++------- teensy/avr/cores/teensy3/usb_dev.c | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7e864ba..1494aa6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is meant to be used in conjunction with the [ArduinoXInput library](https:/ ## Installation -You must have both [Arduino](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 version [**1.44**](https://www.pjrc.com/teensy/td_144). 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. +You must have both [Arduino](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 version [**1.45**](https://www.pjrc.com/teensy/td_145). 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. Navigate to your Arduino installation directory and open up the 'hardware' folder. It is recommended that you make a backup of this folder before proceeding in case something goes wrong or if you want to revert the installation. diff --git a/teensy/avr/boards.txt b/teensy/avr/boards.txt index 150560b..017ced4 100644 --- a/teensy/avr/boards.txt +++ b/teensy/avr/boards.txt @@ -23,7 +23,7 @@ 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=144 +teensy36.build.flags.defs=-D__MK66FX1M0__ -DTEENSYDUINO=145 teensy36.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti teensy36.build.flags.c= teensy36.build.flags.S=-x assembler-with-cpp @@ -103,6 +103,8 @@ teensy36.menu.speed.2=2 MHz (No USB) teensy36.menu.speed.192=192 MHz (overclock) teensy36.menu.speed.216=216 MHz (overclock) teensy36.menu.speed.240=240 MHz (overclock) +#teensy36.menu.speed.256=256 MHz (overclock) +#teensy36.menu.speed.256.build.fcpu=256000000 teensy36.menu.speed.240.build.fcpu=240000000 teensy36.menu.speed.216.build.fcpu=216000000 teensy36.menu.speed.192.build.fcpu=192000000 @@ -228,7 +230,7 @@ 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=144 +teensy35.build.flags.defs=-D__MK64FX512__ -DTEENSYDUINO=145 teensy35.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti teensy35.build.flags.c= teensy35.build.flags.S=-x assembler-with-cpp @@ -425,7 +427,7 @@ 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=144 +teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=145 teensy31.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti teensy31.build.flags.c= teensy31.build.flags.S=-x assembler-with-cpp @@ -633,7 +635,7 @@ 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=144 +teensy30.build.flags.defs=-D__MK20DX128__ -DTEENSYDUINO=145 teensy30.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti teensy30.build.flags.c= teensy30.build.flags.S=-x assembler-with-cpp @@ -791,7 +793,7 @@ teensyLC.build.command.size=arm-none-eabi-size teensyLC.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib teensyLC.build.flags.dep=-MMD teensyLC.build.flags.cpu=-mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -teensyLC.build.flags.defs=-D__MKL26Z64__ -DTEENSYDUINO=144 +teensyLC.build.flags.defs=-D__MKL26Z64__ -DTEENSYDUINO=145 teensyLC.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti teensyLC.build.flags.c= teensyLC.build.flags.S=-x assembler-with-cpp @@ -944,7 +946,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=144 -DARDUINO_ARCH_AVR +teensypp2.build.flags.defs=-DTEENSYDUINO=145 -DARDUINO_ARCH_AVR teensypp2.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++11 teensypp2.build.flags.c= teensypp2.build.flags.S=-x assembler-with-cpp @@ -1060,7 +1062,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=144 -DARDUINO_ARCH_AVR +teensy2.build.flags.defs=-DTEENSYDUINO=145 -DARDUINO_ARCH_AVR teensy2.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++11 teensy2.build.flags.c= teensy2.build.flags.S=-x assembler-with-cpp diff --git a/teensy/avr/cores/teensy3/usb_dev.c b/teensy/avr/cores/teensy3/usb_dev.c index 8d4185d..73367a8 100644 --- a/teensy/avr/cores/teensy3/usb_dev.c +++ b/teensy/avr/cores/teensy3/usb_dev.c @@ -1136,7 +1136,7 @@ void usb_init(void) #ifdef HAS_KINETIS_MPU MPU_RGDAAC0 |= 0x03000000; #endif -#if F_CPU == 180000000 || F_CPU == 216000000 +#if F_CPU == 180000000 || F_CPU == 216000000 || F_CPU == 256000000 // if using IRC48M, turn on the USB clock recovery hardware USB0_CLK_RECOVER_IRC_EN = USB_CLK_RECOVER_IRC_EN_IRC_EN | USB_CLK_RECOVER_IRC_EN_REG_EN; USB0_CLK_RECOVER_CTRL = USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN |