From ef8248a20b038912a20b68ea3e63d283ed0bed2a Mon Sep 17 00:00:00 2001 From: zvecr Date: Thu, 5 Aug 2021 19:57:00 +0100 Subject: [PATCH 1/3] Relocate platform specific drivers --- {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 {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 - 37 files changed, 1 insertion(+), 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/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/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/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 d942e7ade523..168d4f4e57a2 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 7eda360460f0..64823f695d86 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -277,8 +277,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 bd4142364c54..31ed48f99bc8 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -128,3 +128,4 @@ endif # Search Path VPATH += $(TMK_PATH)/$(COMMON_DIR) VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) +VPATH += platforms/$(PLATFORM_KEY)/$(DRIVER_DIR) diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index 514d5fac418e..c8935dacb764 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) From 037a0763748b24a7a314db96564f488ee8bd1c92 Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 6 Aug 2021 01:46:26 +0100 Subject: [PATCH 2/3] Move stm eeprom --- common_features.mk | 1 + .../chibios/drivers}/eeprom/eeprom_stm32_L0_L1.c | 0 .../chibios/drivers}/eeprom/eeprom_stm32_L0_L1.h | 0 3 files changed, 1 insertion(+) rename {drivers => platforms/chibios/drivers}/eeprom/eeprom_stm32_L0_L1.c (100%) rename {drivers => platforms/chibios/drivers}/eeprom/eeprom_stm32_L0_L1.h (100%) diff --git a/common_features.mk b/common_features.mk index 15b7b464fd43..1989962f2708 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 += platforms/chibios/drivers/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/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 From f0d53e3b76974fa4cecc07199e6f696610182a0e Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 6 Aug 2021 02:17:02 +0100 Subject: [PATCH 3/3] Tidy up slightly --- common.mk | 3 +++ common_features.mk | 2 +- tmk_core/common.mk | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common.mk b/common.mk index c13b5e2768a7..8acea39376e6 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 1989962f2708..8fb6f2ad4f1b 100644 --- a/common_features.mk +++ b/common_features.mk @@ -178,7 +178,7 @@ else else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) OPT_DEFS += -DEEPROM_DRIVER COMMON_VPATH += $(DRIVER_PATH)/eeprom - COMMON_VPATH += platforms/chibios/drivers/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/tmk_core/common.mk b/tmk_core/common.mk index 31ed48f99bc8..483468227377 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -128,4 +128,4 @@ endif # Search Path VPATH += $(TMK_PATH)/$(COMMON_DIR) VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) -VPATH += platforms/$(PLATFORM_KEY)/$(DRIVER_DIR) +VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)