Skip to content

Commit

Permalink
Initial arm->chibios pass - simplify some platform logic (qmk#8450)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Mar 21, 2020
1 parent 7e80686 commit d96380e
Show file tree
Hide file tree
Showing 21 changed files with 15 additions and 29 deletions.
5 changes: 4 additions & 1 deletion build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions build_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ all: elf

VPATH += $(COMMON_VPATH)
PLATFORM:=TEST
PLATFORM_KEY:=test

ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include tests/$(TEST)/rules.mk
Expand Down
12 changes: 2 additions & 10 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion keyboards/hs60/v2/ansi/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion keyboards/hs60/v2/hhkb/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion keyboards/hs60/v2/iso/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion keyboards/nk65/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion keyboards/wilba_tech/wt_rgb_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tmk_core/chibios.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 2 additions & 12 deletions tmk_core/common.mk
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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)

0 comments on commit d96380e

Please sign in to comment.