From 1bb7af4d446174b7181c9bb22dbd14c93642ea10 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 17 Aug 2021 23:43:09 +0100 Subject: [PATCH] Relocate platform specific drivers (#13894) * Relocate platform specific drivers * Move stm eeprom * Tidy up slightly --- common.mk | 3 +++ common_features.mk | 1 + {drivers/avr => platforms/avr/drivers}/analog.c | 0 {drivers/avr => platforms/avr/drivers}/analog.h | 0 {drivers/avr => platforms/avr/drivers}/glcdfont.c | 0 {drivers/avr => platforms/avr/drivers}/hd44780.c | 0 {drivers/avr => platforms/avr/drivers}/hd44780.h | 0 {drivers/avr => platforms/avr/drivers}/i2c_master.c | 0 {drivers/avr => platforms/avr/drivers}/i2c_master.h | 0 {drivers/avr => platforms/avr/drivers}/i2c_slave.c | 0 {drivers/avr => platforms/avr/drivers}/i2c_slave.h | 0 {drivers/avr => platforms/avr/drivers}/serial.c | 0 {drivers/avr => platforms/avr/drivers}/spi_master.c | 0 {drivers/avr => platforms/avr/drivers}/spi_master.h | 0 {drivers/avr => platforms/avr/drivers}/ssd1306.c | 0 {drivers/avr => platforms/avr/drivers}/ssd1306.h | 0 {drivers/avr => platforms/avr/drivers}/uart.c | 0 {drivers/avr => platforms/avr/drivers}/uart.h | 0 {drivers/avr => platforms/avr/drivers}/ws2812.c | 0 {drivers/avr => platforms/avr/drivers}/ws2812_i2c.c | 0 {drivers/chibios => platforms/chibios/drivers}/analog.c | 0 {drivers/chibios => platforms/chibios/drivers}/analog.h | 0 .../chibios/drivers}/eeprom/eeprom_stm32_L0_L1.c | 0 .../chibios/drivers}/eeprom/eeprom_stm32_L0_L1.h | 0 {drivers/chibios => platforms/chibios/drivers}/i2c_master.c | 0 {drivers/chibios => platforms/chibios/drivers}/i2c_master.h | 0 {drivers/chibios => platforms/chibios/drivers}/serial.c | 0 {drivers/chibios => platforms/chibios/drivers}/serial_usart.c | 0 {drivers/chibios => platforms/chibios/drivers}/serial_usart.h | 0 {drivers/chibios => platforms/chibios/drivers}/spi_master.c | 0 {drivers/chibios => platforms/chibios/drivers}/spi_master.h | 0 {drivers/chibios => platforms/chibios/drivers}/uart.c | 0 {drivers/chibios => platforms/chibios/drivers}/uart.h | 0 {drivers/chibios => platforms/chibios/drivers}/usbpd_stm32g4.c | 0 {drivers/chibios => platforms/chibios/drivers}/ws2812.c | 0 {drivers/chibios => platforms/chibios/drivers}/ws2812_pwm.c | 0 {drivers/chibios => platforms/chibios/drivers}/ws2812_spi.c | 0 tmk_core/avr.mk | 2 -- tmk_core/chibios.mk | 2 -- tmk_core/common.mk | 1 + tmk_core/protocol/lufa.mk | 1 - 41 files changed, 5 insertions(+), 5 deletions(-) rename {drivers/avr => platforms/avr/drivers}/analog.c (100%) rename {drivers/avr => platforms/avr/drivers}/analog.h (100%) rename {drivers/avr => platforms/avr/drivers}/glcdfont.c (100%) rename {drivers/avr => platforms/avr/drivers}/hd44780.c (100%) rename {drivers/avr => platforms/avr/drivers}/hd44780.h (100%) rename {drivers/avr => platforms/avr/drivers}/i2c_master.c (100%) rename {drivers/avr => platforms/avr/drivers}/i2c_master.h (100%) rename {drivers/avr => platforms/avr/drivers}/i2c_slave.c (100%) rename {drivers/avr => platforms/avr/drivers}/i2c_slave.h (100%) rename {drivers/avr => platforms/avr/drivers}/serial.c (100%) rename {drivers/avr => platforms/avr/drivers}/spi_master.c (100%) rename {drivers/avr => platforms/avr/drivers}/spi_master.h (100%) rename {drivers/avr => platforms/avr/drivers}/ssd1306.c (100%) rename {drivers/avr => platforms/avr/drivers}/ssd1306.h (100%) rename {drivers/avr => platforms/avr/drivers}/uart.c (100%) rename {drivers/avr => platforms/avr/drivers}/uart.h (100%) rename {drivers/avr => platforms/avr/drivers}/ws2812.c (100%) rename {drivers/avr => platforms/avr/drivers}/ws2812_i2c.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/analog.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/analog.h (100%) rename {drivers => platforms/chibios/drivers}/eeprom/eeprom_stm32_L0_L1.c (100%) rename {drivers => platforms/chibios/drivers}/eeprom/eeprom_stm32_L0_L1.h (100%) rename {drivers/chibios => platforms/chibios/drivers}/i2c_master.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/i2c_master.h (100%) rename {drivers/chibios => platforms/chibios/drivers}/serial.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/serial_usart.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/serial_usart.h (100%) rename {drivers/chibios => platforms/chibios/drivers}/spi_master.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/spi_master.h (100%) rename {drivers/chibios => platforms/chibios/drivers}/uart.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/uart.h (100%) rename {drivers/chibios => platforms/chibios/drivers}/usbpd_stm32g4.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/ws2812.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/ws2812_pwm.c (100%) rename {drivers/chibios => platforms/chibios/drivers}/ws2812_spi.c (100%) diff --git a/common.mk b/common.mk index c13b5e276..8acea3937 100644 --- a/common.mk +++ b/common.mk @@ -12,6 +12,9 @@ QUANTUM_PATH = $(QUANTUM_DIR) DRIVER_DIR = drivers DRIVER_PATH = $(DRIVER_DIR) +PLATFORM_DIR = platforms +PLATFORM_PATH = $(PLATFORM_DIR) + BUILD_DIR := .build COMMON_VPATH := $(TOP_DIR) diff --git a/common_features.mk b/common_features.mk index 493aab635..1eece0242 100644 --- a/common_features.mk +++ b/common_features.mk @@ -178,6 +178,7 @@ else else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) OPT_DEFS += -DEEPROM_DRIVER COMMON_VPATH += $(DRIVER_PATH)/eeprom + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom SRC += eeprom_driver.c eeprom_stm32_L0_L1.c else # This will effectively work the same as "transient" if not supported by the chip diff --git a/drivers/avr/analog.c b/platforms/avr/drivers/analog.c similarity index 100% rename from drivers/avr/analog.c rename to platforms/avr/drivers/analog.c diff --git a/drivers/avr/analog.h b/platforms/avr/drivers/analog.h similarity index 100% rename from drivers/avr/analog.h rename to platforms/avr/drivers/analog.h diff --git a/drivers/avr/glcdfont.c b/platforms/avr/drivers/glcdfont.c similarity index 100% rename from drivers/avr/glcdfont.c rename to platforms/avr/drivers/glcdfont.c diff --git a/drivers/avr/hd44780.c b/platforms/avr/drivers/hd44780.c similarity index 100% rename from drivers/avr/hd44780.c rename to platforms/avr/drivers/hd44780.c diff --git a/drivers/avr/hd44780.h b/platforms/avr/drivers/hd44780.h similarity index 100% rename from drivers/avr/hd44780.h rename to platforms/avr/drivers/hd44780.h diff --git a/drivers/avr/i2c_master.c b/platforms/avr/drivers/i2c_master.c similarity index 100% rename from drivers/avr/i2c_master.c rename to platforms/avr/drivers/i2c_master.c diff --git a/drivers/avr/i2c_master.h b/platforms/avr/drivers/i2c_master.h similarity index 100% rename from drivers/avr/i2c_master.h rename to platforms/avr/drivers/i2c_master.h diff --git a/drivers/avr/i2c_slave.c b/platforms/avr/drivers/i2c_slave.c similarity index 100% rename from drivers/avr/i2c_slave.c rename to platforms/avr/drivers/i2c_slave.c diff --git a/drivers/avr/i2c_slave.h b/platforms/avr/drivers/i2c_slave.h similarity index 100% rename from drivers/avr/i2c_slave.h rename to platforms/avr/drivers/i2c_slave.h diff --git a/drivers/avr/serial.c b/platforms/avr/drivers/serial.c similarity index 100% rename from drivers/avr/serial.c rename to platforms/avr/drivers/serial.c diff --git a/drivers/avr/spi_master.c b/platforms/avr/drivers/spi_master.c similarity index 100% rename from drivers/avr/spi_master.c rename to platforms/avr/drivers/spi_master.c diff --git a/drivers/avr/spi_master.h b/platforms/avr/drivers/spi_master.h similarity index 100% rename from drivers/avr/spi_master.h rename to platforms/avr/drivers/spi_master.h diff --git a/drivers/avr/ssd1306.c b/platforms/avr/drivers/ssd1306.c similarity index 100% rename from drivers/avr/ssd1306.c rename to platforms/avr/drivers/ssd1306.c diff --git a/drivers/avr/ssd1306.h b/platforms/avr/drivers/ssd1306.h similarity index 100% rename from drivers/avr/ssd1306.h rename to platforms/avr/drivers/ssd1306.h diff --git a/drivers/avr/uart.c b/platforms/avr/drivers/uart.c similarity index 100% rename from drivers/avr/uart.c rename to platforms/avr/drivers/uart.c diff --git a/drivers/avr/uart.h b/platforms/avr/drivers/uart.h similarity index 100% rename from drivers/avr/uart.h rename to platforms/avr/drivers/uart.h diff --git a/drivers/avr/ws2812.c b/platforms/avr/drivers/ws2812.c similarity index 100% rename from drivers/avr/ws2812.c rename to platforms/avr/drivers/ws2812.c diff --git a/drivers/avr/ws2812_i2c.c b/platforms/avr/drivers/ws2812_i2c.c similarity index 100% rename from drivers/avr/ws2812_i2c.c rename to platforms/avr/drivers/ws2812_i2c.c diff --git a/drivers/chibios/analog.c b/platforms/chibios/drivers/analog.c similarity index 100% rename from drivers/chibios/analog.c rename to platforms/chibios/drivers/analog.c diff --git a/drivers/chibios/analog.h b/platforms/chibios/drivers/analog.h similarity index 100% rename from drivers/chibios/analog.h rename to platforms/chibios/drivers/analog.h diff --git a/drivers/eeprom/eeprom_stm32_L0_L1.c b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c similarity index 100% rename from drivers/eeprom/eeprom_stm32_L0_L1.c rename to platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.c diff --git a/drivers/eeprom/eeprom_stm32_L0_L1.h b/platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h similarity index 100% rename from drivers/eeprom/eeprom_stm32_L0_L1.h rename to platforms/chibios/drivers/eeprom/eeprom_stm32_L0_L1.h diff --git a/drivers/chibios/i2c_master.c b/platforms/chibios/drivers/i2c_master.c similarity index 100% rename from drivers/chibios/i2c_master.c rename to platforms/chibios/drivers/i2c_master.c diff --git a/drivers/chibios/i2c_master.h b/platforms/chibios/drivers/i2c_master.h similarity index 100% rename from drivers/chibios/i2c_master.h rename to platforms/chibios/drivers/i2c_master.h diff --git a/drivers/chibios/serial.c b/platforms/chibios/drivers/serial.c similarity index 100% rename from drivers/chibios/serial.c rename to platforms/chibios/drivers/serial.c diff --git a/drivers/chibios/serial_usart.c b/platforms/chibios/drivers/serial_usart.c similarity index 100% rename from drivers/chibios/serial_usart.c rename to platforms/chibios/drivers/serial_usart.c diff --git a/drivers/chibios/serial_usart.h b/platforms/chibios/drivers/serial_usart.h similarity index 100% rename from drivers/chibios/serial_usart.h rename to platforms/chibios/drivers/serial_usart.h diff --git a/drivers/chibios/spi_master.c b/platforms/chibios/drivers/spi_master.c similarity index 100% rename from drivers/chibios/spi_master.c rename to platforms/chibios/drivers/spi_master.c diff --git a/drivers/chibios/spi_master.h b/platforms/chibios/drivers/spi_master.h similarity index 100% rename from drivers/chibios/spi_master.h rename to platforms/chibios/drivers/spi_master.h diff --git a/drivers/chibios/uart.c b/platforms/chibios/drivers/uart.c similarity index 100% rename from drivers/chibios/uart.c rename to platforms/chibios/drivers/uart.c diff --git a/drivers/chibios/uart.h b/platforms/chibios/drivers/uart.h similarity index 100% rename from drivers/chibios/uart.h rename to platforms/chibios/drivers/uart.h diff --git a/drivers/chibios/usbpd_stm32g4.c b/platforms/chibios/drivers/usbpd_stm32g4.c similarity index 100% rename from drivers/chibios/usbpd_stm32g4.c rename to platforms/chibios/drivers/usbpd_stm32g4.c diff --git a/drivers/chibios/ws2812.c b/platforms/chibios/drivers/ws2812.c similarity index 100% rename from drivers/chibios/ws2812.c rename to platforms/chibios/drivers/ws2812.c diff --git a/drivers/chibios/ws2812_pwm.c b/platforms/chibios/drivers/ws2812_pwm.c similarity index 100% rename from drivers/chibios/ws2812_pwm.c rename to platforms/chibios/drivers/ws2812_pwm.c diff --git a/drivers/chibios/ws2812_spi.c b/platforms/chibios/drivers/ws2812_spi.c similarity index 100% rename from drivers/chibios/ws2812_spi.c rename to platforms/chibios/drivers/ws2812_spi.c diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index d7bee6d34..940e95397 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -12,8 +12,6 @@ HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) BIN = -COMMON_VPATH += $(DRIVER_PATH)/avr - COMPILEFLAGS += -funsigned-char COMPILEFLAGS += -funsigned-bitfields COMPILEFLAGS += -ffunction-sections diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index cbd9fff69..28aaaecba 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -278,8 +278,6 @@ HEX = $(OBJCOPY) -O $(FORMAT) EEP = BIN = $(OBJCOPY) -O binary -COMMON_VPATH += $(DRIVER_PATH)/chibios - THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB COMPILEFLAGS += -fomit-frame-pointer diff --git a/tmk_core/common.mk b/tmk_core/common.mk index fa907b47b..923a736d3 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -138,3 +138,4 @@ endif # Search Path VPATH += $(TMK_PATH)/$(COMMON_DIR) VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) +VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR) diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index 514d5fac4..c8935dacb 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa.mk @@ -49,7 +49,6 @@ SRC += $(LUFA_DIR)/usb_util.c # Search Path VPATH += $(TMK_PATH)/$(LUFA_DIR) VPATH += $(LUFA_PATH) -VPATH += $(DRIVER_PATH)/avr # Option modules #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)