summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-03-21 05:20:04 +0000
committerGitHub <noreply@github.com>2020-03-21 16:20:04 +1100
commitd96380e65496912e0f68e6531565f4b45efd1623 (patch)
tree63e903f65b4fdc44c75c7eff21e076fdb200dca7
parent7e80686f1e400010a8a800cc73c4896936f337de (diff)
Initial arm->chibios pass - simplify some platform logic (#8450)
-rw-r--r--build_keyboard.mk5
-rw-r--r--build_test.mk1
-rw-r--r--common_features.mk12
-rw-r--r--drivers/chibios/analog.c (renamed from drivers/arm/analog.c)0
-rw-r--r--drivers/chibios/analog.h (renamed from drivers/arm/analog.h)0
-rw-r--r--drivers/chibios/i2c_master.c (renamed from drivers/arm/i2c_master.c)0
-rw-r--r--drivers/chibios/i2c_master.h (renamed from drivers/arm/i2c_master.h)0
-rw-r--r--drivers/chibios/ws2812.c (renamed from drivers/arm/ws2812.c)0
-rw-r--r--drivers/chibios/ws2812.h (renamed from drivers/arm/ws2812.h)0
-rw-r--r--drivers/chibios/ws2812_pwm.c (renamed from drivers/arm/ws2812_pwm.c)0
-rw-r--r--drivers/chibios/ws2812_spi.c (renamed from drivers/arm/ws2812_spi.c)0
-rw-r--r--keyboards/hs60/v2/ansi/rules.mk2
-rw-r--r--keyboards/hs60/v2/hhkb/rules.mk2
-rw-r--r--keyboards/hs60/v2/iso/rules.mk2
-rwxr-xr-xkeyboards/nk65/rules.mk2
-rw-r--r--keyboards/wilba_tech/wt_rgb_backlight.c2
-rw-r--r--quantum/audio/audio_avr.c (renamed from quantum/audio/audio.c)0
-rw-r--r--quantum/audio/audio_chibios.c (renamed from quantum/audio/audio_arm.c)0
-rw-r--r--quantum/backlight/backlight_chibios.c (renamed from quantum/backlight/backlight_arm.c)0
-rw-r--r--tmk_core/chibios.mk2
-rw-r--r--tmk_core/common.mk14
21 files changed, 15 insertions, 29 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index b086420653..bfadede376 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -231,13 +231,16 @@ endif
# We can assume a ChibiOS target When MCU_FAMILY is defined since it's
# not used for LUFA
ifdef MCU_FAMILY
- FIRMWARE_FORMAT?=bin
PLATFORM=CHIBIOS
+ PLATFORM_KEY=chibios
+ FIRMWARE_FORMAT?=bin
else ifdef ARM_ATSAM
PLATFORM=ARM_ATSAM
+ PLATFORM_KEY=arm_atsam
FIRMWARE_FORMAT=bin
else
PLATFORM=AVR
+ PLATFORM_KEY=avr
FIRMWARE_FORMAT?=hex
endif
diff --git a/build_test.mk b/build_test.mk
index cac2cba509..d13d9a515b 100644
--- a/build_test.mk
+++ b/build_test.mk
@@ -41,6 +41,7 @@ all: elf
VPATH += $(COMMON_VPATH)
PLATFORM:=TEST
+PLATFORM_KEY:=test
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include tests/$(TEST)/rules.mk
diff --git a/common_features.mk b/common_features.mk
index b71dbc77e2..64ddc85fd3 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -35,11 +35,7 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes)
MUSIC_ENABLE := 1
SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c
- ifeq ($(PLATFORM),AVR)
- SRC += $(QUANTUM_DIR)/audio/audio.c
- else
- SRC += $(QUANTUM_DIR)/audio/audio_arm.c
- endif
+ SRC += $(QUANTUM_DIR)/audio/audio_$(PLATFORM_KEY).c
SRC += $(QUANTUM_DIR)/audio/voices.c
SRC += $(QUANTUM_DIR)/audio/luts.c
endif
@@ -315,11 +311,7 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
else
SRC += $(QUANTUM_DIR)/backlight/backlight_driver_common.c
ifeq ($(strip $(BACKLIGHT_DRIVER)), pwm)
- ifeq ($(PLATFORM),AVR)
- SRC += $(QUANTUM_DIR)/backlight/backlight_avr.c
- else
- SRC += $(QUANTUM_DIR)/backlight/backlight_arm.c
- endif
+ SRC += $(QUANTUM_DIR)/backlight/backlight_$(PLATFORM_KEY).c
else
SRC += $(QUANTUM_DIR)/backlight/backlight_$(strip $(BACKLIGHT_DRIVER)).c
endif
diff --git a/drivers/arm/analog.c b/drivers/chibios/analog.c
index 6f6db64010..6f6db64010 100644
--- a/drivers/arm/analog.c
+++ b/drivers/chibios/analog.c
diff --git a/drivers/arm/analog.h b/drivers/chibios/analog.h
index e61c394265..e61c394265 100644
--- a/drivers/arm/analog.h
+++ b/drivers/chibios/analog.h
diff --git a/drivers/arm/i2c_master.c b/drivers/chibios/i2c_master.c
index ede915fa4a..ede915fa4a 100644
--- a/drivers/arm/i2c_master.c
+++ b/drivers/chibios/i2c_master.c
diff --git a/drivers/arm/i2c_master.h b/drivers/chibios/i2c_master.h
index 3d3891289f..3d3891289f 100644
--- a/drivers/arm/i2c_master.h
+++ b/drivers/chibios/i2c_master.h
diff --git a/drivers/arm/ws2812.c b/drivers/chibios/ws2812.c
index bdca565d88..bdca565d88 100644
--- a/drivers/arm/ws2812.c
+++ b/drivers/chibios/ws2812.c
diff --git a/drivers/arm/ws2812.h b/drivers/chibios/ws2812.h
index 41c22a00b8..41c22a00b8 100644
--- a/drivers/arm/ws2812.h
+++ b/drivers/chibios/ws2812.h
diff --git a/drivers/arm/ws2812_pwm.c b/drivers/chibios/ws2812_pwm.c
index 1a17210298..1a17210298 100644
--- a/drivers/arm/ws2812_pwm.c
+++ b/drivers/chibios/ws2812_pwm.c
diff --git a/drivers/arm/ws2812_spi.c b/drivers/chibios/ws2812_spi.c
index 36e08e39ed..36e08e39ed 100644
--- a/drivers/arm/ws2812_spi.c
+++ b/drivers/chibios/ws2812_spi.c
diff --git a/keyboards/hs60/v2/ansi/rules.mk b/keyboards/hs60/v2/ansi/rules.mk
index d013775c11..8efabcccbf 100644
--- a/keyboards/hs60/v2/ansi/rules.mk
+++ b/keyboards/hs60/v2/ansi/rules.mk
@@ -30,4 +30,4 @@ SRC = keyboards/wilba_tech/wt_main.c \
keyboards/wilba_tech/wt_rgb_backlight.c \
drivers/issi/is31fl3733.c \
quantum/color.c \
- drivers/arm/i2c_master.c
+ drivers/chibios/i2c_master.c
diff --git a/keyboards/hs60/v2/hhkb/rules.mk b/keyboards/hs60/v2/hhkb/rules.mk
index 44399851f0..14951cca70 100644
--- a/keyboards/hs60/v2/hhkb/rules.mk
+++ b/keyboards/hs60/v2/hhkb/rules.mk
@@ -28,4 +28,4 @@ SRC = keyboards/wilba_tech/wt_main.c \
keyboards/wilba_tech/wt_rgb_backlight.c \
drivers/issi/is31fl3733.c \
quantum/color.c \
- drivers/arm/i2c_master.c
+ drivers/chibios/i2c_master.c
diff --git a/keyboards/hs60/v2/iso/rules.mk b/keyboards/hs60/v2/iso/rules.mk
index 582ed4e817..96bfbce056 100644
--- a/keyboards/hs60/v2/iso/rules.mk
+++ b/keyboards/hs60/v2/iso/rules.mk
@@ -30,4 +30,4 @@ SRC = keyboards/wilba_tech/wt_main.c \
keyboards/wilba_tech/wt_rgb_backlight.c \
drivers/issi/is31fl3733.c \
quantum/color.c \
- drivers/arm/i2c_master.c
+ drivers/chibios/i2c_master.c
diff --git a/keyboards/nk65/rules.mk b/keyboards/nk65/rules.mk
index 1b734161fc..f7db412a24 100755
--- a/keyboards/nk65/rules.mk
+++ b/keyboards/nk65/rules.mk
@@ -30,4 +30,4 @@ SRC = keyboards/wilba_tech/wt_main.c \
keyboards/wilba_tech/wt_rgb_backlight.c \
drivers/issi/is31fl3733.c \
quantum/color.c \
- drivers/arm/i2c_master.c
+ drivers/chibios/i2c_master.c
diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c
index 9db4478efb..1a8bd8981a 100644
--- a/keyboards/wilba_tech/wt_rgb_backlight.c
+++ b/keyboards/wilba_tech/wt_rgb_backlight.c
@@ -49,7 +49,7 @@
#else
#include "ch.h"
#include "hal.h"
-#include "drivers/arm/i2c_master.h"
+#include "drivers/chibios/i2c_master.h"
#endif
#if defined(RGB_BACKLIGHT_DAWN60)
diff --git a/quantum/audio/audio.c b/quantum/audio/audio_avr.c
index 781378788c..781378788c 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio_avr.c
diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_chibios.c
index fba7c59873..fba7c59873 100644
--- a/quantum/audio/audio_arm.c
+++ b/quantum/audio/audio_chibios.c
diff --git a/quantum/backlight/backlight_arm.c b/quantum/backlight/backlight_chibios.c
index 723544adb9..723544adb9 100644
--- a/quantum/backlight/backlight_arm.c
+++ b/quantum/backlight/backlight_chibios.c
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 014019ef04..b400e9e0f1 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -179,7 +179,7 @@ HEX = $(OBJCOPY) -O $(FORMAT)
EEP =
BIN = $(OBJCOPY) -O binary
-COMMON_VPATH += $(DRIVER_PATH)/arm
+COMMON_VPATH += $(DRIVER_PATH)/chibios
THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 6863929cee..b766ebe97e 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -1,13 +1,5 @@
COMMON_DIR = common
-ifeq ($(PLATFORM),AVR)
- PLATFORM_COMMON_DIR = $(COMMON_DIR)/avr
-else ifeq ($(PLATFORM),CHIBIOS)
- PLATFORM_COMMON_DIR = $(COMMON_DIR)/chibios
-else ifeq ($(PLATFORM),ARM_ATSAM)
- PLATFORM_COMMON_DIR = $(COMMON_DIR)/arm_atsam
-else
- PLATFORM_COMMON_DIR = $(COMMON_DIR)/test
-endif
+PLATFORM_COMMON_DIR = $(COMMON_DIR)/$(PLATFORM_KEY)
TMK_COMMON_SRC += $(COMMON_DIR)/host.c \
$(COMMON_DIR)/keyboard.c \
@@ -179,6 +171,4 @@ endif
# Search Path
VPATH += $(TMK_PATH)/$(COMMON_DIR)
-ifeq ($(PLATFORM),CHIBIOS)
-VPATH += $(TMK_PATH)/$(COMMON_DIR)/chibios
-endif
+VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR)