summaryrefslogtreecommitdiff
path: root/builddefs
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2023-05-10 14:04:53 -0700
committerGitHub <noreply@github.com>2023-05-10 14:04:53 -0700
commit2ddad246ce85066d5aee798e6ea516ea8e49eea9 (patch)
tree9cf408192e62be0fb251d8668879458e91a58a4f /builddefs
parent8a332e6f0105d2db9239e3c3f997bae754522804 (diff)
OLED Driver improvements (#20331)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/common_features.mk23
1 files changed, 17 insertions, 6 deletions
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index d0702f3ad1..9ac95dae82 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -744,17 +744,28 @@ endif
VALID_OLED_DRIVER_TYPES := SSD1306 custom
OLED_DRIVER ?= SSD1306
+VALID_OLED_TRANSPORT_TYPES := i2c spi custom
+OLED_TRANSPORT ?= i2c
ifeq ($(strip $(OLED_ENABLE)), yes)
ifeq ($(filter $(OLED_DRIVER),$(VALID_OLED_DRIVER_TYPES)),)
$(call CATASTROPHIC_ERROR,Invalid OLED_DRIVER,OLED_DRIVER="$(OLED_DRIVER)" is not a valid OLED driver)
else
- OPT_DEFS += -DOLED_ENABLE
- COMMON_VPATH += $(DRIVER_PATH)/oled
+ ifeq ($(filter $(OLED_TRANSPORT),$(VALID_OLED_TRANSPORT_TYPES)),)
+ $(call CATASTROPHIC_ERROR,Invalid OLED_TRANSPORT,OLED_TRANSPORT="$(OLED_TRANSPORT)" is not a valid OLED transport)
+ else
+ OPT_DEFS += -DOLED_ENABLE
+ COMMON_VPATH += $(DRIVER_PATH)/oled
+ ifneq ($(strip $(OLED_DRIVER)), custom)
+ SRC += oled_driver.c
+ endif
- OPT_DEFS += -DOLED_DRIVER_$(strip $(shell echo $(OLED_DRIVER) | tr '[:lower:]' '[:upper:]'))
- ifeq ($(strip $(OLED_DRIVER)), SSD1306)
- SRC += ssd1306_sh1106.c
- QUANTUM_LIB_SRC += i2c_master.c
+ OPT_DEFS += -DOLED_TRANSPORT_$(strip $(shell echo $(OLED_TRANSPORT) | tr '[:lower:]' '[:upper:]'))
+ ifeq ($(strip $(OLED_TRANSPORT)), i2c)
+ QUANTUM_LIB_SRC += i2c_master.c
+ endif
+ ifeq ($(strip $(OLED_TRANSPORT)), spi)
+ QUANTUM_LIB_SRC += spi_master.c
+ endif
endif
endif
endif