summaryrefslogtreecommitdiff
path: root/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-01-10 10:34:22 +0000
committerQMK Bot <hello@qmk.fm>2022-01-10 10:34:22 +0000
commitb4b636112ed1318c14244529c5330ee24f597e47 (patch)
tree4f5d56ceadbb86fa766392c6ec50d767683562d7 /keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c
parent5491385f3dc3c357ffd86a0cd6e0c3c2ec662e65 (diff)
parent2e19d0d7d14fef69d583886c244d3c67b3c0cc3d (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c')
-rw-r--r--keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c42
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 0000000000..37fa2902c5
--- /dev/null
+++ b/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c
@@ -0,0 +1,42 @@
+// Copyright 2021 Christoph Rehmann (crehmann)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "haptic_utils.h"
+
+#ifdef HAPTIC_ENABLE
+#include "drivers/haptic/DRV2605L.h"
+#endif
+
+#ifdef HAPTIC_ENABLE
+bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case KC_BTN1 ... KC_BTN5:
+ return true;
+ break;
+ }
+
+ return false;
+}
+#endif
+
+void process_layer_pulse(layer_state_t state) {
+#ifdef HAPTIC_ENABLE
+ switch (get_highest_layer(state)) {
+ case 1:
+ DRV_pulse(soft_bump);
+ break;
+ case 2:
+ DRV_pulse(sh_dblsharp_tick);
+ break;
+ case 3:
+ DRV_pulse(lg_dblclick_str);
+ break;
+ case 4:
+ DRV_pulse(soft_bump);
+ break;
+ case 5:
+ DRV_pulse(pulsing_sharp);
+ break;
+ }
+#endif
+}