summaryrefslogtreecommitdiffstats
path: root/builddefs
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-01-11 02:13:32 +0000
committerGitHub <noreply@github.com>2023-01-11 02:13:32 +0000
commite11235ee14f9cd3fc45b836eec99ed312cb137dd (patch)
tree023866a25f9fe4db482a8c5f5d1c9cab24882c46 /builddefs
parent20474ae2321f0fb456731646b5b2e3090990b8df (diff)
De-duplicate platform detection (#19545)
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/build_keyboard.mk25
1 files changed, 7 insertions, 18 deletions
diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk
index 8999ac80ad..37466cbbe5 100644
--- a/builddefs/build_keyboard.mk
+++ b/builddefs/build_keyboard.mk
@@ -180,6 +180,13 @@ generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c
endif
+# PLATFORM_KEY should be detected in info.json via key 'processor' (or rules.mk 'MCU')
+ifeq ($(PLATFORM_KEY),)
+ $(call CATASTROPHIC_ERROR,Platform not defined)
+endif
+PLATFORM=$(shell echo $(PLATFORM_KEY) | tr '[:lower:]' '[:upper:]')
+
+
include $(BUILDDEFS_PATH)/converters.mk
include $(BUILDDEFS_PATH)/mcu_selection.mk
@@ -257,24 +264,6 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","")
FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
endif
-# Determine and set parameters based on the keyboard's processor family.
-# We can assume a ChibiOS target When MCU_FAMILY is defined since it's
-# not used for LUFA
-ifdef MCU_FAMILY
- PLATFORM=CHIBIOS
- PLATFORM_KEY=chibios
- FIRMWARE_FORMAT?=bin
- OPT_DEFS += -DMCU_$(MCU_FAMILY)
-else ifdef ARM_ATSAM
- PLATFORM=ARM_ATSAM
- PLATFORM_KEY=arm_atsam
- FIRMWARE_FORMAT=bin
-else
- PLATFORM=AVR
- PLATFORM_KEY=avr
- FIRMWARE_FORMAT?=hex
-endif
-
# Find all of the config.h files and add them to our CONFIG_H define.
CONFIG_H :=
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")