Skip to content

Commit

Permalink
filter options from FQBN when searching for board
Browse files Browse the repository at this point in the history
This allows sketch.yaml to set menu options, e.g., debug options, while
not interfering with automatically finding the board.

Signed-off-by: Taylor Yu <[email protected]>
  • Loading branch information
tlyu authored and obra committed Dec 24, 2024
1 parent d762fd6 commit 72a0d20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion etc/makefiles/sketch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ endif

flashing_instructions = $(call _arduino_prop,build.flashing_instructions)

# Filter out board options from FQBN because board list omits them
fqbn_no_opts := $(shell echo $(FQBN) | sed 's/:[a-z_][0-9a-z_.]*=.*$$//')

flash: ${HEX_FILE_PATH}
ifneq ($(flashing_instructions),)
$(info $(shell printf $(flashing_instructions)))
Expand All @@ -215,6 +218,6 @@ endif
$(info )
@$(shell read _)
$(QUIET) $(ARDUINO_CLI) upload --fqbn $(FQBN) \
$(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) | awk '{ print "--port", $$1; exit }' ) \
$(shell $(ARDUINO_CLI) board list --format=text | grep $(fqbn_no_opts) | awk '{ print "--port", $$1; exit }' ) \
--input-dir "${OUTPUT_PATH}" \
$(ARDUINO_VERBOSE)

0 comments on commit 72a0d20

Please sign in to comment.