diff options
Diffstat (limited to 'keyboards/helix/pico/keymaps/default/keymap.c')
-rw-r--r-- | keyboards/helix/pico/keymaps/default/keymap.c | 474 |
1 files changed, 474 insertions, 0 deletions
diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c new file mode 100644 index 000000000..75221d485 --- /dev/null +++ b/keyboards/helix/pico/keymaps/default/keymap.c | |||
@@ -0,0 +1,474 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | #include "bootloader.h" | ||
3 | #ifdef PROTOCOL_LUFA | ||
4 | #include "lufa.h" | ||
5 | #include "split_util.h" | ||
6 | #endif | ||
7 | #ifdef AUDIO_ENABLE | ||
8 | #include "audio.h" | ||
9 | #endif | ||
10 | #ifdef SSD1306OLED | ||
11 | #include "ssd1306.h" | ||
12 | #endif | ||
13 | |||
14 | extern keymap_config_t keymap_config; | ||
15 | |||
16 | #ifdef RGBLIGHT_ENABLE | ||
17 | //Following line allows macro to read current RGB settings | ||
18 | extern rgblight_config_t rgblight_config; | ||
19 | #endif | ||
20 | |||
21 | extern uint8_t is_master; | ||
22 | |||
23 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
24 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
25 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
26 | // entirely and just use numbers. | ||
27 | enum layer_number { | ||
28 | _QWERTY = 0, | ||
29 | _COLEMAK, | ||
30 | _DVORAK, | ||
31 | _LOWER, | ||
32 | _RAISE, | ||
33 | _ADJUST | ||
34 | }; | ||
35 | |||
36 | enum custom_keycodes { | ||
37 | QWERTY = SAFE_RANGE, | ||
38 | COLEMAK, | ||
39 | DVORAK, | ||
40 | LOWER, | ||
41 | RAISE, | ||
42 | ADJUST, | ||
43 | BACKLIT, | ||
44 | EISU, | ||
45 | KANA, | ||
46 | RGBRST | ||
47 | }; | ||
48 | |||
49 | enum macro_keycodes { | ||
50 | KC_SAMPLEMACRO, | ||
51 | }; | ||
52 | |||
53 | |||
54 | // Fillers to make layering more clear | ||
55 | #define _______ KC_TRNS | ||
56 | #define XXXXXXX KC_NO | ||
57 | //Macros | ||
58 | #define M_SAMPLE M(KC_SAMPLEMACRO) | ||
59 | |||
60 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
61 | |||
62 | /* Qwerty | ||
63 | * ,-----------------------------------------. ,-----------------------------------------. | ||
64 | * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | | ||
65 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
66 | * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | | ||
67 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
68 | * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | | ||
69 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | ||
70 | * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | | ||
71 | * `-------------------------------------------------------------------------------------------------' | ||
72 | */ | ||
73 | |||
74 | [_QWERTY] = LAYOUT( \ | ||
75 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ | ||
76 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
77 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
78 | ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
79 | ), | ||
80 | /* Colemak | ||
81 | * ,-----------------------------------------. ,-----------------------------------------. | ||
82 | * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | | ||
83 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
84 | * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | | ||
85 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
86 | * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | | ||
87 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | ||
88 | * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | | ||
89 | * `-------------------------------------------------------------------------------------------------' | ||
90 | */ | ||
91 | [_COLEMAK] = LAYOUT( \ | ||
92 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ | ||
93 | KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ | ||
94 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
95 | ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
96 | ), | ||
97 | |||
98 | /* Dvorak | ||
99 | * ,-----------------------------------------. ,-----------------------------------------. | ||
100 | * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Bksp | | ||
101 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
102 | * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | | ||
103 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
104 | * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | | ||
105 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | ||
106 | * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | | ||
107 | * `-------------------------------------------------------------------------------------------------' | ||
108 | */ | ||
109 | [_DVORAK] = LAYOUT( \ | ||
110 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ | ||
111 | KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ | ||
112 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ | ||
113 | ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
114 | ), | ||
115 | |||
116 | /* Lower | ||
117 | * ,-----------------------------------------. ,-----------------------------------------. | ||
118 | * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | | ||
119 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
120 | * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | | ||
121 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
122 | * | | F7 | F8 | F9 | F10 | F11 | | F12 | | PrSc | Home | End | | | ||
123 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | ||
124 | * | | | | | | | | | | | Next | Vol- | Vol+ | Play | | ||
125 | * `-------------------------------------------------------------------------------------------------' | ||
126 | */ | ||
127 | [_LOWER] = LAYOUT( \ | ||
128 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ | ||
129 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ | ||
130 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_HOME, KC_END, _______, \ | ||
131 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
132 | ), | ||
133 | |||
134 | /* Raise | ||
135 | * ,-----------------------------------------. ,-----------------------------------------. | ||
136 | * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | | ||
137 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
138 | * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | | ||
139 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
140 | * | | F7 | F8 | F9 | F10 | F11 | | F12 | | PrSc |PageDn|PageUp| | | ||
141 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | ||
142 | * | | | | | | | | | | | Next | Vol- | Vol+ | Play | | ||
143 | * `-------------------------------------------------------------------------------------------------' | ||
144 | */ | ||
145 | [_RAISE] = LAYOUT( \ | ||
146 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ | ||
147 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ | ||
148 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_PGDN, KC_PGUP, _______, \ | ||
149 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
150 | ), | ||
151 | |||
152 | /* Adjust (Lower + Raise) | ||
153 | * ,-----------------------------------------. ,-----------------------------------------. | ||
154 | * | | Reset| | | | | | | | | | | | | ||
155 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
156 | * | |Aud on|Audoff|MU TOG|MU MOD| Mac | | Win |Qwerty|Colemk|Dvorak| | | | ||
157 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
158 | * | |CK TOG|CK RST| CK UP|CK DWN| | | | |RGB ON| HUE+ | SAT+ | VAL+ | | ||
159 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | ||
160 | * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | | ||
161 | * `-------------------------------------------------------------------------------------------------' | ||
162 | */ | ||
163 | [_ADJUST] = LAYOUT( \ | ||
164 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
165 | _______, AU_ON, AU_OFF, MU_TOG, MU_MOD, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ | ||
166 | _______, CK_TOGG, CK_RST, CK_UP, CK_DOWN, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ | ||
167 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ | ||
168 | ) | ||
169 | }; | ||
170 | |||
171 | |||
172 | |||
173 | #ifdef AUDIO_ENABLE | ||
174 | |||
175 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
176 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
177 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
178 | float tone_plover[][2] = SONG(PLOVER_SOUND); | ||
179 | float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); | ||
180 | float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); | ||
181 | #endif | ||
182 | |||
183 | // define variables for reactive RGB | ||
184 | bool TOG_STATUS = false; | ||
185 | int RGB_current_mode; | ||
186 | |||
187 | void persistent_default_layer_set(uint16_t default_layer) { | ||
188 | eeconfig_update_default_layer(default_layer); | ||
189 | default_layer_set(default_layer); | ||
190 | } | ||
191 | |||
192 | // Setting ADJUST layer RGB back to default | ||
193 | void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { | ||
194 | if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { | ||
195 | #ifdef RGBLIGHT_ENABLE | ||
196 | //rgblight_mode(RGB_current_mode); | ||
197 | #endif | ||
198 | layer_on(layer3); | ||
199 | } else { | ||
200 | layer_off(layer3); | ||
201 | } | ||
202 | } | ||
203 | |||
204 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
205 | switch (keycode) { | ||
206 | case QWERTY: | ||
207 | if (record->event.pressed) { | ||
208 | #ifdef AUDIO_ENABLE | ||
209 | PLAY_SONG(tone_qwerty); | ||
210 | #endif | ||
211 | persistent_default_layer_set(1UL<<_QWERTY); | ||
212 | } | ||
213 | return false; | ||
214 | break; | ||
215 | case COLEMAK: | ||
216 | if (record->event.pressed) { | ||
217 | #ifdef AUDIO_ENABLE | ||
218 | PLAY_SONG(tone_colemak); | ||
219 | #endif | ||
220 | persistent_default_layer_set(1UL<<_COLEMAK); | ||
221 | } | ||
222 | return false; | ||
223 | break; | ||
224 | case DVORAK: | ||
225 | if (record->event.pressed) { | ||
226 | #ifdef AUDIO_ENABLE | ||
227 | PLAY_SONG(tone_dvorak); | ||
228 | #endif | ||
229 | persistent_default_layer_set(1UL<<_DVORAK); | ||
230 | } | ||
231 | return false; | ||
232 | break; | ||
233 | case LOWER: | ||
234 | if (record->event.pressed) { | ||
235 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
236 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
237 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
238 | } else { | ||
239 | TOG_STATUS = !TOG_STATUS; | ||
240 | #ifdef RGBLIGHT_ENABLE | ||
241 | //rgblight_mode(16); | ||
242 | #endif | ||
243 | } | ||
244 | layer_on(_LOWER); | ||
245 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
246 | } else { | ||
247 | #ifdef RGBLIGHT_ENABLE | ||
248 | //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
249 | #endif | ||
250 | TOG_STATUS = false; | ||
251 | layer_off(_LOWER); | ||
252 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
253 | } | ||
254 | return false; | ||
255 | break; | ||
256 | case RAISE: | ||
257 | if (record->event.pressed) { | ||
258 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
259 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
260 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
261 | } else { | ||
262 | TOG_STATUS = !TOG_STATUS; | ||
263 | #ifdef RGBLIGHT_ENABLE | ||
264 | //rgblight_mode(15); | ||
265 | #endif | ||
266 | } | ||
267 | layer_on(_RAISE); | ||
268 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
269 | } else { | ||
270 | #ifdef RGBLIGHT_ENABLE | ||
271 | //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
272 | #endif | ||
273 | layer_off(_RAISE); | ||
274 | TOG_STATUS = false; | ||
275 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
276 | } | ||
277 | return false; | ||
278 | break; | ||
279 | case ADJUST: | ||
280 | if (record->event.pressed) { | ||
281 | layer_on(_ADJUST); | ||
282 | } else { | ||
283 | layer_off(_ADJUST); | ||
284 | } | ||
285 | return false; | ||
286 | break; | ||
287 | //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released | ||
288 | case RGB_MOD: | ||
289 | #ifdef RGBLIGHT_ENABLE | ||
290 | if (record->event.pressed) { | ||
291 | rgblight_mode(RGB_current_mode); | ||
292 | rgblight_step(); | ||
293 | RGB_current_mode = rgblight_config.mode; | ||
294 | } | ||
295 | #endif | ||
296 | return false; | ||
297 | break; | ||
298 | case EISU: | ||
299 | if (record->event.pressed) { | ||
300 | if(keymap_config.swap_lalt_lgui==false){ | ||
301 | register_code(KC_LANG2); | ||
302 | }else{ | ||
303 | SEND_STRING(SS_LALT("`")); | ||
304 | } | ||
305 | } else { | ||
306 | unregister_code(KC_LANG2); | ||
307 | } | ||
308 | return false; | ||
309 | break; | ||
310 | case KANA: | ||
311 | if (record->event.pressed) { | ||
312 | if(keymap_config.swap_lalt_lgui==false){ | ||
313 | register_code(KC_LANG1); | ||
314 | }else{ | ||
315 | SEND_STRING(SS_LALT("`")); | ||
316 | } | ||
317 | } else { | ||
318 | unregister_code(KC_LANG1); | ||
319 | } | ||
320 | return false; | ||
321 | break; | ||
322 | case RGBRST: | ||
323 | #ifdef RGBLIGHT_ENABLE | ||
324 | if (record->event.pressed) { | ||
325 | eeconfig_update_rgblight_default(); | ||
326 | rgblight_enable(); | ||
327 | RGB_current_mode = rgblight_config.mode; | ||
328 | } | ||
329 | #endif | ||
330 | break; | ||
331 | } | ||
332 | return true; | ||
333 | } | ||
334 | |||
335 | void matrix_init_user(void) { | ||
336 | #ifdef AUDIO_ENABLE | ||
337 | startup_user(); | ||
338 | #endif | ||
339 | #ifdef RGBLIGHT_ENABLE | ||
340 | RGB_current_mode = rgblight_config.mode; | ||
341 | #endif | ||
342 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | ||
343 | #ifdef SSD1306OLED | ||
344 | iota_gfx_init(!has_usb()); // turns on the display | ||
345 | #endif | ||
346 | } | ||
347 | |||
348 | |||
349 | #ifdef AUDIO_ENABLE | ||
350 | |||
351 | void startup_user() | ||
352 | { | ||
353 | _delay_ms(50); // gets rid of tick | ||
354 | } | ||
355 | |||
356 | void shutdown_user() | ||
357 | { | ||
358 | _delay_ms(150); | ||
359 | stop_all_notes(); | ||
360 | } | ||
361 | |||
362 | void music_on_user(void) | ||
363 | { | ||
364 | music_scale_user(); | ||
365 | } | ||
366 | |||
367 | void music_scale_user(void) | ||
368 | { | ||
369 | PLAY_SONG(music_scale); | ||
370 | } | ||
371 | |||
372 | #endif | ||
373 | |||
374 | |||
375 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
376 | #ifdef SSD1306OLED | ||
377 | |||
378 | void matrix_scan_user(void) { | ||
379 | iota_gfx_task(); // this is what updates the display continuously | ||
380 | } | ||
381 | |||
382 | void matrix_update(struct CharacterMatrix *dest, | ||
383 | const struct CharacterMatrix *source) { | ||
384 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
385 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
386 | dest->dirty = true; | ||
387 | } | ||
388 | } | ||
389 | |||
390 | //assign the right code to your layers for OLED display | ||
391 | #define L_BASE 0 | ||
392 | #define L_LOWER (1<<_LOWER) | ||
393 | #define L_RAISE (1<<_RAISE) | ||
394 | #define L_ADJUST (1<<_ADJUST) | ||
395 | #define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) | ||
396 | |||
397 | static void render_logo(struct CharacterMatrix *matrix) { | ||
398 | |||
399 | static char logo[]={ | ||
400 | 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, | ||
401 | 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, | ||
402 | 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, | ||
403 | 0}; | ||
404 | matrix_write(matrix, logo); | ||
405 | //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); | ||
406 | } | ||
407 | |||
408 | |||
409 | |||
410 | void render_status(struct CharacterMatrix *matrix) { | ||
411 | |||
412 | // Render to mode icon | ||
413 | static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; | ||
414 | if(keymap_config.swap_lalt_lgui==false){ | ||
415 | matrix_write(matrix, logo[0][0]); | ||
416 | matrix_write_P(matrix, PSTR("\n")); | ||
417 | matrix_write(matrix, logo[0][1]); | ||
418 | }else{ | ||
419 | matrix_write(matrix, logo[1][0]); | ||
420 | matrix_write_P(matrix, PSTR("\n")); | ||
421 | matrix_write(matrix, logo[1][1]); | ||
422 | } | ||
423 | |||
424 | // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below | ||
425 | char buf[40]; | ||
426 | snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); | ||
427 | matrix_write_P(matrix, PSTR("\nLayer: ")); | ||
428 | switch (layer_state) { | ||
429 | case L_BASE: | ||
430 | matrix_write_P(matrix, PSTR("Default")); | ||
431 | break; | ||
432 | case L_RAISE: | ||
433 | matrix_write_P(matrix, PSTR("Raise")); | ||
434 | break; | ||
435 | case L_LOWER: | ||
436 | matrix_write_P(matrix, PSTR("Lower")); | ||
437 | break; | ||
438 | case L_ADJUST: | ||
439 | case L_ADJUST_TRI: | ||
440 | matrix_write_P(matrix, PSTR("Adjust")); | ||
441 | break; | ||
442 | default: | ||
443 | matrix_write(matrix, buf); | ||
444 | } | ||
445 | |||
446 | // Host Keyboard LED Status | ||
447 | char led[40]; | ||
448 | snprintf(led, sizeof(led), "\n%s %s %s", | ||
449 | (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", | ||
450 | (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", | ||
451 | (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); | ||
452 | matrix_write(matrix, led); | ||
453 | } | ||
454 | |||
455 | |||
456 | void iota_gfx_task_user(void) { | ||
457 | struct CharacterMatrix matrix; | ||
458 | |||
459 | #if DEBUG_TO_SCREEN | ||
460 | if (debug_enable) { | ||
461 | return; | ||
462 | } | ||
463 | #endif | ||
464 | |||
465 | matrix_clear(&matrix); | ||
466 | if(is_master){ | ||
467 | render_status(&matrix); | ||
468 | }else{ | ||
469 | render_logo(&matrix); | ||
470 | } | ||
471 | matrix_update(&display, &matrix); | ||
472 | } | ||
473 | |||
474 | #endif | ||