Skip to content

Commit 5a83288

Browse files
authored
Merge pull request #437 from straccio/master
Search in submenu chip or cpu for vars
2 parents b971b05 + 8addd6c commit 5a83288

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Arduino.mk

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ endif
572572

573573
ifndef PARSE_BOARD
574574
# result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
575-
PARSE_BOARD = $(shell grep -v '^\#' $(BOARDS_TXT) | grep "^[ \t]*$(1).$(2)=" | cut -d = -f 2)
575+
PARSE_BOARD = $(shell grep -Ev '^\#' $(BOARDS_TXT) | grep -E "^[ \t]*$(1).$(2)=" | cut -d = -f 2)
576576
endif
577577

578578
# If NO_CORE is set, then we don't have to parse boards.txt file
@@ -591,7 +591,7 @@ ifeq ($(strip $(NO_CORE)),)
591591

592592
# Which variant ? This affects the include path
593593
ifndef VARIANT
594-
VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.variant)
594+
VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.variant)
595595
ifndef VARIANT
596596
VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),build.variant)
597597
endif
@@ -601,7 +601,7 @@ ifeq ($(strip $(NO_CORE)),)
601601
endif
602602

603603
# see if we are a caterina device like leonardo or micro
604-
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file))
604+
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.file))
605605
ifndef CATERINA
606606
# 1.5+ method if not a submenu
607607
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.file))
@@ -613,14 +613,14 @@ ifeq ($(strip $(NO_CORE)),)
613613

614614
# processor stuff
615615
ifndef MCU
616-
MCU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.mcu)
616+
MCU := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.mcu)
617617
ifndef MCU
618618
MCU := $(call PARSE_BOARD,$(BOARD_TAG),build.mcu)
619619
endif
620620
endif
621621

622622
ifndef F_CPU
623-
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.f_cpu)
623+
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.f_cpu)
624624
ifndef F_CPU
625625
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),build.f_cpu)
626626
endif
@@ -639,14 +639,14 @@ ifeq ($(strip $(NO_CORE)),)
639639

640640
# normal programming info
641641
ifndef AVRDUDE_ARD_PROGRAMMER
642-
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.protocol)
642+
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).upload.protocol)
643643
ifndef AVRDUDE_ARD_PROGRAMMER
644644
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),upload.protocol)
645645
endif
646646
endif
647647

648648
ifndef AVRDUDE_ARD_BAUDRATE
649-
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.speed)
649+
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).upload.speed)
650650
ifndef AVRDUDE_ARD_BAUDRATE
651651
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),upload.speed)
652652
endif
@@ -658,21 +658,21 @@ ifeq ($(strip $(NO_CORE)),)
658658
endif
659659

660660
ifndef ISP_HIGH_FUSE
661-
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.high_fuses)
661+
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.high_fuses)
662662
ifndef ISP_HIGH_FUSE
663663
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.high_fuses)
664664
endif
665665
endif
666666

667667
ifndef ISP_LOW_FUSE
668-
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.low_fuses)
668+
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.low_fuses)
669669
ifndef ISP_LOW_FUSE
670670
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.low_fuses)
671671
endif
672672
endif
673673

674674
ifndef ISP_EXT_FUSE
675-
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.extended_fuses)
675+
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.extended_fuses)
676676
ifndef ISP_EXT_FUSE
677677
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.extended_fuses)
678678
endif
@@ -683,7 +683,7 @@ ifeq ($(strip $(NO_CORE)),)
683683
endif
684684

685685
ifndef BOOTLOADER_FILE
686-
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file)
686+
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.file)
687687
ifndef BOOTLOADER_FILE
688688
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.file)
689689
endif
@@ -694,7 +694,7 @@ ifeq ($(strip $(NO_CORE)),)
694694
endif
695695

696696
ifndef HEX_MAXIMUM_SIZE
697-
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.maximum_size)
697+
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).upload.maximum_size)
698698
ifndef HEX_MAXIMUM_SIZE
699699
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),upload.maximum_size)
700700
endif
@@ -1504,7 +1504,7 @@ show_boards:
15041504
@$(CAT) $(BOARDS_TXT) | grep -E '^[a-zA-Z0-9_\-]+.name' | sort -uf | sed 's/.name=/:/' | column -s: -t
15051505

15061506
show_submenu:
1507-
@$(CAT) $(BOARDS_TXT) | grep -E '[a-zA-Z0-9_\-]+.menu.cpu.[a-zA-Z0-9_\-]+=' | sort -uf | sed 's/.menu.cpu./:/' | sed 's/=/:/' | column -s: -t
1507+
@$(CAT) $(BOARDS_TXT) | grep -E '[a-zA-Z0-9_\-]+.menu.(cpu|chip).[a-zA-Z0-9_\-]+=' | sort -uf | sed 's/.menu.(cpu|chip)./:/' | sed 's/=/:/' | column -s: -t
15081508

15091509
monitor:
15101510
ifeq ($(MONITOR_CMD), 'putty')

0 commit comments

Comments
 (0)