From 7c96df33be0fc8f66aa66217202d4485fabbb0e1 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 16 Nov 2020 12:44:24 -0800 Subject: [PATCH] fix variable setting for flashing --- etc/makefiles/sketch.mk | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index b4b5f09b..4ae9996f 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -1,5 +1,6 @@ mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) mkfile_dir := $(dir $(mkfile_path)) + include $(mkfile_dir)/arduino-cli.mk # Build path config @@ -83,6 +84,16 @@ AVR_OBJCOPY := ${COMPILER_PATH}/${COMPILER_PREFIX}objcopy AVR_NM := ${COMPILER_PATH}/${COMPILER_PREFIX}nm AVR_SIZE := ${COMPILER_PATH}/${COMPILER_PREFIX}size +# Flashing related config + +flashing_instructions := $(call _arduino_prop,build.flashing_instructions) +ifeq ($(flashing_instructions),) +flashing_instruction := "If your keyboard needs you to do something to put it in flashing mode, do that now." +endif + +port := $(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) |cut -d' ' -f 1) + + $(SKETCH_FILE_PATH): @echo "Sketch is $(SKETCH_FILE_PATH)" @@ -154,11 +165,6 @@ endif #but it's short some of the data we kind of need flash: - flashing_instructions := $(call _arduino_prop,build.flashing_instructions) -ifeq ($(flashing_instructions),) - flashing_instructions := "If your keyboard needs you to do something to put it in flashing mode, do that now." -endif - port = $(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) |cut -d' ' -f 1) ifeq ($(port),) $(info Unable to detect keyboard serial port.) #@exit 1