diff options
Diffstat (limited to 'keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c')
| -rw-r--r-- | keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c b/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c new file mode 100644 index 000000000..37fa2902c --- /dev/null +++ b/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | // Copyright 2021 Christoph Rehmann (crehmann) | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "haptic_utils.h" | ||
| 5 | |||
| 6 | #ifdef HAPTIC_ENABLE | ||
| 7 | #include "drivers/haptic/DRV2605L.h" | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #ifdef HAPTIC_ENABLE | ||
| 11 | bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record) { | ||
| 12 | switch (keycode) { | ||
| 13 | case KC_BTN1 ... KC_BTN5: | ||
| 14 | return true; | ||
| 15 | break; | ||
| 16 | } | ||
| 17 | |||
| 18 | return false; | ||
| 19 | } | ||
| 20 | #endif | ||
| 21 | |||
| 22 | void process_layer_pulse(layer_state_t state) { | ||
| 23 | #ifdef HAPTIC_ENABLE | ||
| 24 | switch (get_highest_layer(state)) { | ||
| 25 | case 1: | ||
| 26 | DRV_pulse(soft_bump); | ||
| 27 | break; | ||
| 28 | case 2: | ||
| 29 | DRV_pulse(sh_dblsharp_tick); | ||
| 30 | break; | ||
| 31 | case 3: | ||
| 32 | DRV_pulse(lg_dblclick_str); | ||
| 33 | break; | ||
| 34 | case 4: | ||
| 35 | DRV_pulse(soft_bump); | ||
| 36 | break; | ||
| 37 | case 5: | ||
| 38 | DRV_pulse(pulsing_sharp); | ||
| 39 | break; | ||
| 40 | } | ||
| 41 | #endif | ||
| 42 | } | ||
