diff --git a/left/Makefile b/left/Makefile index 2e4b524..87cabf4 100644 --- a/left/Makefile +++ b/left/Makefile @@ -30,6 +30,9 @@ STACK_SIZE = 0x0050 CPU = -mcpu=cortex-m0plus FPU = -mfloat-abi=soft +# Command for flashing the left half of the keyboard. +FLASH_CMD = node ../lib/agent/packages/usb/update-module-firmware.js leftHalf $(PROJECT_OBJ:.axf=.bin) + # Source files. SOURCE = $(wildcard src/*.c) \ ../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/system_MKL03Z4.c \ diff --git a/right/Makefile b/right/Makefile index f6ef801..e0107cf 100644 --- a/right/Makefile +++ b/right/Makefile @@ -36,6 +36,9 @@ BUILD_FLAGS = -DCPU_$(PART)_cm4 -DBL_APP_VECTOR_TABLE_ADDRESS=$(BL_APP_VECTOR_TA CPU = -mcpu=cortex-m4 FPU = -mfpu=fpv4-sp-d16 -mfloat-abi=hard +# Command for flashing the right half of the keyboard. +FLASH_CMD = node ../lib/agent/packages/usb/update-device-firmware.js $(PROJECT_OBJ:.axf=.hex) + # Source files. SOURCE = $(wildcard src/*.c) \ $(wildcard src/*/*.c) \ diff --git a/scripts/Makedefs.mk b/scripts/Makedefs.mk index 98fc69f..f01f6fc 100644 --- a/scripts/Makedefs.mk +++ b/scripts/Makedefs.mk @@ -150,7 +150,7 @@ ifeq ($(INTERACTIVE),1) color_purple = \033[38;5;097m endif -.PHONY: all clean +.PHONY: all clean flash # The default rule, which causes the project to be built. all: $(PROJECT_OBJ) @@ -160,6 +160,9 @@ clean: @rm -rf $(BUILD_DIR) $(wildcard *~) @echo "$(color_red)Done cleaning!$(color_default)" +flash: all + @$(FLASH_CMD) || exit 1 + # Rebuild all objects when the Makefile changes. $(OBJS): Makefile