Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out HAPTIC_ENABLE to have separate DRIVER option #14854

Merged
merged 3 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -495,23 +495,17 @@ ifeq ($(strip $(CRC_ENABLE)), yes)
SRC += crc.c
endif

HAPTIC_ENABLE ?= no
ifneq ($(strip $(HAPTIC_ENABLE)),no)
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
ifeq ($(strip $(HAPTIC_ENABLE)),yes)
ifneq ($(filter DRV2605L, $(HAPTIC_DRIVER)), )
zvecr marked this conversation as resolved.
Show resolved Hide resolved
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_ENABLE \
zvecr marked this conversation as resolved.
Show resolved Hide resolved
KEY_LOCK \
KEY_OVERRIDE \
LEADER \
Expand Down
3 changes: 2 additions & 1 deletion keyboards/boston_meetup/2019/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ AUDIO_ENABLE = yes # Audio output
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = no
RGB_MATRIX_DRIVER = WS2812
HAPTIC_ENABLE += DRV2605L
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = DRV2605L
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
3 changes: 2 additions & 1 deletion keyboards/c39/keymaps/drashna/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ COMMAND_ENABLE = yes
NKRO_ENABLE = yes
AUDIO_ENABLE = yes
UNICODE_ENABLE = yes
HAPTIC_ENABLE = SOLENOID
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = SOLENOID

RGBLIGHT_STARTUP_ANIMATION = yes
3 changes: 2 additions & 1 deletion keyboards/hadron/ver3/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no # once arm_rgb is implemented
RGB_MATRIX_DRIVER = WS2812
HAPTIC_ENABLE += DRV2605L
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = DRV2605L
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
ENCODER_ENABLER = yes
3 changes: 2 additions & 1 deletion keyboards/ibm/model_m_4th_gen/overnumpad_1xb/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ENCODER_ENABLE = no # Enable rotary encoder support
AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra

HAPTIC_ENABLE += SOLENOID
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = SOLENOID
7 changes: 4 additions & 3 deletions keyboards/splitkb/zima/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BOOTLOADER = atmel-dfu
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
Expand All @@ -22,7 +22,8 @@ AUDIO_ENABLE = yes # Audio output

ENCODER_ENABLE = yes # ENables the use of one or more encoders
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Enables the use of OLED displays
HAPTIC_ENABLE += DRV2605L # Supported but not included by defaut
OLED_DRIVER = SSD1306 # Enables the use of OLED displays
HAPTIC_ENABLE = yes # Supported but not included by defaut
HAPTIC_DRIVER = DRV2605L

LTO_ENABLE = yes
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ENCODER_ENABLE = no # Enable rotary encoder support
AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra

HAPTIC_ENABLE += SOLENOID
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = SOLENOID
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ ENCODER_ENABLE = no # Enable rotary encoder support
AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra

HAPTIC_ENABLE += SOLENOID
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = SOLENOID

LAYOUTS = fullsize_ansi fullsize_iso
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ENCODER_ENABLE = no # Enable rotary encoder support
AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra

HAPTIC_ENABLE += SOLENOID
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = SOLENOID
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ENCODER_ENABLE = no # Enable rotary encoder support
AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra

HAPTIC_ENABLE += SOLENOID
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = SOLENOID
3 changes: 2 additions & 1 deletion keyboards/xw60/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: ht
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = no # Audio output
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
HAPTIC_ENABLE += SOLENOID
HAPTIC_ENABLE = yes
HAPTIC_DRIVER = SOLENOID
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
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