From 0f02622467e3cdcc4ac2e44d23437c548385756a Mon Sep 17 00:00:00 2001 From: Donna Whisnant Date: Sun, 11 Nov 2018 13:01:52 -0600 Subject: [PATCH] Add support for BOARD_SPEED setting. This is needed to specify CPU speed for boards.txt files that use this format: "{board_tag}.menu.speed.{board_speed}.build.f_cpu" For example, the Watterott ATmega328PB library: https://github.com/watterott/ATmega328PB-Testing --- Arduino.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Arduino.mk b/Arduino.mk index 0f34a82..5ff186e 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -641,6 +641,11 @@ else $(call show_config_variable,BOARD_TAG,[USER]) endif +ifdef BOARD_SPEED + BOARD_SPEED := $(strip $(BOARD_SPEED)) + $(call show_config_variable,BOARD_SPEED,[USER]) +endif + # If NO_CORE is set, then we don't have to parse boards.txt file # But the user might have to define MCU, F_CPU etc ifeq ($(strip $(NO_CORE)),) @@ -686,7 +691,12 @@ ifeq ($(strip $(NO_CORE)),) endif ifndef F_CPU - F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.f_cpu) + ifdef BOARD_SPEED + F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.speed.$(BOARD_SPEED).build.f_cpu) + endif + ifndef F_CPU + F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.f_cpu) + endif ifndef F_CPU F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),build.f_cpu) endif