From 14db496f0006d2c5d976e9a8e8e65fd4cdffc790 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 18 Oct 2021 12:55:44 +0100 Subject: [PATCH] Split out HAPTIC_ENABLE to have separate DRIVER option (#14854) * DRIVER -> ENABLE * Update generic_features.mk Co-authored-by: Ryan * Update common_features.mk Co-authored-by: Ryan --- common_features.mk | 24 ++++++++----------- docs/feature_haptic_feedback.md | 7 ++++-- docs/ja/feature_haptic_feedback.md | 7 ++++-- generic_features.mk | 1 + layouts/community/ortho_4x12/drashna/rules.mk | 1 - lib/python/qmk/info.py | 5 ---- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/common_features.mk b/common_features.mk index 7dd63be5be2e..9b9425dc33cd 100644 --- a/common_features.mk +++ b/common_features.mk @@ -495,23 +495,19 @@ ifeq ($(strip $(CRC_ENABLE)), yes) SRC += crc.c endif -HAPTIC_ENABLE ?= no -ifneq ($(strip $(HAPTIC_ENABLE)),no) +ifeq ($(strip $(HAPTIC_ENABLE)),yes) COMMON_VPATH += $(DRIVER_PATH)/haptic - OPT_DEFS += -DHAPTIC_ENABLE - SRC += $(QUANTUM_DIR)/haptic.c - SRC += $(QUANTUM_DIR)/process_keycode/process_haptic.c -endif -ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), ) - SRC += DRV2605L.c - QUANTUM_LIB_SRC += i2c_master.c - OPT_DEFS += -DDRV2605L -endif + ifneq ($(filter DRV2605L, $(HAPTIC_DRIVER)), ) + SRC += DRV2605L.c + QUANTUM_LIB_SRC += i2c_master.c + OPT_DEFS += -DDRV2605L + endif -ifneq ($(filter SOLENOID, $(HAPTIC_ENABLE)), ) - SRC += solenoid.c - OPT_DEFS += -DSOLENOID_ENABLE + ifneq ($(filter SOLENOID, $(HAPTIC_DRIVER)), ) + SRC += solenoid.c + OPT_DEFS += -DSOLENOID_ENABLE + endif endif ifeq ($(strip $(HD44780_ENABLE)), yes) diff --git a/docs/feature_haptic_feedback.md b/docs/feature_haptic_feedback.md index a12bb4bcd085..4054c5d9b743 100644 --- a/docs/feature_haptic_feedback.md +++ b/docs/feature_haptic_feedback.md @@ -4,9 +4,12 @@ The following options are currently available for haptic feedback in `rules.mk`: -`HAPTIC_ENABLE += DRV2605L` +``` +HAPTIC_ENABLE = yes -`HAPTIC_ENABLE += SOLENOID` +HAPTIC_DRIVER += DRV2605L +HAPTIC_DRIVER += SOLENOID +``` ## Known Supported Hardware diff --git a/docs/ja/feature_haptic_feedback.md b/docs/ja/feature_haptic_feedback.md index 158079725329..687788014aa5 100644 --- a/docs/ja/feature_haptic_feedback.md +++ b/docs/ja/feature_haptic_feedback.md @@ -9,9 +9,12 @@ 現在のところ、`rules.mk` で触覚フィードバック用に以下のオプションを利用可能です: -`HAPTIC_ENABLE += DRV2605L` +``` +HAPTIC_ENABLE = yes -`HAPTIC_ENABLE += SOLENOID` +HAPTIC_DRIVER += DRV2605L +HAPTIC_DRIVER += SOLENOID +``` ## サポートされる既知のハードウェア diff --git a/generic_features.mk b/generic_features.mk index c455c83dd5e5..ff02d56bbe0a 100644 --- a/generic_features.mk +++ b/generic_features.mk @@ -25,6 +25,7 @@ GENERIC_FEATURES = \ DYNAMIC_MACRO \ ENCODER \ GRAVE_ESC \ + HAPTIC \ KEY_LOCK \ KEY_OVERRIDE \ LEADER \ diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 775ad8e6eb47..8c3e126636e1 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -28,7 +28,6 @@ ifeq ($(strip $(KEYBOARD)), planck/light) RGBLIGHT_ENABLE = yes RGBLIGHT_STARTUP_ANIMATION = yes AUDIO_ENABLE = yes - # HAPTIC_ENABLE += SOLENOID endif ifeq ($(strip $(KEYBOARD)), planck/ez) RGBLIGHT_ENABLE = no diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 5eb10e3cef47..c3bbcf3eb0b7 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -112,11 +112,6 @@ def _extract_features(info_data, rules): if rules.get('BOOTMAGIC_ENABLE') == 'full': rules['BOOTMAGIC_ENABLE'] = 'on' - # Skip non-boolean features we haven't implemented special handling for - for feature in ('HAPTIC_ENABLE',): - if rules.get(feature): - del rules[feature] - # Process the rest of the rules as booleans for key, value in rules.items(): if key.endswith('_ENABLE'):