summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/onekey/keymaps
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-10-05 16:57:00 +0100
committerGitHub <noreply@github.com>2019-10-05 16:57:00 +0100
commit38aefaf78e3d9f17ef561f031679a02c9fba869c (patch)
tree9de5fc423f20d27daedeee0500faad57ce8712a2 /keyboards/handwired/onekey/keymaps
parent60b2a9a5ea88321629e970e936652cc1ba786b80 (diff)
ARM - Initial backlight support (#6487)
* Move AVR backlight to own file, add borrowed ARM implementation * Tiny fix for backlight custom logic * Remove duplicate board from rebase * Fix f303 onekey example * clang-format * clang-format * Remove backlight keymap debug * Initial pass of ARM backlight docs * Initial pass of ARM backlight docs - resolve todos * fix rules validation logic * Add f072 warning * Add f072 warning * tidy up breathing in backlight keymap * tidy up breathing in backlight keymap * add missing break to backlight keymap
Diffstat (limited to 'keyboards/handwired/onekey/keymaps')
-rw-r--r--keyboards/handwired/onekey/keymaps/backlight/config.h3
-rw-r--r--keyboards/handwired/onekey/keymaps/backlight/keymap.c40
-rw-r--r--keyboards/handwired/onekey/keymaps/backlight/rules.mk2
3 files changed, 45 insertions, 0 deletions
diff --git a/keyboards/handwired/onekey/keymaps/backlight/config.h b/keyboards/handwired/onekey/keymaps/backlight/config.h
new file mode 100644
index 0000000000..af01528b43
--- /dev/null
+++ b/keyboards/handwired/onekey/keymaps/backlight/config.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#define BACKLIGHT_BREATHING
diff --git a/keyboards/handwired/onekey/keymaps/backlight/keymap.c b/keyboards/handwired/onekey/keymaps/backlight/keymap.c
new file mode 100644
index 0000000000..1f4be16a62
--- /dev/null
+++ b/keyboards/handwired/onekey/keymaps/backlight/keymap.c
@@ -0,0 +1,40 @@
+#include QMK_KEYBOARD_H
+
+//Tap Dance Declarations
+enum {
+ TD_BL = 0
+};
+
+void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
+ // noop
+}
+
+void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
+ switch (state->count) {
+ case 1:
+ // single tap - step through backlight
+ backlight_step();
+ break;
+#ifdef BACKLIGHT_BREATHING
+ case 2:
+ // double tap - toggle breathing
+ breathing_toggle();
+ break;
+ case 3:
+ //tripple tap - do some pulse stuff
+ breathing_pulse();
+ break;
+#endif
+ default:
+ // more - nothing
+ break;
+ }
+}
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ [TD_BL] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ LAYOUT( TD(TD_BL) )
+};
diff --git a/keyboards/handwired/onekey/keymaps/backlight/rules.mk b/keyboards/handwired/onekey/keymaps/backlight/rules.mk
new file mode 100644
index 0000000000..176e099770
--- /dev/null
+++ b/keyboards/handwired/onekey/keymaps/backlight/rules.mk
@@ -0,0 +1,2 @@
+BACKLIGHT_ENABLE = yes
+TAP_DANCE_ENABLE = yes