aboutsummaryrefslogtreecommitdiff
path: root/builddefs
diff options
context:
space:
mode:
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/build_full_test.mk2
-rw-r--r--builddefs/build_keyboard.mk41
-rw-r--r--builddefs/common_features.mk24
-rw-r--r--builddefs/generic_features.mk2
4 files changed, 37 insertions, 32 deletions
diff --git a/builddefs/build_full_test.mk b/builddefs/build_full_test.mk
index 5cae327c6c..82bb9387a6 100644
--- a/builddefs/build_full_test.mk
+++ b/builddefs/build_full_test.mk
@@ -25,8 +25,6 @@ $(TEST_OUTPUT)_SRC := \
tests/test_common/test_driver.cpp \
tests/test_common/keyboard_report_util.cpp \
tests/test_common/mouse_report_util.cpp \
- tests/test_common/keycode_util.cpp \
- tests/test_common/keycode_table.cpp \
tests/test_common/test_fixture.cpp \
tests/test_common/test_keymap_key.cpp \
tests/test_common/test_logger.cpp \
diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk
index c5fc9cd25d..fb07042bb7 100644
--- a/builddefs/build_keyboard.mk
+++ b/builddefs/build_keyboard.mk
@@ -97,21 +97,12 @@ endif
# Pull in rules.mk files from all our subfolders
-ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","")
- include $(KEYBOARD_PATH_5)/rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_4)/rules.mk)","")
- include $(KEYBOARD_PATH_4)/rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_3)/rules.mk)","")
- include $(KEYBOARD_PATH_3)/rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_2)/rules.mk)","")
- include $(KEYBOARD_PATH_2)/rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
- include $(KEYBOARD_PATH_1)/rules.mk
-endif
+-include $(KEYBOARD_PATH_5)/rules.mk
+-include $(KEYBOARD_PATH_4)/rules.mk
+-include $(KEYBOARD_PATH_3)/rules.mk
+-include $(KEYBOARD_PATH_2)/rules.mk
+-include $(KEYBOARD_PATH_1)/rules.mk
+
# Create dependencies on DD keyboard config - structure validated elsewhere
DD_CONFIG_FILES :=
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","")
@@ -487,21 +478,11 @@ ifneq ("$(CONVERTER)","")
endif
# Pull in post_rules.mk files from all our subfolders
-ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_rules.mk)","")
- include $(KEYBOARD_PATH_1)/post_rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_rules.mk)","")
- include $(KEYBOARD_PATH_2)/post_rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_rules.mk)","")
- include $(KEYBOARD_PATH_3)/post_rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_rules.mk)","")
- include $(KEYBOARD_PATH_4)/post_rules.mk
-endif
-ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_rules.mk)","")
- include $(KEYBOARD_PATH_5)/post_rules.mk
-endif
+-include $(KEYBOARD_PATH_1)/post_rules.mk
+-include $(KEYBOARD_PATH_2)/post_rules.mk
+-include $(KEYBOARD_PATH_3)/post_rules.mk
+-include $(KEYBOARD_PATH_4)/post_rules.mk
+-include $(KEYBOARD_PATH_5)/post_rules.mk
define post_rules_mk_community_module_includer
ifneq ("$(wildcard $(1)/post_rules.mk)","")
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index c88ce36011..802e01de43 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -30,6 +30,8 @@ QUANTUM_SRC += \
$(QUANTUM_DIR)/logging/sendchar.c \
$(QUANTUM_DIR)/process_keycode/process_default_layer.c \
+include $(QUANTUM_DIR)/nvm/rules.mk
+
VPATH += $(QUANTUM_DIR)/logging
# Fall back to lib/printf if there is no platform provided print
ifeq ("$(wildcard $(PLATFORM_PATH)/$(PLATFORM_KEY)/printf.mk)","")
@@ -934,6 +936,28 @@ ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
endif
endif
+VALID_BATTERY_DRIVER_TYPES := adc custom vendor
+
+BATTERY_DRIVER ?= adc
+ifeq ($(strip $(BATTERY_DRIVER_REQUIRED)), yes)
+ ifeq ($(filter $(BATTERY_DRIVER),$(VALID_BATTERY_DRIVER_TYPES)),)
+ $(call CATASTROPHIC_ERROR,Invalid BATTERY_DRIVER,BATTERY_DRIVER="$(BATTERY_DRIVER)" is not a valid battery driver)
+ endif
+
+ OPT_DEFS += -DBATTERY_DRIVER
+ OPT_DEFS += -DBATTERY_$(strip $(shell echo $(BATTERY_DRIVER) | tr '[:lower:]' '[:upper:]'))
+
+ COMMON_VPATH += $(DRIVER_PATH)/battery
+
+ SRC += battery.c
+ SRC += battery_$(strip $(BATTERY_DRIVER)).c
+
+ # add extra deps
+ ifeq ($(strip $(BATTERY_DRIVER)), adc)
+ ANALOG_DRIVER_REQUIRED = yes
+ endif
+endif
+
VALID_WS2812_DRIVER_TYPES := bitbang custom i2c pwm spi vendor
WS2812_DRIVER ?= bitbang
diff --git a/builddefs/generic_features.mk b/builddefs/generic_features.mk
index f14f440877..d39727f23b 100644
--- a/builddefs/generic_features.mk
+++ b/builddefs/generic_features.mk
@@ -34,6 +34,7 @@ GENERIC_FEATURES = \
DYNAMIC_TAPPING_TERM \
GRAVE_ESC \
HAPTIC \
+ KEYCODE_STRING \
KEY_LOCK \
KEY_OVERRIDE \
LAYER_LOCK \
@@ -60,6 +61,7 @@ define HANDLE_GENERIC_FEATURE
SRC += $$(wildcard $$(QUANTUM_DIR)/process_keycode/process_$2.c)
SRC += $$(wildcard $$(QUANTUM_DIR)/$2/$2.c)
SRC += $$(wildcard $$(QUANTUM_DIR)/$2.c)
+ SRC += $$(wildcard $$(QUANTUM_DIR)/nvm/$$(NVM_DRIVER_LOWER)/nvm_$2.c)
VPATH += $$(wildcard $$(QUANTUM_DIR)/$2/)
OPT_DEFS += -D$1_ENABLE
endef