diff options
Diffstat (limited to 'keyboards/helix/pico/keymaps/default')
-rw-r--r-- | keyboards/helix/pico/keymaps/default/keymap.c | 135 | ||||
-rw-r--r-- | keyboards/helix/pico/keymaps/default/readme.md | 6 | ||||
-rw-r--r-- | keyboards/helix/pico/keymaps/default/readme_jp.md | 14 | ||||
-rw-r--r-- | keyboards/helix/pico/keymaps/default/rules.mk | 6 |
4 files changed, 21 insertions, 140 deletions
diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c index f23ab8576..11ee30258 100644 --- a/keyboards/helix/pico/keymaps/default/keymap.c +++ b/keyboards/helix/pico/keymaps/default/keymap.c | |||
@@ -1,24 +1,25 @@ | |||
1 | /* Copyright 2018 MakotoKurauchi | ||
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 | */ | ||
1 | #include QMK_KEYBOARD_H | 16 | #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 | 17 | ||
15 | #ifdef RGBLIGHT_ENABLE | 18 | #ifdef RGBLIGHT_ENABLE |
16 | //Following line allows macro to read current RGB settings | 19 | //Following line allows macro to read current RGB settings |
17 | extern rgblight_config_t rgblight_config; | 20 | extern rgblight_config_t rgblight_config; |
18 | #endif | 21 | #endif |
19 | 22 | ||
20 | extern uint8_t is_master; | ||
21 | |||
22 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 23 | // Each layer gets a name for readability, which is then used in the keymap matrix below. |
23 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | 24 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. |
24 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | 25 | // Layer names don't all need to be of the same length, obviously, and you can also skip them |
@@ -334,10 +335,6 @@ void matrix_init_user(void) { | |||
334 | #ifdef RGBLIGHT_ENABLE | 335 | #ifdef RGBLIGHT_ENABLE |
335 | RGB_current_mode = rgblight_config.mode; | 336 | RGB_current_mode = rgblight_config.mode; |
336 | #endif | 337 | #endif |
337 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | ||
338 | #ifdef SSD1306OLED | ||
339 | iota_gfx_init(!has_usb()); // turns on the display | ||
340 | #endif | ||
341 | } | 338 | } |
342 | 339 | ||
343 | 340 | ||
@@ -365,105 +362,3 @@ void music_scale_user(void) | |||
365 | } | 362 | } |
366 | 363 | ||
367 | #endif | 364 | #endif |
368 | |||
369 | |||
370 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
371 | #ifdef SSD1306OLED | ||
372 | |||
373 | void matrix_scan_user(void) { | ||
374 | iota_gfx_task(); // this is what updates the display continuously | ||
375 | } | ||
376 | |||
377 | void matrix_update(struct CharacterMatrix *dest, | ||
378 | const struct CharacterMatrix *source) { | ||
379 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
380 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
381 | dest->dirty = true; | ||
382 | } | ||
383 | } | ||
384 | |||
385 | //assign the right code to your layers for OLED display | ||
386 | #define L_BASE 0 | ||
387 | #define L_LOWER (1<<_LOWER) | ||
388 | #define L_RAISE (1<<_RAISE) | ||
389 | #define L_ADJUST (1<<_ADJUST) | ||
390 | #define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) | ||
391 | |||
392 | static void render_logo(struct CharacterMatrix *matrix) { | ||
393 | |||
394 | static char logo[]={ | ||
395 | 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, | ||
396 | 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, | ||
397 | 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, | ||
398 | 0}; | ||
399 | matrix_write(matrix, logo); | ||
400 | //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); | ||
401 | } | ||
402 | |||
403 | |||
404 | |||
405 | void render_status(struct CharacterMatrix *matrix) { | ||
406 | |||
407 | // Render to mode icon | ||
408 | static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; | ||
409 | if(keymap_config.swap_lalt_lgui==false){ | ||
410 | matrix_write(matrix, logo[0][0]); | ||
411 | matrix_write_P(matrix, PSTR("\n")); | ||
412 | matrix_write(matrix, logo[0][1]); | ||
413 | }else{ | ||
414 | matrix_write(matrix, logo[1][0]); | ||
415 | matrix_write_P(matrix, PSTR("\n")); | ||
416 | matrix_write(matrix, logo[1][1]); | ||
417 | } | ||
418 | |||
419 | // 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 | ||
420 | char buf[40]; | ||
421 | snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); | ||
422 | matrix_write_P(matrix, PSTR("\nLayer: ")); | ||
423 | switch (layer_state) { | ||
424 | case L_BASE: | ||
425 | matrix_write_P(matrix, PSTR("Default")); | ||
426 | break; | ||
427 | case L_RAISE: | ||
428 | matrix_write_P(matrix, PSTR("Raise")); | ||
429 | break; | ||
430 | case L_LOWER: | ||
431 | matrix_write_P(matrix, PSTR("Lower")); | ||
432 | break; | ||
433 | case L_ADJUST: | ||
434 | case L_ADJUST_TRI: | ||
435 | matrix_write_P(matrix, PSTR("Adjust")); | ||
436 | break; | ||
437 | default: | ||
438 | matrix_write(matrix, buf); | ||
439 | } | ||
440 | |||
441 | // Host Keyboard LED Status | ||
442 | char led[40]; | ||
443 | snprintf(led, sizeof(led), "\n%s %s %s", | ||
444 | (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", | ||
445 | (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", | ||
446 | (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); | ||
447 | matrix_write(matrix, led); | ||
448 | } | ||
449 | |||
450 | |||
451 | void iota_gfx_task_user(void) { | ||
452 | struct CharacterMatrix matrix; | ||
453 | |||
454 | #if DEBUG_TO_SCREEN | ||
455 | if (debug_enable) { | ||
456 | return; | ||
457 | } | ||
458 | #endif | ||
459 | |||
460 | matrix_clear(&matrix); | ||
461 | if(is_master){ | ||
462 | render_status(&matrix); | ||
463 | }else{ | ||
464 | render_logo(&matrix); | ||
465 | } | ||
466 | matrix_update(&display, &matrix); | ||
467 | } | ||
468 | |||
469 | #endif | ||
diff --git a/keyboards/helix/pico/keymaps/default/readme.md b/keyboards/helix/pico/keymaps/default/readme.md index 789097021..a6c81651a 100644 --- a/keyboards/helix/pico/keymaps/default/readme.md +++ b/keyboards/helix/pico/keymaps/default/readme.md | |||
@@ -96,10 +96,8 @@ see `qmk_firmware/keyboards/helix/pico/keymaps/default/rules.mk` | |||
96 | 96 | ||
97 | ``` | 97 | ``` |
98 | # Helix Spacific Build Options | 98 | # Helix Spacific Build Options |
99 | # you can uncomment and edit follows 6 Variables | 99 | # you can uncomment and edit follows 4 Variables |
100 | # jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 | 100 | # jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 |
101 | # OLED_ENABLE = no # OLED_ENABLE | ||
102 | # LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" | ||
103 | # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) | 101 | # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) |
104 | # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) | 102 | # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) |
105 | # LED_ANIMATIONS = yes # LED animations | 103 | # LED_ANIMATIONS = yes # LED animations |
diff --git a/keyboards/helix/pico/keymaps/default/readme_jp.md b/keyboards/helix/pico/keymaps/default/readme_jp.md index 28594dafc..73f97ad9a 100644 --- a/keyboards/helix/pico/keymaps/default/readme_jp.md +++ b/keyboards/helix/pico/keymaps/default/readme_jp.md | |||
@@ -58,16 +58,13 @@ | |||
58 | 58 | ||
59 | ## カスタマイズ | 59 | ## カスタマイズ |
60 | 60 | ||
61 | オプションの OLED をつけたり、 | ||
62 | RGB バックライトまたは、RGB Underglow をつけた場合は、 | 61 | RGB バックライトまたは、RGB Underglow をつけた場合は、 |
63 | `qmk_firmware/keyboards/helix/pico/keymaps/default/rules.mk` の以下の部分を編集して機能を有効化してください。 | 62 | `qmk_firmware/keyboards/helix/pico/keymaps/default/rules.mk` の以下の部分を編集して機能を有効化してください。 |
64 | 63 | ||
65 | ``` | 64 | ``` |
66 | # Helix Spacific Build Options | 65 | # Helix Spacific Build Options |
67 | # you can uncomment and edit follows 6 Variables | 66 | # you can uncomment and edit follows 4 Variables |
68 | # jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 | 67 | # jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 |
69 | # OLED_ENABLE = no # OLED_ENABLE | ||
70 | # LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" | ||
71 | # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) | 68 | # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) |
72 | # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) | 69 | # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) |
73 | # LED_ANIMATIONS = yes # LED animations | 70 | # LED_ANIMATIONS = yes # LED animations |
@@ -89,13 +86,6 @@ rules.mk の下記の部分を編集して no を yes に変更してくださ | |||
89 | LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) | 86 | LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) |
90 | ``` | 87 | ``` |
91 | 88 | ||
92 | ## OLEDを有効にする | ||
93 | |||
94 | rules.mk の下記の部分を編集して no を yes に変更してください。 | ||
95 | ``` | ||
96 | OLED_ENABLE = yes # OLED_ENABLE | ||
97 | ``` | ||
98 | |||
99 | ## iPad/iPhoneサポートを有効にする。 | 89 | ## iPad/iPhoneサポートを有効にする。 |
100 | 90 | ||
101 | rules.mk の下記の部分を編集して no を yes に変更してください。 | 91 | rules.mk の下記の部分を編集して no を yes に変更してください。 |
diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk index b50519fef..9a29406c1 100644 --- a/keyboards/helix/pico/keymaps/default/rules.mk +++ b/keyboards/helix/pico/keymaps/default/rules.mk | |||
@@ -3,10 +3,8 @@ AUDIO_ENABLE = yes # Audio output | |||
3 | LTO_ENABLE = no # if firmware size over limit, try this option | 3 | LTO_ENABLE = no # if firmware size over limit, try this option |
4 | 4 | ||
5 | # Helix Spacific Build Options | 5 | # Helix Spacific Build Options |
6 | # you can uncomment and edit follows 6 Variables | 6 | # you can uncomment and edit follows 4 Variables |
7 | # jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 | 7 | # jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 |
8 | # OLED_ENABLE = no # OLED_ENABLE | ||
9 | # LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" | ||
10 | # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) | 8 | # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) |
11 | # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) | 9 | # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) |
12 | # LED_ANIMATIONS = yes # LED animations | 10 | # LED_ANIMATIONS = yes # LED animations |