From 43995f96b1554668e8b54a2dba2ae99c6fc107df Mon Sep 17 00:00:00 2001 From: Baciu Vlad-Eusebiu Date: Mon, 11 Dec 2023 23:53:36 +0200 Subject: [PATCH 1/6] Update Teensy.mk to determine a windows-like hex path --- Teensy.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Teensy.mk b/Teensy.mk index 35107ac1..791ede55 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -36,6 +36,7 @@ include $(ARDMK_DIR)/Common.mk ARDMK_VENDOR = teensy ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/avr/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/boards.txt +HEX_PATH = $(shell cygpath -w $(abspath $(OBJDIR))) ifndef F_CPU @@ -128,7 +129,7 @@ MCU := $(shell echo ${CPUFLAGS} | sed -n -e 's/.*-mcpu=\([a-zA-Z0-9_-]*\).*/\1/p 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 +RESET_CMD = $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(HEX_PATH) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot ######################################################################## # automatially include Arduino.mk for the user From f131b9a21994ae1bba5231ab442e0e1031ec486e Mon Sep 17 00:00:00 2001 From: Baciu Vlad-Eusebiu Date: Tue, 12 Dec 2023 00:06:41 +0200 Subject: [PATCH 2/6] Update Teensy.mk --- Teensy.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Teensy.mk b/Teensy.mk index 791ede55..c67eea72 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -36,7 +36,7 @@ include $(ARDMK_DIR)/Common.mk ARDMK_VENDOR = teensy ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/avr/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/boards.txt -HEX_PATH = $(shell cygpath -w $(abspath $(OBJDIR))) +HEX_PATH := $(wildcard $(shell cygpath -w $(abspath $(OBJDIR)))) ifndef F_CPU From 26f49be75bd5db3d4c0b2f0ef9f3ee373589d2a1 Mon Sep 17 00:00:00 2001 From: Baciu Vlad-Eusebiu Date: Tue, 12 Dec 2023 00:31:51 +0200 Subject: [PATCH 3/6] Update Teensy.mk --- Teensy.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Teensy.mk b/Teensy.mk index c67eea72..6d58a542 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -36,8 +36,10 @@ include $(ARDMK_DIR)/Common.mk ARDMK_VENDOR = teensy ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/avr/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/boards.txt -HEX_PATH := $(wildcard $(shell cygpath -w $(abspath $(OBJDIR)))) +# get hex path from the build directory. if path is cygwin based (cygdrive/path/example/), just discard cygwin root when calling Windows-native applications +UNAME := $(shell uname) +HEX_PATH := $(if $(findstring CYGWIN,$(UNAME)),$(subst cygdrive/,,$(OBJDIR)),$(OBJDIR)) ifndef F_CPU ifndef BOARD_SUB From ba44ea44deca4db378d40bf3b4535840d8ce4832 Mon Sep 17 00:00:00 2001 From: Baciu Vlad-Eusebiu Date: Tue, 12 Dec 2023 01:12:54 +0200 Subject: [PATCH 4/6] Update Teensy.mk --- Teensy.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Teensy.mk b/Teensy.mk index 6d58a542..fd3b148c 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -38,8 +38,13 @@ ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/avr/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/boards.txt # get hex path from the build directory. if path is cygwin based (cygdrive/path/example/), just discard cygwin root when calling Windows-native applications -UNAME := $(shell uname) -HEX_PATH := $(if $(findstring CYGWIN,$(UNAME)),$(subst cygdrive/,,$(OBJDIR)),$(OBJDIR)) +ifeq ($(shell uname | grep -c "CYGWIN"), 1) + HEX_PATH = $(shell cygpath -w $(abspath $(OBJDIR))) + HEX_PATH := $(subst \,/, $(HEX_PATH)) +else + # Default for non-Cygwin environments + HEX_PATH = $(abspath $(OBJDIR)) +endif ifndef F_CPU ifndef BOARD_SUB From 24de547620877db431476e3a258437d51ca4b64f Mon Sep 17 00:00:00 2001 From: Baciu Vlad-Eusebiu Date: Tue, 12 Dec 2023 01:14:52 +0200 Subject: [PATCH 5/6] Update Teensy.mk --- Teensy.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Teensy.mk b/Teensy.mk index fd3b148c..5936990d 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -136,7 +136,7 @@ MCU := $(shell echo ${CPUFLAGS} | sed -n -e 's/.*-mcpu=\([a-zA-Z0-9_-]*\).*/\1/p do_upload: override get_monitor_port="" AVRDUDE=@true -RESET_CMD = $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(HEX_PATH) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot +RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(HEX_PATH) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot ######################################################################## # automatially include Arduino.mk for the user From 414d1cc553051843577c742803f66b9b51a11035 Mon Sep 17 00:00:00 2001 From: Baciu Vlad-Eusebiu Date: Tue, 12 Dec 2023 01:50:16 +0200 Subject: [PATCH 6/6] Add windows-like buid path --- Teensy.mk | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Teensy.mk b/Teensy.mk index 5936990d..9dce1313 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -37,15 +37,6 @@ ARDMK_VENDOR = teensy ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/avr/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/boards.txt -# get hex path from the build directory. if path is cygwin based (cygdrive/path/example/), just discard cygwin root when calling Windows-native applications -ifeq ($(shell uname | grep -c "CYGWIN"), 1) - HEX_PATH = $(shell cygpath -w $(abspath $(OBJDIR))) - HEX_PATH := $(subst \,/, $(HEX_PATH)) -else - # Default for non-Cygwin environments - HEX_PATH = $(abspath $(OBJDIR)) -endif - ifndef F_CPU ifndef BOARD_SUB SPEEDS := $(call PARSE_BOARD,"$(BOARD_TAG),menu.speed.*.build.fcpu") # Obtain sequence of supported frequencies. @@ -136,7 +127,15 @@ MCU := $(shell echo ${CPUFLAGS} | sed -n -e 's/.*-mcpu=\([a-zA-Z0-9_-]*\).*/\1/p 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=$(HEX_PATH) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot + +ifeq ($(shell uname | grep -c "CYGWIN"), 1) + OBJ_BUILD_PATH = "$(shell cygpath -w $(abspath $(OBJDIR)))" +else + # Default for non-Cygwin environments + OBJ_BUILD_PATH = $(abspath $(OBJDIR)) +endif + +RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(OBJ_BUILD_PATH) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot ######################################################################## # automatially include Arduino.mk for the user