Skip to content

Commit d7ed2f4

Browse files
committed
Merge pull request #347 from sej7278/master
Looks for submenu items first when parsing BOARDS_TXT. Fix #346
2 parents 0cc6faf + a066e86 commit d7ed2f4

File tree

1 file changed

+24
-34
lines changed

1 file changed

+24
-34
lines changed

Arduino.mk

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -579,41 +579,38 @@ ifeq ($(strip $(NO_CORE)),)
579579

580580
# Which variant ? This affects the include path
581581
ifndef VARIANT
582-
VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),build.variant)
582+
VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.variant)
583583
ifndef VARIANT
584-
# might be a submenu
585-
VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.variant)
584+
VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),build.variant)
586585
endif
587586
$(call show_config_variable,VARIANT,[COMPUTED],(from build.variant))
588587
else
589588
$(call show_config_variable,VARIANT,[USER])
590589
endif
591590

592591
# see if we are a caterina device like leonardo or micro
593-
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.path))
592+
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file))
594593
ifndef CATERINA
595-
# bootloader.path is deprecated in 1.5, its now part of bootloader.file
594+
# 1.5+ method if not a submenu
596595
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.file))
597596
endif
598597
ifndef CATERINA
599-
# might be a submenu
600-
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file))
598+
# 1.0 method uses deprecated bootloader.path
599+
CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.path))
601600
endif
602601

603602
# processor stuff
604603
ifndef MCU
605-
MCU := $(call PARSE_BOARD,$(BOARD_TAG),build.mcu)
604+
MCU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.mcu)
606605
ifndef MCU
607-
# might be a submenu
608-
MCU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.mcu)
606+
MCU := $(call PARSE_BOARD,$(BOARD_TAG),build.mcu)
609607
endif
610608
endif
611609

612610
ifndef F_CPU
613-
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),build.f_cpu)
611+
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.f_cpu)
614612
ifndef F_CPU
615-
# might be a submenu
616-
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.f_cpu)
613+
F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),build.f_cpu)
617614
endif
618615
endif
619616

@@ -630,18 +627,16 @@ ifeq ($(strip $(NO_CORE)),)
630627

631628
# normal programming info
632629
ifndef AVRDUDE_ARD_PROGRAMMER
633-
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),upload.protocol)
630+
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.protocol)
634631
ifndef AVRDUDE_ARD_PROGRAMMER
635-
# might be a submenu
636-
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.protocol)
632+
AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),upload.protocol)
637633
endif
638634
endif
639635

640636
ifndef AVRDUDE_ARD_BAUDRATE
641-
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),upload.speed)
637+
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.speed)
642638
ifndef AVRDUDE_ARD_BAUDRATE
643-
# might be a submenu
644-
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.speed)
639+
AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),upload.speed)
645640
endif
646641
endif
647642

@@ -651,26 +646,23 @@ ifeq ($(strip $(NO_CORE)),)
651646
endif
652647

653648
ifndef ISP_HIGH_FUSE
654-
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.high_fuses)
649+
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.high_fuses)
655650
ifndef ISP_HIGH_FUSE
656-
# might be a submenu
657-
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.high_fuses)
651+
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.high_fuses)
658652
endif
659653
endif
660654

661655
ifndef ISP_LOW_FUSE
662-
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.low_fuses)
656+
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.low_fuses)
663657
ifndef ISP_LOW_FUSE
664-
# might be a submenu
665-
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.low_fuses)
658+
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.low_fuses)
666659
endif
667660
endif
668661

669662
ifndef ISP_EXT_FUSE
670-
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.extended_fuses)
663+
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.extended_fuses)
671664
ifndef ISP_EXT_FUSE
672-
# might be a submenu
673-
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.extended_fuses)
665+
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.extended_fuses)
674666
endif
675667
endif
676668

@@ -679,10 +671,9 @@ ifeq ($(strip $(NO_CORE)),)
679671
endif
680672

681673
ifndef BOOTLOADER_FILE
682-
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.file)
674+
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file)
683675
ifndef BOOTLOADER_FILE
684-
# might be a submenu
685-
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).bootloader.file)
676+
BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.file)
686677
endif
687678
endif
688679

@@ -691,10 +682,9 @@ ifeq ($(strip $(NO_CORE)),)
691682
endif
692683

693684
ifndef HEX_MAXIMUM_SIZE
694-
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),upload.maximum_size)
685+
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.maximum_size)
695686
ifndef HEX_MAXIMUM_SIZE
696-
# might be a submenu
697-
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).upload.maximum_size)
687+
HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),upload.maximum_size)
698688
endif
699689
endif
700690

0 commit comments

Comments
 (0)