aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOryhara <turomar@gmail.com>2018-02-12 14:47:32 -0600
committerJack Humbert <jack.humb@gmail.com>2018-02-12 16:37:40 -0500
commitb89e318d35b295465a14679f27d71077a51daa3b (patch)
treec7551ece846bee1851fdc62c31c9e4b04b00fb9b
parent20b5dd80bdef355a4bb9bd6c222c891a29f67e19 (diff)
downloadqmk_firmware-b89e318d35b295465a14679f27d71077a51daa3b.tar.gz
qmk_firmware-b89e318d35b295465a14679f27d71077a51daa3b.zip
adding my stuff back after hard reset
-rw-r--r--keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h105
-rw-r--r--keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c165
-rw-r--r--keyboards/ergodox_infinity/keymaps/halfkeyboard/rules.mk91
-rw-r--r--keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c147
-rw-r--r--keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.h125
5 files changed, 592 insertions, 41 deletions
diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h b/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h
new file mode 100644
index 000000000..d86251946
--- /dev/null
+++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/config.h
@@ -0,0 +1,105 @@
1/*
2Copyright 2015 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef INFINITY_ERGODOX_CONFIG_H
19#define INFINITY_ERGODOX_CONFIG_H
20
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x6464
25#define DEVICE_VER 0x0001
26/* in python2: list(u"whatever".encode('utf-16-le')) */
27/* at most 32 characters or the ugly hack in usb_main.c borks */
28#define MANUFACTURER "TMK"
29#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00'
30#define PRODUCT "Infinity keyboard/TMK"
31#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00'
32
33#define MOUSEKEY_INTERVAL 20
34#define MOUSEKEY_DELAY 0
35#define MOUSEKEY_TIME_TO_MAX 60
36#define MOUSEKEY_MAX_SPEED 7
37#define MOUSEKEY_WHEEL_DELAY 0
38
39#define TAPPING_TOGGLE 1
40
41/* define if matrix has ghost */
42//#define MATRIX_HAS_GHOST
43
44#define TAPPING_TERM 200
45#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
46
47/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
48#define LOCKING_SUPPORT_ENABLE
49/* Locking resynchronize hack */
50#define LOCKING_RESYNC_ENABLE
51
52/* key combination for command */
53#define IS_COMMAND() ( \
54 keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
55 keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
56)
57
58/* key matrix size */
59#define MATRIX_ROWS 18
60#define MATRIX_COLS 5
61#define LOCAL_MATRIX_ROWS 9
62
63/* number of backlight levels */
64#define BACKLIGHT_LEVELS 3
65
66#define LED_BRIGHTNESS_LO 100
67#define LED_BRIGHTNESS_HI 255
68
69/* define if matrix has ghost */
70//#define MATRIX_HAS_GHOST
71
72/* Set 0 if debouncing isn't needed */
73#define DEBOUNCE 5
74
75#define SERIAL_LINK_BAUD 562500
76#define SERIAL_LINK_THREAD_PRIORITY (NORMALPRIO - 1)
77
78#define VISUALIZER_USER_DATA_SIZE 16
79/*
80 * music mode options
81 * midi enabled
82 * keymask disabled
83 * so typing normally will result in music
84 *
85 */
86#define MUSIC_MASK keycode != KC_NO
87/*
88 * Feature disable options
89 * These options are also useful to firmware size reduction.
90 */
91
92/* disable debug print */
93//#define NO_DEBUG
94
95/* disable print */
96//#define NO_PRINT
97
98/* disable action features */
99//#define NO_ACTION_LAYER
100//#define NO_ACTION_TAPPING
101//#define NO_ACTION_ONESHOT
102//#define NO_ACTION_MACRO
103//#define NO_ACTION_FUNCTION
104
105#endif
diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c
index b1c3f7be4..7df97bd01 100644
--- a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c
+++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c
@@ -2,15 +2,19 @@
2#include "debug.h" 2#include "debug.h"
3#include "action_layer.h" 3#include "action_layer.h"
4#include "version.h" 4#include "version.h"
5 5#include "keymap_steno.h"
6#define QWERTY 0 // qwerty layer 6#ifndef MIDI_ENABLE
7#define HALFQWERTY 1 // mirrored qwerty layer 7#error "Midi is not enabled"
8#define DVORAK 2 // dvorak layer 8#endif
9#define HALFDVORAK 3 // mirrored dvorak layer 9#define QWERTY 0 // qwerty layer
10#define HALFQWERTY 1 // mirrored qwerty layer
11#define DVORAK 2 // dvorak layer
12#define HALFDVORAK 3 // mirrored dvorak layer
10#define SYMB 5 // symbols 13#define SYMB 5 // symbols
11#define HALFSYMB 6 // media keys 14#define HALFSYMB 6 // media keys
12#define PLVR 7 // steno plover layout 15#define PLVR 7 // steno plover layout
13#define SHORTCUTS 8 //layer with shortcut keys 16#define SHORTCUTS 8 //layer with shortcut keys
17#define MDIA 9
14 18
15 19
16enum custom_keycodes { 20enum custom_keycodes {
@@ -37,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
37 * ,-------------. ,-------------. 41 * ,-------------. ,-------------.
38 * |Symbol|Dvorak| |Plover|HalfSymb| 42 * |Symbol|Dvorak| |Plover|HalfSymb|
39 * ,------|------|------| |------+--------+------. 43 * ,------|------|------| |------+--------+------.
40 * | | | Home | | PgUp | | | 44 * | | |MU_TOG| | PgUp | | |
41 * | Space|DELETE|------| |------| Tab |Enter | 45 * | Space|DELETE|------| |------| Tab |Enter |
42 * |mirror| | End | | PgDn | |mirror| 46 * |mirror| | End | | PgDn | |mirror|
43 * `--------------------' `----------------------' 47 * `--------------------' `----------------------'
@@ -52,16 +56,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
52 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MINUS, 56 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MINUS,
53 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), MO(SHORTCUTS), 57 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), MO(SHORTCUTS),
54 TG(SYMB), TG(DVORAK), 58 TG(SYMB), TG(DVORAK),
55 KC_HOME, 59 MU_ON,
56 LT(HALFQWERTY, KC_SPACE),KC_DEL,KC_END, 60 LT(HALFQWERTY, KC_SPACE),KC_DEL,KC_END,
57 // right hand 61 // right hand
58 KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, 62 KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
59 KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SLASH, 63 KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SLASH,
60 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, 64 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
61 KC_EQL,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, 65 KC_EQL,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT,
62 KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, 66 MO(MDIA), KC_UP,KC_DOWN,KC_RALT, KC_RCTRL,
63 TG(PLVR), TG(HALFSYMB), 67 TG(PLVR), TG(MDIA),
64 KC_PGUP, 68 MU_OFF,
65 KC_PGDN,KC_TAB, LT(HALFQWERTY, KC_ENT) 69 KC_PGDN,KC_TAB, LT(HALFQWERTY, KC_ENT)
66 ), 70 ),
67/* Keymap 1: mirrored qwerty 71/* Keymap 1: mirrored qwerty
@@ -95,16 +99,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
95 KC_LSFT, KC_SLASH, KC_DOT, KC_COMM,KC_M, KC_N, KC_EQL, 99 KC_LSFT, KC_SLASH, KC_DOT, KC_COMM,KC_M, KC_N, KC_EQL,
96 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, 100 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS,
97 KC_TRNS, KC_TRANSPARENT, 101 KC_TRNS, KC_TRANSPARENT,
98 KC_HOME, 102 KC_TRNS,
99 KC_TRANSPARENT,KC_DEL,KC_END, 103 KC_TRANSPARENT,KC_DEL,KC_END,
100 // right hand 104 // right hand
101 KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_1, KC_BSPC, 105 KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_1, KC_BSPC,
102 KC_LBRC, KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSLS, 106 KC_LBRC, KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSLS,
103 KC_G, KC_F, KC_D, KC_S, KC_A, KC_ENT, 107 KC_G, KC_F, KC_D, KC_S, KC_A, KC_ENT,
104 KC_MINUS,KC_B, KC_V, KC_C, KC_X, KC_Z, KC_RSFT, 108 KC_MINUS,KC_B, KC_V, KC_C, KC_X, KC_Z, KC_RSFT,
105 KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, 109 KC_TRNS, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL,
106 KC_TRANSPARENT, KC_TRNS, 110 KC_TRANSPARENT, KC_TRNS,
107 KC_PGUP, 111 KC_TRNS,
108 KC_PGDN,KC_TAB, KC_TRANSPARENT 112 KC_PGDN,KC_TAB, KC_TRANSPARENT
109 ), 113 ),
110/* Keymap 3: dvorak 114/* Keymap 3: dvorak
@@ -118,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
118 * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| 122 * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------|
119 * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | 123 * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift |
120 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 124 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
121 * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | 125 * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | Mouse| UP | DOWN | ALT | RCTRL |
122 * `----------------------------------' `----------------------------------' 126 * `----------------------------------' `----------------------------------'
123 * ,-------------. ,-------------. 127 * ,-------------. ,-------------.
124 * | Alt | | | |Alt | 128 * | Alt | | | |Alt |
@@ -138,16 +142,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
138 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_MINUS, 142 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_MINUS,
139 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, 143 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS,
140 TG(SYMB), KC_TRANSPARENT, 144 TG(SYMB), KC_TRANSPARENT,
141 KC_HOME, 145 KC_TRNS,
142 LT(HALFDVORAK, KC_SPACE),KC_DEL,KC_END, 146 LT(HALFDVORAK, KC_SPACE),KC_DEL,KC_END,
143 // right hand 147 // right hand
144 KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, 148 KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
145 KC_RBRC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, 149 KC_RBRC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH,
146 KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, 150 KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT,
147 KC_EQL,KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, 151 KC_EQL,KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
148 KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, 152 KC_TRNS, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL,
149 KC_TRANSPARENT, TG(HALFSYMB), 153 KC_TRANSPARENT, TG(MDIA),
150 KC_PGUP, 154 KC_TRNS,
151 KC_PGDN,KC_TAB, LT(HALFDVORAK, KC_ENT) 155 KC_PGDN,KC_TAB, LT(HALFDVORAK, KC_ENT)
152 ), 156 ),
153/* Keymap 3: mirrored dvorak 157/* Keymap 3: mirrored dvorak
@@ -161,7 +165,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
161 * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| 165 * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------|
162 * | LShift | Z | V | W | M | B | | | | X | K | J | Q | ; | RShift | 166 * | LShift | Z | V | W | M | B | | | | X | K | J | Q | ; | RShift |
163 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 167 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
164 * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | 168 * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | MOUSE| UP | DOWN | ALT | RCTRL |
165 * `----------------------------------' `----------------------------------' 169 * `----------------------------------' `----------------------------------'
166 * ,-------------. ,-------------. 170 * ,-------------. ,-------------.
167 * | Alt | | | |Alt | 171 * | Alt | | | |Alt |
@@ -181,16 +185,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
181 KC_LSFT, KC_Z, KC_V, KC_W, KC_M, KC_B, KC_EQL, 185 KC_LSFT, KC_Z, KC_V, KC_W, KC_M, KC_B, KC_EQL,
182 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, 186 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS,
183 KC_TRANSPARENT, KC_TRANSPARENT, 187 KC_TRANSPARENT, KC_TRANSPARENT,
184 KC_HOME, 188 KC_TRNS,
185 KC_TRANSPARENT,KC_DEL,KC_END, 189 KC_TRANSPARENT,KC_DEL,KC_END,
186 // right hand 190 // right hand
187 KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_5, KC_ESC, 191 KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_5, KC_ESC,
188 KC_LBRC, KC_Y, KC_P, KC_DOT, KC_COMM,KC_P, KC_TAB, 192 KC_LBRC, KC_Y, KC_P, KC_DOT, KC_COMM,KC_P, KC_TAB,
189 KC_I, KC_U, KC_E, KC_O, KC_A, KC_BSPC, 193 KC_I, KC_U, KC_E, KC_O, KC_A, KC_BSPC,
190 KC_MINUS,KC_X, KC_K, KC_J, KC_Q, KC_SCLN, KC_RSFT, 194 KC_MINUS,KC_X, KC_K, KC_J, KC_Q, KC_SCLN, KC_RSFT,
191 KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, 195 KC_TRNS, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL,
192 KC_TRANSPARENT, KC_TRNS, 196 KC_TRANSPARENT, KC_TRNS,
193 KC_PGUP, 197 KC_TRNS,
194 KC_PGDN,KC_TAB, KC_TRANSPARENT 198 KC_PGDN,KC_TAB, KC_TRANSPARENT
195 ), 199 ),
196/* Keymap 5: Symbol Layer 200/* Keymap 5: Symbol Layer
@@ -230,7 +234,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
230 KC_NO, KC_UP, KC_KP_7, KC_KP_8, KC_KP_9,KC_KP_ASTERISK, KC_KP_SLASH, 234 KC_NO, KC_UP, KC_KP_7, KC_KP_8, KC_KP_9,KC_KP_ASTERISK, KC_KP_SLASH,
231 KC_DOWN, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_ENTER, 235 KC_DOWN, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_ENTER,
232 KC_NO,KC_AMPR,KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_NO, 236 KC_NO,KC_AMPR,KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_NO,
233 KC_NO,KC_DOT, KC_0, KC_KP_EQUAL, KC_NO, 237 KC_TRNS,KC_DOT, KC_0, KC_KP_EQUAL, KC_NO,
234 KC_NO, KC_TRNS, 238 KC_NO, KC_TRNS,
235 KC_NO, 239 KC_NO,
236 KC_NO, KC_NO, LT(HALFSYMB, KC_ENT) 240 KC_NO, KC_NO, LT(HALFSYMB, KC_ENT)
@@ -265,16 +269,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
265 KC_NO,KC_NO,KC_KP_1, KC_KP_2, KC_KP_3,KC_KP_PLUS,KC_KP_ENTER, 269 KC_NO,KC_NO,KC_KP_1, KC_KP_2, KC_KP_3,KC_KP_PLUS,KC_KP_ENTER,
266 EPRM,KC_NO,KC_KP_0,KC_KP_DOT,KC_KP_EQUAL, 270 EPRM,KC_NO,KC_KP_0,KC_KP_DOT,KC_KP_EQUAL,
267 KC_TRNS,KC_NO, 271 KC_TRNS,KC_NO,
268 KC_NO, 272 KC_TRNS,
269 KC_TRANSPARENT,KC_NO,KC_NO, 273 KC_TRANSPARENT,KC_NO,KC_NO,
270 // right hand 274 // right hand
271 KC_F6, KC_F5, KC_F4, KC_F3, KC_F2, KC_F1, KC_BSPC, 275 KC_F6, KC_F5, KC_F4, KC_F3, KC_F2, KC_F1, KC_BSPC,
272 KC_NO,KC_PIPE,KC_LCBR,KC_RCBR, KC_SLASH, KC_BSLS, KC_NO, 276 KC_NO,KC_PIPE,KC_LCBR,KC_RCBR, KC_SLASH, KC_BSLS, KC_NO,
273 KC_GRV,KC_LPRN,KC_RPRN, KC_SCLN, KC_QUOT, KC_NO, 277 KC_GRV,KC_LPRN,KC_RPRN, KC_SCLN, KC_QUOT, KC_NO,
274 KC_NO, KC_TILD,KC_LBRC,KC_RBRC, KC_EQL, KC_MINUS, KC_NO, 278 KC_NO, KC_TILD,KC_LBRC,KC_RBRC, KC_EQL, KC_MINUS, KC_NO,
275 KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, 279 KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO,
276 KC_NO, KC_TRNS, 280 KC_NO, KC_TRNS,
277 KC_NO, 281 KC_TRNS,
278 KC_NO, KC_NO, KC_TRANSPARENT 282 KC_NO, KC_NO, KC_TRANSPARENT
279), 283),
280 284
@@ -303,22 +307,107 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
303[PLVR] = LAYOUT_ergodox( // layout: layer 4: Steno for Plover 307[PLVR] = LAYOUT_ergodox( // layout: layer 4: Steno for Plover
304 // left hand 308 // left hand
305 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 309 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
306 KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, 310 STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, KC_NO,
307 KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, 311 STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1,
308 KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, 312 KC_NO, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, KC_NO,
309 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 313 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
310 KC_FN4, KC_NO, 314 KC_TRNS, KC_TRNS,
311 KC_NO, 315 KC_TRNS,
312 KC_C, KC_V, KC_NO, 316 STN_A, STN_O, KC_NO,
313 // right hand 317 // right hand
314 KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, 318 KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS,
315 KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, 319 KC_TRNS, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC,
316 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, 320 STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
317 KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 321 KC_NO,STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
318 KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, 322 KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO,
319 KC_TRNS, KC_TRNS, 323 KC_TRNS, KC_TRNS,
320 KC_TRNS, 324 KC_TRNS,
321 KC_NO, KC_N, KC_M 325 KC_NO, STN_E, STN_U
326),
327/* Keymap 8: shortcuts
328 *
329 * ,--------------------------------------------------. ,--------------------------------------------------.
330 * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC |
331 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
332 * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
333 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
334 * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |ENTER |
335 * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------|
336 * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
337 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
338 * |LCTRL|ALT |CTLShTab|CTL-TAB| | | RGui| UP | DOWN | ALT | RCTRL |
339 * `----------------------------------' `----------------------------------'
340 * ,-------------. ,-------------.
341 * | Alt |Dvorak| |Plover|Alt |
342 * ,------|------|------| |------+--------+------.
343 * | | | Home | | PgUp | | |
344 * | Space|DELETE|------| |------| Tab |Enter |
345 * |mirror| | End | | PgDn | |mirror|
346 * `--------------------' `----------------------'
347 */
348// If it accepts an argument (i.e, is a function), it doesn't need KC_.
349// Otherwise, it needs KC_*
350[SHORTCUTS] = LAYOUT_ergodox( // layer 0 : default
351 // left hand
352 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO,
353 KC_TAB, LCTL(KC_Q), LCTL(KC_W),LCTL(KC_E),LCTL(KC_R),LCTL(KC_T), KC_NO,
354 KC_BSPC, LCTL(KC_A), LCTL(KC_S),LCTL(KC_D),LCTL(KC_F),LCTL(KC_G),
355 KC_LSFT, LCTL(KC_Z), LCTL(KC_X),LCTL(KC_C),LCTL(KC_V),LCTL(KC_B), KC_MINUS,
356 KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRANSPARENT,
357 KC_NO, KC_NO,
358
359 KC_NO,
360 KC_NO,KC_NO,KC_NO,
361 // right hand
362 KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
363 TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
364 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
365 KC_EQL,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT,
366 KC_TRNS, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL,
367 KC_NO, KC_TRNS,
368 KC_NO,
369 KC_NO,KC_NO, KC_NO
370 ),
371 /* Keymap 2: Media and mouse keys
372 *
373 * ,--------------------------------------------------. ,--------------------------------------------------.
374 * | | | | | | | | | | | | | | | |
375 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
376 * | | |LClick| MsUp |RClick| | | | | |LClick| MsUp |RClick| | |
377 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
378 * | | |MsLeft|MsDown|MsRght| |------| |------| |MsLeft|MsDown|MsRght| | |
379 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
380 * | | | | | | | | | | | | | | | |
381 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
382 * | | | | | | | | | | | |
383 * `----------------------------------' `----------------------------------'
384 * ,-------------. ,-------------.
385 * | | | | | |
386 * ,------|------|------| |------+------+------.
387 * | | | | | | | |
388 * | | |------| |------| | |
389 * | | | | | | | |
390 * `--------------------' `--------------------'
391 */
392// MEDIA AND MOUSE
393[MDIA] = LAYOUT_ergodox(
394 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
395 KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_WH_U,
396 KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
397 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D,
398 KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
399 KC_TRNS, KC_TRNS,
400 KC_TRNS,
401 KC_WH_L, KC_WH_R, KC_TRNS,
402 // right hand
403 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
404 KC_WH_U, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS,
405 KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS,
406 KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
407 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
408 KC_TRNS, KC_TRNS,
409 KC_TRNS,
410 KC_TRNS, KC_WH_L, KC_WH_R
322), 411),
323/* Keymap 8: shortcuts 412/* Keymap 8: shortcuts
324 * 413 *
@@ -418,7 +507,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
418 507
419// Runs just one time when the keyboard initializes. 508// Runs just one time when the keyboard initializes.
420void matrix_init_user(void) { 509void matrix_init_user(void) {
421 510 steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT
422}; 511};
423 512
424 513
diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/rules.mk b/keyboards/ergodox_infinity/keymaps/halfkeyboard/rules.mk
new file mode 100644
index 000000000..74881c981
--- /dev/null
+++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/rules.mk
@@ -0,0 +1,91 @@
1# project specific files
2SRC = matrix.c \
3 led.c
4
5## chip/board settings
6# - the next two should match the directories in
7# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
8# - For Teensies, FAMILY = KINETIS and SERIES is either
9# KL2x (LC) or K20x (3.0,3.1,3.2).
10# - For Infinity KB, SERIES = K20x
11MCU_FAMILY = KINETIS
12MCU_SERIES = K20x
13
14# Linker script to use
15# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
16# or <this_dir>/ld/
17# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
18# - LDSCRIPT =
19# - MKL26Z64 for Teensy LC
20# - MK20DX128 for Teensy 3.0
21# - MK20DX256 for Teensy 3.1 and 3.2
22# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
23# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
24MCU_LDSCRIPT = MK20DX256BLDR8
25
26# Startup code to use
27# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
28# - STARTUP =
29# - kl2x for Teensy LC
30# - k20x5 for Teensy 3.0 and Infinity 60%
31# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox
32MCU_STARTUP = k20x7
33
34# Board: it should exist either in <chibios>/os/hal/boards/
35# or <this_dir>/boards
36# - BOARD =
37# - PJRC_TEENSY_LC for Teensy LC
38# - PJRC_TEENSY_3 for Teensy 3.0
39# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
40# - MCHCK_K20 for Infinity KB
41#BOARD = MCHCK_K20
42BOARD = PJRC_TEENSY_3_1
43
44# Cortex version
45# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
46MCU = cortex-m4
47
48# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
49# I.e. 6 for Teensy LC; 7 for Teensy 3.x
50ARMV = 7
51
52# Vector table for application
53# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
54# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
55OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
56
57# Build Options
58# comment out to disable the options.
59#
60
61BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
62MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
63EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
64CONSOLE_ENABLE = no # Console for debug(+400)
65COMMAND_ENABLE = yes # Commands for debug and configuration
66CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDox EZ
67SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
68NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
69UNICODE_ENABLE = yes # Unicode
70ONEHAND_ENABLE = yes # Allow swapping hands of keyboard
71STENO_ENABLE = yes #enable plover steno mode
72CUSTOM_MATRIX = yes # Custom matrix file
73SERIAL_LINK_ENABLE = yes
74VISUALIZER_ENABLE = yes
75LCD_ENABLE = yes
76BACKLIGHT_ENABLE = yes
77LCD_BACKLIGHT_ENABLE = yes
78MIDI_ENABLE = yes
79MIDI_ADVANCED = yes
80MUSIC_MODE = yes
81RGBLIGHT_ENABLE = no
82
83LCD_DRIVER = st7565
84LCD_WIDTH = 128
85LCD_HEIGHT = 32
86
87LED_DRIVER = is31fl3731c
88LED_WIDTH = 7
89LED_HEIGHT = 7
90
91LAYOUTS = ergodox
diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c
index 6842635d1..7bd5a0783 100644
--- a/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c
+++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c
@@ -12,7 +12,140 @@ You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>. 12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/ 13*/
14 14
15#include "simple_visualizer.h" 15#include "visualizer.h"
16#include "gfx.h"
17#include "math.h"
18#include "default_animations.h"
19#include "led_backlight_keyframes.h"
20
21#define ONESIDESCAN 9
22#define BOTHSIDESCAN 16
23#define FULL_ON LUMA2COLOR(255)
24#define THREE_QUARTER LUMA2COLOR(200)
25#define HALF_ON LUMA2COLOR(150)
26#define ONE_QUARTER LUMA2COLOR(50)
27#define CROSSFADE_TIME 8000
28bool KITT_scan_one_side_left_to_right(keyframe_animation_t* animation, visualizer_state_t* state);
29bool KITT_scan_one_side_right_to_left(keyframe_animation_t* animation, visualizer_state_t* state);
30keyframe_animation_t Fade_in_all_leds = {
31 .num_frames = 1,
32 .loop = false,
33 .frame_lengths = {
34 CROSSFADE_TIME,
35 },
36 .frame_functions = {
37 led_backlight_keyframe_fade_in_all,
38 },
39};
40/*
41 * one set left to right. then reverse to go back.
42 * | left side | right side | |
43 |---|---|---|---|---|---|---|:-:|---|---|---|---|---|---|-------|
44 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | phase |
45 _________________________________________________________________
46 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
47 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
48 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
49 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
50 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
51 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
52 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 |
53 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
54 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
55 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 0 | 9 |
56 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 0 | 10 |
57 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 0 | 11 |
58 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 0 | 12 |
59 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 0 | 13 |
60 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 3 | 14 |
61 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 15 |
62 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 16 |
63 */
64
65#ifdef MASTER_IS_ON_RIGHT /*right side*/
66
67keyframe_animation_t KITT_Scanner_animation = {
68 .num_frames = 2,
69 .loop = true,
70 .frame_lengths = {
71 CROSSFADE_TIME * BOTHSIDESCAN,
72 CROSSFADE_TIME * BOTHSIDESCAN,
73 },
74 .frame_functions = {
75 KITT_scan_one_side_left_to_right,
76 KITT_scan_one_side_right_to_left,
77 },
78};
79
80bool KITT_scan_one_side_left_to_right(keyframe_animation_t* animation, visualizer_state_t* state) {
81 (void)state;
82 float frame_length = animation->frame_lengths[animation->current_frame];
83 float current_pos = frame_length - animation->time_left_in_frame;
84 int phase = current_pos/(frame_length/BOTHSIDESCAN);
85 int row = 0;
86 gdispGClear(LED_DISPLAY, ONE_QUARTER);
87 gdispGDrawPixel(LED_DISPLAY, 14-phase, row, FULL_ON);
88 gdispGDrawPixel(LED_DISPLAY, 15-phase, row, THREE_QUARTER);
89 gdispGDrawPixel(LED_DISPLAY, 16-phase, row, HALF_ON);
90 gdispGDrawPixel(LED_DISPLAY, 6, row, ONE_QUARTER);
91 return true;
92}
93
94bool KITT_scan_one_side_right_to_left(keyframe_animation_t* animation, visualizer_state_t* state) {
95 (void)state;
96 float frame_length = animation->frame_lengths[animation->current_frame];
97 float current_pos = frame_length - animation->time_left_in_frame;
98 int phase = current_pos/(frame_length/BOTHSIDESCAN);
99 int row = 0;
100 gdispGClear(LED_DISPLAY, ONE_QUARTER);
101 gdispGDrawPixel(LED_DISPLAY, phase, row, FULL_ON);
102 gdispGDrawPixel(LED_DISPLAY, phase-1, row, THREE_QUARTER);
103 gdispGDrawPixel(LED_DISPLAY, phase-2, row, HALF_ON);
104 gdispGDrawPixel(LED_DISPLAY, 6, row, ONE_QUARTER);
105 return true;
106}
107#else /*left side*/
108keyframe_animation_t KITT_Scanner_animation = {
109 .num_frames = 2,
110 .loop = true,
111 .frame_lengths = {
112 CROSSFADE_TIME * BOTHSIDESCAN,
113 CROSSFADE_TIME * BOTHSIDESCAN,
114 },
115 .frame_functions = {
116 KITT_scan_one_side_left_to_right,
117 KITT_scan_one_side_right_to_left,
118 },
119};
120
121bool KITT_scan_one_side_left_to_right(keyframe_animation_t* animation, visualizer_state_t* state) {
122 (void)state;
123 float frame_length = animation->frame_lengths[animation->current_frame];
124 float current_pos = frame_length - animation->time_left_in_frame;
125 int phase = current_pos/(frame_length/BOTHSIDESCAN);
126 int row = 0;
127 gdispGClear(LED_DISPLAY, ONE_QUARTER);
128 gdispGDrawPixel(LED_DISPLAY, phase, row, FULL_ON);
129 gdispGDrawPixel(LED_DISPLAY, phase-1, row, THREE_QUARTER);
130 gdispGDrawPixel(LED_DISPLAY, phase-2, row, HALF_ON);
131 gdispGDrawPixel(LED_DISPLAY, 6, row, ONE_QUARTER);
132 return true;
133}
134
135bool KITT_scan_one_side_right_to_left(keyframe_animation_t* animation, visualizer_state_t* state) {
136 (void)state;
137 float frame_length = animation->frame_lengths[animation->current_frame];
138 float current_pos = frame_length - animation->time_left_in_frame;
139 int phase = current_pos/(frame_length/BOTHSIDESCAN);
140 int row = 0;
141 gdispGClear(LED_DISPLAY, ONE_QUARTER);
142 gdispGDrawPixel(LED_DISPLAY, (14 - phase), row, FULL_ON);
143 gdispGDrawPixel(LED_DISPLAY, 14 - (phase-1), row, THREE_QUARTER);
144 gdispGDrawPixel(LED_DISPLAY, 14 - (phase-2), row, HALF_ON);
145 gdispGDrawPixel(LED_DISPLAY, 6, row, ONE_QUARTER);
146 return true;
147}
148#endif
16 149
17#define RED 0 150#define RED 0
18#define ORANGE 21 151#define ORANGE 21
@@ -37,13 +170,19 @@ static void get_visualizer_layer_and_color(visualizer_state_t* state) {
37 /* if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { 170 /* if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
38 saturation = 255; 171 saturation = 255;
39 } */ 172 } */
40 if (state->status.layer & 0x100) { 173 if (state->status.layer & 0x200) {
174 state->target_lcd_color = LCD_COLOR(GREEN, saturation, 0xFF);
175 state->layer_text = "MOUSE";
176 }
177 else if (state->status.layer & 0x100) {
41 state->target_lcd_color = LCD_COLOR(MAGENTA, saturation, 0xFF); 178 state->target_lcd_color = LCD_COLOR(MAGENTA, saturation, 0xFF);
42 state->layer_text = "Shortcuts Layer"; 179 state->layer_text = "Shortcuts Layer";
43 } 180 }
44 else if (state->status.layer & 0x80) { 181 else if (state->status.layer & 0x80) {
45 state->target_lcd_color = LCD_COLOR(VIOLET, saturation, 0xFF); 182 state->target_lcd_color = LCD_COLOR(VIOLET, saturation, 0xFF);
46 state->layer_text = "Plover"; 183 state->layer_text = "Plover";
184 start_keyframe_animation(&KITT_Scanner_animation);
185
47 } 186 }
48 else if (state->status.layer & 0x40) { 187 else if (state->status.layer & 0x40) {
49 state->target_lcd_color = LCD_COLOR(RASPBERRY, saturation, 0xFF); 188 state->target_lcd_color = LCD_COLOR(RASPBERRY, saturation, 0xFF);
@@ -68,5 +207,7 @@ static void get_visualizer_layer_and_color(visualizer_state_t* state) {
68 else { 207 else {
69 state->target_lcd_color = LCD_COLOR(YELLOW, saturation, 0xFF); 208 state->target_lcd_color = LCD_COLOR(YELLOW, saturation, 0xFF);
70 state->layer_text = "Qwerty"; 209 state->layer_text = "Qwerty";
210 stop_keyframe_animation(&KITT_Scanner_animation);
211 start_keyframe_animation(&Fade_in_all_leds);
71 } 212 }
72} \ No newline at end of file 213}
diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.h b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.h
new file mode 100644
index 000000000..c97a7a22a
--- /dev/null
+++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.h
@@ -0,0 +1,125 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef VISUALIZER_H_
18#define VISUALIZER_H_
19
20// Currently we are assuming that both the backlight and LCD are enabled
21// But it's entirely possible to write a custom visualizer that use only
22// one of them
23#ifndef LCD_BACKLIGHT_ENABLE
24#error This visualizer needs that LCD backlight is enabled
25#endif
26
27#ifndef LCD_ENABLE
28#error This visualizer needs that LCD is enabled
29#endif
30
31#include "visualizer.h"
32#include "visualizer_keyframes.h"
33#include "lcd_keyframes.h"
34#include "lcd_backlight_keyframes.h"
35#include "system/serial_link.h"
36#include "led.h"
37#include "default_animations.h"
38
39static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
40static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
41
42static bool initial_update = true;
43
44// Feel free to modify the animations below, or even add new ones if needed
45extern keyframe_animation_t KITT_Scanner_animation;
46
47static keyframe_animation_t lcd_layer_display = {
48 .num_frames = 1,
49 .loop = false,
50 .frame_lengths = {gfxMillisecondsToTicks(0)},
51 .frame_functions = {lcd_keyframe_display_layer_and_led_states}
52};
53
54// The color animation animates the LCD color when you change layers
55static keyframe_animation_t color_animation = {
56 .num_frames = 2,
57 .loop = false,
58 // Note that there's a 200 ms no-operation frame,
59 // this prevents the color from changing when activating the layer
60 // momentarily
61 .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)},
62 .frame_functions = {keyframe_no_operation, lcd_backlight_keyframe_animate_color},
63};
64
65void initialize_user_visualizer(visualizer_state_t* state) {
66 // The brightness will be dynamically adjustable in the future
67 // But for now, change it here.
68 lcd_backlight_brightness(130);
69 state->current_lcd_color = initial_color;
70 state->target_lcd_color = logo_background_color;
71 initial_update = true;
72 start_keyframe_animation(&default_startup_animation);
73}
74
75
76// This function should be implemented by the keymap visualizer
77// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
78// that the simple_visualizer assumes that you are updating
79// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
80// stopped. This can be done by either double buffering it or by using constant strings
81static void get_visualizer_layer_and_color(visualizer_state_t* state);
82
83void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
84 // Add more tests, change the colors and layer texts here
85 // Usually you want to check the high bits (higher layers first)
86 // because that's the order layers are processed for keypresses
87 // You can for check for example:
88 // state->status.layer
89 // state->status.default_layer
90 // state->status.leds (see led.h for available statuses)
91
92 uint32_t prev_color = state->target_lcd_color;
93 const char* prev_layer_text = state->layer_text;
94
95 get_visualizer_layer_and_color(state);
96
97 if (initial_update || prev_color != state->target_lcd_color) {
98 start_keyframe_animation(&color_animation);
99 }
100
101 if (initial_update || prev_layer_text != state->layer_text) {
102 start_keyframe_animation(&lcd_layer_display);
103 }
104 // You can also stop existing animations, and start your custom ones here
105 // remember that you should normally have only one animation for the LCD
106 // and one for the background. But you can also combine them if you want.
107
108}
109
110void user_visualizer_suspend(visualizer_state_t* state) {
111 state->layer_text = "Suspending...";
112 uint8_t hue = LCD_HUE(state->current_lcd_color);
113 uint8_t sat = LCD_SAT(state->current_lcd_color);
114 state->target_lcd_color = LCD_COLOR(hue, sat, 0);
115 start_keyframe_animation(&default_suspend_animation);
116}
117
118void user_visualizer_resume(visualizer_state_t* state) {
119 state->current_lcd_color = initial_color;
120 state->target_lcd_color = logo_background_color;
121 initial_update = true;
122 start_keyframe_animation(&default_startup_animation);
123}
124
125#endif /* VISUALIZER_H_ */