From d535bf5fde2d49b190913e858ce644c1a50c3c40 Mon Sep 17 00:00:00 2001 From: poofjunior Date: Fri, 23 Jan 2015 15:40:53 +0530 Subject: [PATCH] Ability to modify USB_TYPE in Teensy.md See #313 --- HISTORY.md | 3 ++- Teensy.mk | 6 +++++- arduino-mk-vars.md | 26 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f879f2d..2248d50 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -18,7 +18,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - New: Add support for installation using homebrew(https://github.com/ladislas) - New: Add support and example for flashing on a remote RPi. (https://github.com/Gaboose) -- Tweak: Update Malefile-example.mk with STD flags (https://github.com/ladislas) +- Tweak: Update Makefile-example.mk with STD flags (https://github.com/ladislas) - Tweak: Allow remove of any OBJDIR with `$(REMOVE) $(OBJDIR)`. (https://github.com/ladislas) - Tweak: Add cpp to extensions supported by "make generate_assembly". (https://github.com/sej7278) - Tweak: Update travis-ci to test against Arduino 1.0.6. (https://github.com/sej7278) @@ -27,6 +27,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Tweak: Moved location of avrdude for 1.5.8 on Linux (Issue #301) (https://github.com/sej7278) - Tweak: Allow 'build.core' param as found in [arduino-tiny](https://code.google.com/p/arduino-tiny/) Prospective Boards.txt. (https://github.com/Gaboose) - Tweak: Replace CXX_NAME with CXX as per the Emacs Flymake Wiki (Issue #309) (https://github.com/sej7278) +- Tweak: Ability to override `USB_TYPE` in Teensy.md (Issue #313) (https://github.com/Poofjunior) - Fix: Improved Windows (Cygwin/MSYS) support (https://github.com/PeterMosmans) - Fix: Change "tinyladi" username to "ladislas" in HISTORY.md. (https://github.com/ladislas) diff --git a/Teensy.mk b/Teensy.mk index dc807a8..8a441e7 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -135,8 +135,12 @@ endif ######################################################################## # FLAGS +ifndef USB_TYPE + USB_TYPE = USB_SERIAL +endif + +CPPFLAGS += -DLAYOUT_US_ENGLISH -D$(USB_TYPE) -CPPFLAGS += -DLAYOUT_US_ENGLISH -DUSB_SERIAL CPPFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.option) CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.cppoption) diff --git a/arduino-mk-vars.md b/arduino-mk-vars.md index 4003a6c..f961177 100644 --- a/arduino-mk-vars.md +++ b/arduino-mk-vars.md @@ -452,6 +452,32 @@ VARIANT = leonardo ---- +### USB_TYPE + +**Description:** + +Define Teensy 3.1 usb device type. Default is USB_SERIAL + +**Example:** + +```Makefile +USB_TYPE = USB_SERIAL +# or +USB_TYPE = USB_HID +# or +USB_TYPE = USB_SERIAL_HID +# or +USB_TYPE = USB_MIDI +# or +USB_TYPE = USB_RAWHID +# or +USB_TYPE = USB_FLIGHTSIM +``` + +**Requirement:** *Optional* + +---- + ### USB_VID **Description:**