diff options
| author | Jonas Avellana <14019120+ninjonas@users.noreply.github.com> | 2020-01-31 23:38:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-31 22:38:05 -0800 |
| commit | 1aee492c0f88b1a96fabdf750a03ed128d9d844a (patch) | |
| tree | fc785cfa639fc3b66720be08e682c3cfaeace41f /keyboards/kyria/keymaps | |
| parent | fdabf524f2c0047ec920b88ace07096009cdd759 (diff) | |
| download | qmk_firmware-1aee492c0f88b1a96fabdf750a03ed128d9d844a.tar.gz qmk_firmware-1aee492c0f88b1a96fabdf750a03ed128d9d844a.zip | |
[keymap(kyria), refactor] created kyria keymap. refactored ninjonas userspace (#8053)
* [keymap(kyria), refactor] created kyria keymap. refactored ninjonas userspace and keyboards
* [fix(#8053)] removed redundant code based off Duckle29's code review
* [fix(#8053)] fixing typos
* [refactor(#8053)] updating oled timeout
* [fix(8053) resolved code review issues identified by noroadsleft
Diffstat (limited to 'keyboards/kyria/keymaps')
| -rw-r--r-- | keyboards/kyria/keymaps/ninjonas/config.h | 41 | ||||
| -rw-r--r-- | keyboards/kyria/keymaps/ninjonas/keymap.c | 315 | ||||
| -rw-r--r-- | keyboards/kyria/keymaps/ninjonas/rules.mk | 4 |
3 files changed, 360 insertions, 0 deletions
diff --git a/keyboards/kyria/keymaps/ninjonas/config.h b/keyboards/kyria/keymaps/ninjonas/config.h new file mode 100644 index 000000000..409058ad7 --- /dev/null +++ b/keyboards/kyria/keymaps/ninjonas/config.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* Copyright 2020 ninjonas | ||
| 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 | #pragma once | ||
| 18 | |||
| 19 | #define TAPPING_TERM 200 | ||
| 20 | |||
| 21 | #ifdef OLED_DRIVER_ENABLE | ||
| 22 | #define OLED_DISPLAY_128X64 | ||
| 23 | #define OLED_TIMEOUT 30000 | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #ifdef RGBLIGHT_ENABLE | ||
| 27 | # define RGBLIGHT_SLEEP | ||
| 28 | # define RGBLIGHT_LIMIT_VAL 200 | ||
| 29 | # define RGBLIGHT_HUE_STEP 8 | ||
| 30 | # define RGBLIGHT_SAT_STEP 8 | ||
| 31 | # define RGBLIGHT_VAL_STEP 8 | ||
| 32 | # define RGBLIGHT_SPLIT | ||
| 33 | #endif | ||
| 34 | |||
| 35 | // Allows to use either side as the master. Look at the documentation for info: | ||
| 36 | // https://docs.qmk.fm/#/config_options?id=setting-handedness | ||
| 37 | #define EE_HANDS | ||
| 38 | |||
| 39 | // If you are using an Elite C rev3 on the slave side, uncomment the lines below: | ||
| 40 | #define SPLIT_USB_DETECT | ||
| 41 | #define SPLIT_USB_TIMEOUT 1000 | ||
diff --git a/keyboards/kyria/keymaps/ninjonas/keymap.c b/keyboards/kyria/keymaps/ninjonas/keymap.c new file mode 100644 index 000000000..1337c4427 --- /dev/null +++ b/keyboards/kyria/keymaps/ninjonas/keymap.c | |||
| @@ -0,0 +1,315 @@ | |||
| 1 | /* Copyright 2020 ninjonas | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 17 | #include "ninjonas.h" | ||
| 18 | |||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 20 | |||
| 21 | [_QWERTY] = LAYOUT_wrapper( | ||
| 22 | // ,------—————————-------------------------------------. ,--------—————————-----------------------------------. | ||
| 23 | _____________________QWERTY_L1______________________, _____________________QWERTY_R1______________________, | ||
| 24 | // |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------| | ||
| 25 | _____________________QWERTY_L2______________________, _____________________QWERTY_R2______________________, | ||
| 26 | // |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------| | ||
| 27 | _____________________QWERTY_L3______________________,XXXXXXX,KC_LALT, M_COPA,XXXXXXX,_____________________QWERTY_R3______________________, | ||
| 28 | // `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------' | ||
| 29 | _____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE | ||
| 30 | // `----------------------------------------' `----------------------------------------' | ||
| 31 | ), | ||
| 32 | |||
| 33 | [_DVORAK] = LAYOUT_wrapper( | ||
| 34 | // ,------—————————-------------------------------------. ,--------—————————-----------------------------------. | ||
| 35 | _____________________DVORAK_L1______________________, _____________________DVORAK_R1______________________, | ||
| 36 | // |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------| | ||
| 37 | _____________________DVORAK_L2______________________, _____________________DVORAK_R2______________________, | ||
| 38 | // |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------| | ||
| 39 | _____________________DVORAK_L3______________________,XXXXXXX,KC_LALT, M_COPA,XXXXXXX,_____________________DVORAK_R3______________________, | ||
| 40 | // `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------' | ||
| 41 | _____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE | ||
| 42 | // `----------------------------------------' `----------------------------------------' | ||
| 43 | ), | ||
| 44 | |||
| 45 | [_COLEMAK] = LAYOUT_wrapper( | ||
| 46 | // ,------—————————-------------------------------------. ,--------—————————-----------------------------------. | ||
| 47 | _____________________COLEMAK_L1_____________________, _____________________COLEMAK_R1_____________________, | ||
| 48 | // |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------| | ||
| 49 | _____________________COLEMAK_L2_____________________, _____________________COLEMAK_R2_____________________, | ||
| 50 | // |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------| | ||
| 51 | _____________________COLEMAK_L3_____________________,XXXXXXX,KC_LALT, M_COPA,XXXXXXX,_____________________COLEMAK_R3_____________________, | ||
| 52 | // `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------' | ||
| 53 | _____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE | ||
| 54 | // `----------------------------------------' `----------------------------------------' | ||
| 55 | ), | ||
| 56 | |||
| 57 | [_LOWER] = LAYOUT_wrapper( | ||
| 58 | // ,------—————————-------------------------------------. ,--------—————————-----------------------------------. | ||
| 59 | _____________________LOWER_L1_______________________, _____________________LOWER_R1_______________________, | ||
| 60 | // |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------| | ||
| 61 | _____________________LOWER_L2_______________________, _____________________LOWER_R2_______________________, | ||
| 62 | // |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------| | ||
| 63 | _____________________LOWER_L3_______________________,_______,_______, _______,_______,_____________________LOWER_R3_______________________, | ||
| 64 | // `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------' | ||
| 65 | _______,_______,_______,_______,_______, _______,_______,_______,_______,_______ | ||
| 66 | // `----------------------------------------' `----------------------------------------' | ||
| 67 | ), | ||
| 68 | |||
| 69 | [_RAISE] = LAYOUT_wrapper( | ||
| 70 | // ,------—————————-------------------------------------. ,--------—————————-----------------------------------. | ||
| 71 | _____________________NUM_LEFT_______________________, _____________________NUM_RIGHT______________________, | ||
| 72 | // |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------| | ||
| 73 | _____________________SYM_LEFT_______________________, _____________________SYM_RIGHT______________________, | ||
| 74 | // |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------| | ||
| 75 | _____________________FUNC_LEFT______________________,_______,_______, _______,_______,_____________________FUNC_RIGHT_____________________, | ||
| 76 | // `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------' | ||
| 77 | _______,_______,_______,_______,_______, _______,_______,_______,_______,_______ | ||
| 78 | // `----------------------------------------' `----------------------------------------' | ||
| 79 | ), | ||
| 80 | |||
| 81 | [_ADJUST] = LAYOUT_wrapper( | ||
| 82 | // ,------—————————-------------------------------------. ,--------—————————-----------------------------------. | ||
| 83 | _____________________ADJUST_L1______________________, _____________________ADJUST_R1______________________, | ||
| 84 | // |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------| | ||
| 85 | _____________________ADJUST_L2______________________, _____________________ADJUST_R2______________________, | ||
| 86 | // |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------| | ||
| 87 | _____________________ADJUST_L3______________________,_______,_______, _______,_______,_____________________ADJUST_R3______________________, | ||
| 88 | // `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------' | ||
| 89 | _______,_______,_______,_______,_______, _______,_______,_______,_______,_______ | ||
| 90 | // `----------------------------------------' `----------------------------------------' | ||
| 91 | ), | ||
| 92 | /* | ||
| 93 | [_TEMPLATE] = LAYOUT_wrapper( | ||
| 94 | // ,------—————————-------------------------------------. ,--------—————————-----------------------------------. | ||
| 95 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
| 96 | // |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------| | ||
| 97 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
| 98 | // |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------| | ||
| 99 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
| 100 | // `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------' | ||
| 101 | XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX | ||
| 102 | // `----------------------------------------' `----------------------------------------' | ||
| 103 | ), | ||
| 104 | */ | ||
| 105 | }; | ||
| 106 | |||
| 107 | #ifdef OLED_DRIVER_ENABLE | ||
| 108 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 109 | return OLED_ROTATION_180; | ||
| 110 | } | ||
| 111 | |||
| 112 | static void render_logo(void) { | ||
| 113 | static const char PROGMEM logo[] = { | ||
| 114 | // Converter: https://javl.github.io/image2cpp/ | ||
| 115 | // Image Dimensions: 128x64 | ||
| 116 | // Code Output Format: Plain Bytes | ||
| 117 | // Draw Mode: Vertical, 1 bit per pixel | ||
| 118 | 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0x00, 0x00, 0xe0, | ||
| 119 | 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x80, 0xe0, 0xe0, 0xe0, 0xe0, 0x80, 0x00, 0x00, 0xe0, 0xe0, 0xe0, | ||
| 120 | 0xe0, 0x00, 0x60, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0xe0, 0xe0, 0x80, 0x00, 0x00, | ||
| 121 | 0xc0, 0xe0, 0xe0, 0xe0, 0x20, 0x60, 0xe0, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0xe0, | ||
| 122 | 0xe0, 0x00, 0x00, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0x00, 0x00, 0x00, | ||
| 123 | 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0xe0, 0xe0, 0xfc, 0xfe, | ||
| 124 | 0xfe, 0xfe, 0xee, 0xee, 0x0e, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, | ||
| 125 | 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, | ||
| 126 | 0x00, 0x00, 0x79, 0xfd, 0xfd, 0xfd, 0xec, 0xee, 0x76, 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, | ||
| 127 | 0x07, 0x3f, 0xff, 0xfc, 0xf8, 0xff, 0x7f, 0x07, 0x0f, 0x7f, 0xff, 0xf8, 0xfc, 0xff, 0x3f, 0x07, | ||
| 128 | 0x00, 0x00, 0x00, 0x03, 0x1f, 0xff, 0xfe, 0xf0, 0xff, 0x7f, 0x0f, 0x07, 0x3f, 0xff, 0xfc, 0xf8, | ||
| 129 | 0xff, 0x7f, 0x0f, 0x01, 0x00, 0x00, 0x01, 0x0f, 0x3f, 0xff, 0xfe, 0xf8, 0xff, 0xff, 0x1f, 0x03, | ||
| 130 | 0x00, 0x00, 0x1f, 0x7f, 0x7f, 0xff, 0xf6, 0xe6, 0xe6, 0xf7, 0xf7, 0x77, 0x37, 0x17, 0x00, 0x30, | ||
| 131 | 0x79, 0xfd, 0xfd, 0xfd, 0xee, 0xee, 0x76, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, | ||
| 132 | 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0x7f, 0x7f, 0xff, 0xf1, 0xe0, 0xe0, 0xff, 0xff, 0x7f, 0x3f, | ||
| 133 | 0x0e, 0x00, 0x0e, 0x3f, 0x7f, 0xff, 0xff, 0xe0, 0xe0, 0xe1, 0xff, 0x7f, 0x7f, 0x3f, 0x04, 0x00, | ||
| 134 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 135 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 136 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, | ||
| 137 | 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x07, 0x03, 0x00, 0x00, 0x00, | ||
| 138 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 139 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 140 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 142 | 0x00, 0x0c, 0x3c, 0xfc, 0xfc, 0xfc, 0xc0, 0x00, 0xe0, 0xfc, 0xfc, 0x7c, 0x1c, 0x00, 0xf0, 0xf8, | ||
| 143 | 0xf8, 0xfc, 0xdc, 0xdc, 0xdc, 0xfc, 0xfc, 0xf8, 0xf0, 0xe0, 0x00, 0x00, 0x30, 0xb8, 0xbc, 0xbc, | ||
| 144 | 0xdc, 0xdc, 0xdc, 0xfc, 0xfc, 0xf8, 0xf0, 0x00, 0x1c, 0x1c, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x1d, | ||
| 145 | 0x00, 0xf0, 0xf8, 0xf8, 0xfc, 0x3c, 0x1c, 0x1c, 0xfc, 0xfc, 0xf8, 0xf0, 0xc0, 0x00, 0xe0, 0xf0, | ||
| 146 | 0xf8, 0xfc, 0x3c, 0x1c, 0x1c, 0x3c, 0xfc, 0xf8, 0xf8, 0xe0, 0x00, 0x00, 0x20, 0xb8, 0xbc, 0xbc, | ||
| 147 | 0xbc, 0xdc, 0xdc, 0xfc, 0xfc, 0xfc, 0xf8, 0xe0, 0x00, 0x0c, 0x7c, 0xfc, 0xfc, 0xc0, 0x00, 0xe0, | ||
| 148 | 0xfc, 0xfc, 0xfc, 0xfc, 0xf0, 0x80, 0x00, 0xf8, 0xfc, 0xfc, 0x3c, 0x04, 0x0c, 0x7c, 0xfc, 0xfc, | ||
| 149 | 0xf0, 0x00, 0xc0, 0xfc, 0xfc, 0x7c, 0xfc, 0xf8, 0xc0, 0x00, 0xf0, 0xfc, 0xfc, 0x7c, 0x0c, 0x00, | ||
| 150 | 0x00, 0x00, 0xc0, 0xc1, 0xc7, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x03, 0x00, 0x00, 0x00, 0x07, 0x0f, | ||
| 151 | 0x1f, 0x1f, 0x1e, 0x1c, 0x1c, 0x1e, 0x1e, 0x0e, 0x06, 0x00, 0x00, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, | ||
| 152 | 0x1d, 0x1d, 0x0e, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, | ||
| 153 | 0x00, 0x07, 0x0f, 0x0f, 0x1f, 0x1e, 0x1c, 0x1c, 0x1f, 0x1f, 0x0f, 0x07, 0x01, 0x00, 0x03, 0x07, | ||
| 154 | 0x0f, 0x1f, 0x1e, 0x1c, 0x1c, 0x1e, 0x1f, 0x0f, 0x0f, 0x03, 0x00, 0x00, 0x0f, 0x1f, 0x1f, 0x1f, | ||
| 155 | 0x1d, 0x1d, 0x0c, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x03, 0x1f, 0x1f, 0x1e, 0x1f, | ||
| 156 | 0x0f, 0x01, 0x00, 0x07, 0x1f, 0x1f, 0x1f, 0x1f, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, | ||
| 157 | 0x1f, 0x1e, 0x1f, 0x1f, 0x03, 0x00, 0x03, 0x1f, 0x1f, 0x1e, 0x1f, 0x0f, 0x01, 0x00, 0x00, 0x00, | ||
| 158 | 0x00, 0x80, 0xc1, 0xf1, 0xf9, 0xf9, 0xf9, 0xb8, 0xb8, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, | ||
| 159 | 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, | ||
| 160 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, | ||
| 161 | 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, | ||
| 162 | 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, | ||
| 163 | 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, | ||
| 164 | 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, | ||
| 165 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, | ||
| 166 | 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x03, 0x7c, 0xfe, 0xff, 0xff, 0xc7, 0x83, 0x83, | ||
| 167 | 0xc7, 0xff, 0xff, 0xff, 0x7c, 0x00, 0x00, 0x7c, 0xff, 0xff, 0xff, 0xc7, 0x83, 0x83, 0xc7, 0xff, | ||
| 168 | 0xff, 0xfe, 0x7c, 0x00, 0xc0, 0xe6, 0xf7, 0xf7, 0xf7, 0xbb, 0xbb, 0xdb, 0xff, 0xff, 0xff, 0xfe, | ||
| 169 | 0x00, 0x00, 0x03, 0x1f, 0xff, 0xff, 0xf0, 0xe0, 0xfe, 0xff, 0x1f, 0x3f, 0xff, 0xfe, 0xe0, 0xf0, | ||
| 170 | 0xff, 0xff, 0x1f, 0x03, 0x00, 0x01, 0x0f, 0x7f, 0xff, 0xf8, 0xc0, 0xfc, 0xff, 0x3f, 0x1f, 0xff, | ||
| 171 | 0xfe, 0xf0, 0xe0, 0xff, 0xff, 0x3f, 0x07, 0x00, 0x01, 0x07, 0x3f, 0xff, 0xff, 0xf8, 0xe0, 0xfc, | ||
| 172 | 0xff, 0x7f, 0x0f, 0x03, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xdb, 0x9b, 0x9b, 0xdf, 0xdf, 0xdf, 0xde, | ||
| 173 | 0x1c, 0x00, 0xc0, 0xe6, 0xf7, 0xf7, 0xf7, 0xbb, 0xbb, 0xdb, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, | ||
| 174 | 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, | ||
| 175 | 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, | ||
| 176 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x03, 0x03, 0x03, 0x03, | ||
| 177 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, | ||
| 178 | 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, | ||
| 179 | 0x03, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x3f, 0x3f, 0x1f, 0x0f, | ||
| 180 | 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x00, | ||
| 181 | 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00 | ||
| 182 | }; | ||
| 183 | oled_write_raw_P(logo, sizeof(logo)); | ||
| 184 | } | ||
| 185 | |||
| 186 | static void render_qmk_logo(void) { | ||
| 187 | static const char PROGMEM qmk_logo[] = { | ||
| 188 | 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, | ||
| 189 | 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, | ||
| 190 | 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; | ||
| 191 | |||
| 192 | oled_write_P(qmk_logo, false); | ||
| 193 | } | ||
| 194 | |||
| 195 | void oled_white_space(void){ | ||
| 196 | oled_write_P(PSTR(" "), false); | ||
| 197 | } | ||
| 198 | |||
| 199 | static void render_status(void) { | ||
| 200 | oled_write_P(PSTR("\nLayer: "), false); | ||
| 201 | oled_write_P(PSTR("LOW"), (layer_state_is(_LOWER) & !layer_state_is(_ADJUST))); | ||
| 202 | oled_white_space(); | ||
| 203 | oled_write_P(PSTR("RAI"), (layer_state_is(_RAISE) & !layer_state_is(_ADJUST))); | ||
| 204 | oled_white_space(); | ||
| 205 | oled_write_P(PSTR("ADJ"), layer_state_is(_ADJUST)); | ||
| 206 | } | ||
| 207 | |||
| 208 | void render_default_layer_state(void) { | ||
| 209 | oled_write_P(PSTR("\nLayout: "), false); | ||
| 210 | switch (biton32(default_layer_state)) { | ||
| 211 | case _COLEMAK: | ||
| 212 | oled_write_P(PSTR("Colemak"), false); | ||
| 213 | break; | ||
| 214 | case _DVORAK: | ||
| 215 | oled_write_P(PSTR("Dvorak"), false); | ||
| 216 | break; | ||
| 217 | case _QWERTY: | ||
| 218 | oled_write_P(PSTR("Qwerty"), false); | ||
| 219 | break; | ||
| 220 | default: | ||
| 221 | oled_write_ln_P(PSTR("Undefined"), false); | ||
| 222 | } | ||
| 223 | } | ||
| 224 | |||
| 225 | void render_mod_status(uint8_t modifiers) { | ||
| 226 | oled_write_P(PSTR("\nMods: "), false); | ||
| 227 | oled_write_P(PSTR("SHF"), (modifiers & MOD_MASK_SHIFT)); | ||
| 228 | oled_white_space(); | ||
| 229 | oled_write_P(PSTR("CTL"), (modifiers & MOD_MASK_CTRL)); | ||
| 230 | oled_white_space(); | ||
| 231 | oled_write_P(PSTR("ALT"), (modifiers & MOD_MASK_ALT)); | ||
| 232 | oled_white_space(); | ||
| 233 | oled_write_P(PSTR("GUI"), (modifiers & MOD_MASK_GUI)); | ||
| 234 | } | ||
| 235 | |||
| 236 | void oled_task_user(void) { | ||
| 237 | if (is_keyboard_master()) { | ||
| 238 | render_qmk_logo(); | ||
| 239 | render_default_layer_state(); | ||
| 240 | render_status(); | ||
| 241 | render_mod_status(get_mods()|get_oneshot_mods()); | ||
| 242 | } else { | ||
| 243 | render_logo(); | ||
| 244 | oled_scroll_left(); | ||
| 245 | } | ||
| 246 | } | ||
| 247 | #endif | ||
| 248 | |||
| 249 | #ifdef ENCODER_ENABLE | ||
| 250 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 251 | if (index == 0) { | ||
| 252 | switch (biton32(layer_state)) { | ||
| 253 | case _LOWER: | ||
| 254 | if (clockwise) { | ||
| 255 | tap_code16(SGUI(KC_TAB)); | ||
| 256 | } else { | ||
| 257 | tap_code16(LGUI(KC_TAB)); | ||
| 258 | } | ||
| 259 | break; | ||
| 260 | case _RAISE: | ||
| 261 | if (clockwise) { | ||
| 262 | tap_code(KC_PGUP); | ||
| 263 | } else { | ||
| 264 | tap_code(KC_PGDN); | ||
| 265 | } | ||
| 266 | break; | ||
| 267 | case _ADJUST: | ||
| 268 | if (clockwise) { | ||
| 269 | rgblight_increase_hue(); | ||
| 270 | } else { | ||
| 271 | rgblight_decrease_hue(); | ||
| 272 | } | ||
| 273 | break; | ||
| 274 | default: | ||
| 275 | if (clockwise) { | ||
| 276 | tap_code(KC_BRIU); | ||
| 277 | } else { | ||
| 278 | tap_code(KC_BRID); | ||
| 279 | } | ||
| 280 | break; | ||
| 281 | } | ||
| 282 | } else if (index == 1) { | ||
| 283 | switch (biton32(layer_state)) { | ||
| 284 | case _LOWER: | ||
| 285 | if (!clockwise) { | ||
| 286 | tap_code(KC_UP); | ||
| 287 | } else { | ||
| 288 | tap_code(KC_DOWN); | ||
| 289 | } | ||
| 290 | break; | ||
| 291 | case _RAISE: | ||
| 292 | if (!clockwise) { | ||
| 293 | tap_code16(LCTL(KC_TAB)); | ||
| 294 | } else { | ||
| 295 | tap_code16(LCTL(LSFT(KC_TAB))); | ||
| 296 | } | ||
| 297 | break; | ||
| 298 | case _ADJUST: | ||
| 299 | if (!clockwise) { | ||
| 300 | rgblight_increase_val(); | ||
| 301 | } else { | ||
| 302 | rgblight_decrease_val(); | ||
| 303 | } | ||
| 304 | break; | ||
| 305 | default: | ||
| 306 | if (!clockwise) { | ||
| 307 | tap_code(KC_VOLU); | ||
| 308 | } else { | ||
| 309 | tap_code(KC_VOLD); | ||
| 310 | } | ||
| 311 | break; | ||
| 312 | } | ||
| 313 | } | ||
| 314 | } | ||
| 315 | #endif \ No newline at end of file | ||
diff --git a/keyboards/kyria/keymaps/ninjonas/rules.mk b/keyboards/kyria/keymaps/ninjonas/rules.mk new file mode 100644 index 000000000..13bc4cf97 --- /dev/null +++ b/keyboards/kyria/keymaps/ninjonas/rules.mk | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays | ||
| 2 | ENCODER_ENABLE = yes # Enables the use of one or more encoders | ||
| 3 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | ||
| 4 | LINK_TIME_OPTIMIZATION_ENABLE = yes \ No newline at end of file | ||
