From a6e931400ead19d3d34ca4a57785d1512dc2d12b Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 25 Jan 2025 17:38:12 +1100 Subject: [PATCH] Relocate base WS2812 code (#24850) --- builddefs/common_features.mk | 2 ++ drivers/{ => led}/ws2812.c | 0 drivers/{ => led}/ws2812.h | 0 keyboards/ibm/model_m/mschwingen/mschwingen.c | 5 ++++- 4 files changed, 6 insertions(+), 1 deletion(-) rename drivers/{ => led}/ws2812.c (100%) rename drivers/{ => led}/ws2812.h (100%) diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index 989048d71740..c88ce36011c8 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -944,6 +944,8 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes) OPT_DEFS += -DWS2812_$(strip $(shell echo $(WS2812_DRIVER) | tr '[:lower:]' '[:upper:]')) + COMMON_VPATH += $(DRIVER_PATH)/led + SRC += ws2812.c ws2812_$(strip $(WS2812_DRIVER)).c ifeq ($(strip $(PLATFORM)), CHIBIOS) diff --git a/drivers/ws2812.c b/drivers/led/ws2812.c similarity index 100% rename from drivers/ws2812.c rename to drivers/led/ws2812.c diff --git a/drivers/ws2812.h b/drivers/led/ws2812.h similarity index 100% rename from drivers/ws2812.h rename to drivers/led/ws2812.h diff --git a/keyboards/ibm/model_m/mschwingen/mschwingen.c b/keyboards/ibm/model_m/mschwingen/mschwingen.c index cb4854d8d1a3..34a878c76998 100644 --- a/keyboards/ibm/model_m/mschwingen/mschwingen.c +++ b/keyboards/ibm/model_m/mschwingen/mschwingen.c @@ -19,9 +19,12 @@ #include "uart.h" #include "print.h" #include "sendchar.h" -#include "ws2812.h" #include "sleep_led.h" +#ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812 +#include "ws2812.h" +#endif + #ifdef UART_DEBUG # undef sendchar static int8_t capture_sendchar(uint8_t c) {