diff --git a/Teensy.mk b/Teensy.mk index 43de891..3b9676d 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -1,18 +1,36 @@ ######################################################################## # -# To use you will need to uncomment these lines in, -# $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt +# Support for Teensy 3.x boards # -# teensy31.build.option6=-DUSB_SERIAL -# teensy31.build.option7=-DLAYOUT_US_ENGLISH +# https://www.pjrc.com/teensy/ # +# Example sketch: https://github.com/stepcut/teensy-blink +# +# Copyright (C) 2014 Jeremy Shaw based on +# work that is copyright Sudar, Nicholas Zambetti, David A. Mellis +# & Hernando Barragan. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# Adapted from Arduino 0011 Makefile by M J Oldfield +# +# Original Arduino adaptation by mellis, eighthave, oli.keller +# +# Current version: 1.3.4 +# +# Refer to HISTORY.md file for complete history of changes +# +######################################################################## VENDOR = teensy ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt ifndef F_CPU - F_CPU=72000000 + F_CPU=96000000 endif ifndef PARSE_TEENSY @@ -29,7 +47,7 @@ AVR_TOOLS_DIR = $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/$(ARCHITECTUR ifndef CC_NAME CC_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.gcc) ifndef CC_NAME - CC_NAME := avr-gcc + CC_NAME := arm-none-eabi-gcc else $(call show_config_variable,CC_NAME,[COMPUTED]) endif @@ -38,7 +56,7 @@ endif ifndef CXX_NAME CXX_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.g++) ifndef CXX_NAME - CXX_NAME := avr-g++ + CXX_NAME := arm-none-eabi-g++ else $(call show_config_variable,CXX_NAME,[COMPUTED]) endif @@ -56,7 +74,7 @@ endif ifndef OBJCOPY_NAME OBJCOPY_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objcopy) ifndef OBJCOPY_NAME - OBJCOPY_NAME := avr-objcopy + OBJCOPY_NAME := arm-none-eabi-objcopy else $(call show_config_variable,OBJCOPY_NAME,[COMPUTED]) endif @@ -65,7 +83,7 @@ endif ifndef OBJDUMP_NAME OBJDUMP_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objdump) ifndef OBJDUMP_NAME - OBJDUMP_NAME := avr-objdump + OBJDUMP_NAME := arm-none-eabi-objdump else $(call show_config_variable,OBJDUMP_NAME,[COMPUTED]) endif @@ -74,7 +92,7 @@ endif ifndef AR_NAME AR_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.ar) ifndef AR_NAME - AR_NAME := avr-ar + AR_NAME := arm-none-eabi-ar else $(call show_config_variable,AR_NAME,[COMPUTED]) endif @@ -83,7 +101,7 @@ endif ifndef SIZE_NAME SIZE_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.size) ifndef SIZE_NAME - SIZE_NAME := avr-size + SIZE_NAME := arm-none-eabi-size else $(call show_config_variable,SIZE_NAME,[COMPUTED]) endif @@ -129,10 +147,17 @@ ifneq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript)",) LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript) endif -MONITOR_PORT = /bin/true -AVRDUDE = true +######################################################################## +# some fairly odd settings so that 'make upload' works +# +# may require additional patches for Windows support -RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(abspath $(OBJDIR)) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot ; true +do_upload: override get_monitor_port="" +AVRDUDE=@true +RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(abspath $(OBJDIR)) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot + +######################################################################## +# automatially include Arduino.mk for the user ifndef ARDMK_DIR ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))