Skip to content

Commit

Permalink
Split out HAPTIC_ENABLE to have separate DRIVER option (qmk#14854)
Browse files Browse the repository at this point in the history
* DRIVER -> ENABLE

* Update generic_features.mk

Co-authored-by: Ryan <[email protected]>

* Update common_features.mk

Co-authored-by: Ryan <[email protected]>
  • Loading branch information
zvecr and fauxpark authored Oct 18, 2021
1 parent d267c0d commit 14db496
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
24 changes: 10 additions & 14 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions docs/feature_haptic_feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions docs/ja/feature_haptic_feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@

現在のところ、`rules.mk` で触覚フィードバック用に以下のオプションを利用可能です:

`HAPTIC_ENABLE += DRV2605L`
```
HAPTIC_ENABLE = yes
`HAPTIC_ENABLE += SOLENOID`
HAPTIC_DRIVER += DRV2605L
HAPTIC_DRIVER += SOLENOID
```

## サポートされる既知のハードウェア

Expand Down
1 change: 1 addition & 0 deletions generic_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GENERIC_FEATURES = \
DYNAMIC_MACRO \
ENCODER \
GRAVE_ESC \
HAPTIC \
KEY_LOCK \
KEY_OVERRIDE \
LEADER \
Expand Down
1 change: 0 additions & 1 deletion layouts/community/ortho_4x12/drashna/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit 14db496

Please sign in to comment.