aboutsummaryrefslogtreecommitdiff
path: root/Arduino.mk
diff options
context:
space:
mode:
authorSimon John <git@the-jedi.co.uk>2018-11-17 18:59:48 +0000
committerGitHub <noreply@github.com>2018-11-17 18:59:48 +0000
commitd3be28b500766d094e1611bfc089b1486c10b4bf (patch)
treeb75e967baf58d68eb21ab01424d3a0e772fbce96 /Arduino.mk
parent5a0c80bf0c8fbfd5a997998a7c08ba9596c72a3f (diff)
parent35fece8b9cd05542068bfff5d0134c4b88a5f6bf (diff)
Merge pull request #592 from dewhisna/cpu_speed_select
Add support for BOARD_CLOCK setting
Diffstat (limited to 'Arduino.mk')
-rw-r--r--Arduino.mk33
1 files changed, 29 insertions, 4 deletions
diff --git a/Arduino.mk b/Arduino.mk
index 0f34a82..a6c2a3c 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -641,6 +641,11 @@ else
$(call show_config_variable,BOARD_TAG,[USER])
endif
+ifdef BOARD_CLOCK
+ BOARD_CLOCK := $(strip $(BOARD_CLOCK))
+ $(call show_config_variable,BOARD_CLOCK,[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_CLOCK
+ F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.(speed|clock).$(BOARD_CLOCK).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
@@ -731,21 +741,36 @@ ifeq ($(strip $(NO_CORE)),)
endif
ifndef ISP_HIGH_FUSE
- ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.high_fuses)
+ ifdef BOARD_CLOCK
+ ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(speed|clock).$(BOARD_CLOCK).bootloader.high_fuses)
+ endif
+ ifndef ISP_HIGH_FUSE
+ ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.high_fuses)
+ endif
ifndef ISP_HIGH_FUSE
ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.high_fuses)
endif
endif
ifndef ISP_LOW_FUSE
- ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.low_fuses)
+ ifdef BOARD_CLOCK
+ ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(speed|clock).$(BOARD_CLOCK).bootloader.low_fuses)
+ endif
+ ifndef ISP_LOW_FUSE
+ ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.low_fuses)
+ endif
ifndef ISP_LOW_FUSE
ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.low_fuses)
endif
endif
ifndef ISP_EXT_FUSE
- ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.extended_fuses)
+ ifdef BOARD_CLOCK
+ ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(speed|clock).$(BOARD_CLOCK).bootloader.extended_fuses)
+ endif
+ ifndef ISP_EXT_FUSE
+ ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.extended_fuses)
+ endif
ifndef ISP_EXT_FUSE
ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.extended_fuses)
endif