diff options
-rw-r--r-- | keyboards/helix/pico/keymaps/mtei/config.h | 52 | ||||
-rw-r--r-- | keyboards/helix/pico/keymaps/mtei/keymap.c | 496 | ||||
-rw-r--r-- | keyboards/helix/pico/keymaps/mtei/rules.mk | 129 |
3 files changed, 677 insertions, 0 deletions
diff --git a/keyboards/helix/pico/keymaps/mtei/config.h b/keyboards/helix/pico/keymaps/mtei/config.h new file mode 100644 index 000000000..c5812de8d --- /dev/null +++ b/keyboards/helix/pico/keymaps/mtei/config.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | This is the c configuration file for the keymap | ||
3 | |||
4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
5 | Copyright 2015 Jack Humbert | ||
6 | |||
7 | This program is free software: you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation, either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #ifndef CONFIG_USER_H | ||
22 | #define CONFIG_USER_H | ||
23 | |||
24 | // place overrides here | ||
25 | |||
26 | #ifdef AUDIO_ENABLE | ||
27 | #define STARTUP_SONG SONG(STARTUP_SOUND) | ||
28 | #define AUDIO_CLICKY | ||
29 | #endif | ||
30 | |||
31 | #undef TAPPING_TERM | ||
32 | #define TAPPING_TERM 300 | ||
33 | #define PERMISSIVE_HOLD | ||
34 | /* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD. | ||
35 | see tmk_core/common/action_tapping.c */ | ||
36 | |||
37 | // If you need more program area, try select and reduce rgblight modes to use. | ||
38 | |||
39 | // Selection of RGBLIGHT MODE to use. | ||
40 | #if defined(LED_ANIMATIONS) | ||
41 | #define RGBLIGHT_EFFECT_BREATHING | ||
42 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
43 | #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
44 | //#define RGBLIGHT_EFFECT_SNAKE | ||
45 | //#define RGBLIGHT_EFFECT_KNIGHT | ||
46 | #define RGBLIGHT_EFFECT_CHRISTMAS | ||
47 | #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
48 | //#define RGBLIGHT_EFFECT_RGB_TEST | ||
49 | //#define RGBLIGHT_EFFECT_ALTERNATING | ||
50 | #endif | ||
51 | |||
52 | #endif /* CONFIG_USER_H */ | ||
diff --git a/keyboards/helix/pico/keymaps/mtei/keymap.c b/keyboards/helix/pico/keymaps/mtei/keymap.c new file mode 100644 index 000000000..27bf06243 --- /dev/null +++ b/keyboards/helix/pico/keymaps/mtei/keymap.c | |||
@@ -0,0 +1,496 @@ | |||
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 | #ifdef CONSOLE_ENABLE | ||
14 | #include <print.h> | ||
15 | #endif | ||
16 | |||
17 | extern keymap_config_t keymap_config; | ||
18 | |||
19 | #ifdef RGBLIGHT_ENABLE | ||
20 | //Following line allows macro to read current RGB settings | ||
21 | extern rgblight_config_t rgblight_config; | ||
22 | #endif | ||
23 | |||
24 | extern uint8_t is_master; | ||
25 | |||
26 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
27 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
28 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
29 | // entirely and just use numbers. | ||
30 | enum layer_number { | ||
31 | _QWERTY = 0, | ||
32 | _COLEMAK, | ||
33 | _DVORAK, | ||
34 | _EUCALYN, | ||
35 | _NUML, | ||
36 | _NUMR, | ||
37 | _LOWER, | ||
38 | _RAISE, | ||
39 | _ADJUST, | ||
40 | }; | ||
41 | |||
42 | enum custom_keycodes { | ||
43 | QWERTY = SAFE_RANGE, | ||
44 | COLEMAK, | ||
45 | DVORAK, | ||
46 | EUCALYN, | ||
47 | NUML, | ||
48 | NUMR, | ||
49 | KC_xEISU, | ||
50 | KC_xKANA, | ||
51 | KC_ZERO2, | ||
52 | RGBRST | ||
53 | }; | ||
54 | |||
55 | //Macros | ||
56 | #define KC_LOWER MO(_LOWER) | ||
57 | #define KC_NUML LT(_NUML,KC_SPC) | ||
58 | #define KC_NUMR LT(_NUMR,KC_SPC) | ||
59 | #define KC_RABS LT(_RAISE,KC_BSPC) | ||
60 | #define KC_RAEN LT(_RAISE,KC_ENT) | ||
61 | #define KC_____ _______ | ||
62 | #define KC_XXXX XXXXXXX | ||
63 | #define KC_ADJ MO(_ADJUST) | ||
64 | #define KC_LSMI LSFT(KC_MINS) | ||
65 | #define KC_LSEQ LSFT(KC_EQL) | ||
66 | #define KC_LSRB LSFT(KC_RBRC) | ||
67 | #define KC_LSLB LSFT(KC_LBRC) | ||
68 | #define KC_LSGR LSFT(KC_GRV) | ||
69 | #define KC_LSQT LSFT(KC_QUOT) | ||
70 | #define ___ _______ | ||
71 | #define KC_S0 LSFT(KC_0) | ||
72 | #define KC_S1 LSFT(KC_1) | ||
73 | #define KC_S2 LSFT(KC_2) | ||
74 | #define KC_S3 LSFT(KC_3) | ||
75 | #define KC_S4 LSFT(KC_4) | ||
76 | #define KC_S5 LSFT(KC_5) | ||
77 | #define KC_S6 LSFT(KC_6) | ||
78 | #define KC_S7 LSFT(KC_7) | ||
79 | #define KC_S8 LSFT(KC_8) | ||
80 | #define KC_S9 LSFT(KC_9) | ||
81 | |||
82 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
83 | |||
84 | /* Qwerty | ||
85 | * ,-----------------------------------------. ,-----------------------------------------. | ||
86 | * | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | | ||
87 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
88 | * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | Ctrl | | ||
89 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
90 | * | Shift| Z | X | C | V | B | | N | M | , | . | / | Shift| | ||
91 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
92 | * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | | ||
93 | * `-------------------------------------------------------------------------------------------------' | ||
94 | */ | ||
95 | [_QWERTY] = LAYOUT_kc( \ | ||
96 | ESC, Q, W, E, R, T, Y, U, I, O, P, BSLS, \ | ||
97 | LCTL, A, S, D, F, G, H, J, K, L, SCLN, RCTL, \ | ||
98 | LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, \ | ||
99 | LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ | ||
100 | ), | ||
101 | |||
102 | /* Colemak | ||
103 | * ,-----------------------------------------. ,-----------------------------------------. | ||
104 | * | ESC | Q | W | F | P | G | | J | L | U | Y | ; | \ | | ||
105 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
106 | * | Ctrl | A | R | S | T | D | | H | N | E | I | O | Ctrl | | ||
107 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
108 | * | Shift| Z | X | C | V | B | | K | M | , | . | / | Shift| | ||
109 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
110 | * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | | ||
111 | * `-------------------------------------------------------------------------------------------------' | ||
112 | */ | ||
113 | [_COLEMAK] = LAYOUT_kc( \ | ||
114 | ESC, Q, W, F, P, G, J, L, U, Y, SCLN, BSLS, \ | ||
115 | LCTL, A, R, S, T, D, H, N, E, I, O, RCTL, \ | ||
116 | LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, RSFT, \ | ||
117 | LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ | ||
118 | ), | ||
119 | |||
120 | /* Dvorak | ||
121 | * ,-----------------------------------------. ,-----------------------------------------. | ||
122 | * | ESC | ' | , | . | P | Y | | F | G | C | R | L | \ | | ||
123 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
124 | * | Ctrl | A | O | E | U | I | | D | H | T | N | S | Ctrl | | ||
125 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
126 | * | Shift| ; | Q | J | K | X | | B | M | W | V | Z | Shift| | ||
127 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
128 | * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | | ||
129 | * `-------------------------------------------------------------------------------------------------' | ||
130 | */ | ||
131 | [_DVORAK] = LAYOUT_kc( \ | ||
132 | ESC, QUOT, COMM, DOT, P, Y, F, G, C, R, L, BSLS, \ | ||
133 | LCTL, A, O, E, U, I, D, H, T, N, S, RCTL, \ | ||
134 | LSFT, SCLN, Q, J, K, X, B, M, W, V, Z, RSFT, \ | ||
135 | LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ | ||
136 | ), | ||
137 | |||
138 | /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) | ||
139 | * ,-----------------------------------------. ,-----------------------------------------. | ||
140 | * | ESC | Q | W | , | . | ; | | M | R | D | Y | P | \ | | ||
141 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
142 | * | Ctrl | A | O | E | I | U | | G | T | K | S | N | Ctrl | | ||
143 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
144 | * | Shift| Z | X | C | V | F | | B | H | J | L | / | Shift| | ||
145 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
146 | * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | | ||
147 | * `-------------------------------------------------------------------------------------------------' | ||
148 | */ | ||
149 | [_EUCALYN] = LAYOUT_kc( \ | ||
150 | ESC, Q, W, COMM, DOT, SCLN, M, R, D, Y, P, BSLS, \ | ||
151 | LCTL, A, O, E, I, U, G, T, K, S, N, RCTL, \ | ||
152 | LSFT, Z, X, C, V, F, B, H, J, L, SLSH, RSFT, \ | ||
153 | LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ | ||
154 | ), | ||
155 | |||
156 | /* Num | ||
157 | * ,-----------------------------------------. ,-----------------------------------------. | ||
158 | * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | | ||
159 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
160 | * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | | ||
161 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
162 | * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | | ||
163 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
164 | * | | | | | | | | | | | | | | | | ||
165 | * `-------------------------------------------------------------------------------------------------' | ||
166 | */ | ||
167 | [_NUML] = LAYOUT_kc( \ | ||
168 | ____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \ | ||
169 | ____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \ | ||
170 | ____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \ | ||
171 | ____, ____, ____, ____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____ \ | ||
172 | ), | ||
173 | |||
174 | [_NUMR] = LAYOUT_kc( \ | ||
175 | ____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \ | ||
176 | ____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \ | ||
177 | ____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \ | ||
178 | ____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____, ____, ____, ____ \ | ||
179 | ), | ||
180 | |||
181 | /* Lower | ||
182 | * ,-----------------------------------------. ,-----------------------------------------. | ||
183 | * | | |Pause | ScrLk| Ins | | | | Ins | ScrLk|Pause | | | | ||
184 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
185 | * | | PgUp | | Up |Delete| Home | | Home |Delete| Up | | PgUp | | | ||
186 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
187 | * | | PgDn | Left | Down | Right| End | | End | Left | Down | Right| PgDn | | | ||
188 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
189 | * | | | PrtSc| | | |Adjust|Adjust| | | | PrtSc| | | | ||
190 | * `-------------------------------------------------------------------------------------------------' | ||
191 | */ | ||
192 | [_LOWER] = LAYOUT_kc( \ | ||
193 | XXXX, XXXX, PAUS, SLCK, INS, XXXX, XXXX, INS, SLCK, PAUS, XXXX, ____, \ | ||
194 | ____, HOME, XXXX, UP, DEL, PGUP, PGUP, DEL, UP, XXXX, HOME, ____, \ | ||
195 | ____, END, LEFT, DOWN, RGHT, PGDN, PGDN, LEFT, DOWN, RGHT, END, ____, \ | ||
196 | ____, ____, PSCR, ____, ____, ____, ADJ, ADJ, ____, ____, ____, PSCR, ____, ____ \ | ||
197 | ), | ||
198 | |||
199 | /* Raise | ||
200 | * ,-----------------------------------------. ,-----------------------------------------. | ||
201 | * | TAB | | | | _ | - | | = | + | | | | | | ||
202 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
203 | * | EISU | | | | { | [ | | ] | } | | | | KANA | | ||
204 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
205 | * | | | | | ~ | ` | | ' | " | | | | | | ||
206 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
207 | * | | | | | | | | | | | | | | | | ||
208 | * `-------------------------------------------------------------------------------------------------' | ||
209 | */ | ||
210 | [_RAISE] = LAYOUT_kc( \ | ||
211 | TAB, XXXX, XXXX, XXXX, LSMI, MINS, EQL, LSEQ, XXXX, XXXX, XXXX, XXXX, \ | ||
212 | xEISU, XXXX, XXXX, XXXX, LSLB, LBRC, RBRC, LSRB, XXXX, XXXX, XXXX, xKANA, \ | ||
213 | XXXX, XXXX, XXXX, XXXX, LSGR, GRV, QUOT, LSQT, XXXX, XXXX, XXXX, XXXX, \ | ||
214 | ADJ, ADJ, XXXX, ____, ____, XXXX, ____, ____, XXXX, ____, ____, XXXX, ADJ, ADJ \ | ||
215 | ), | ||
216 | |||
217 | /* Adjust (Lower + Raise) | ||
218 | * ,-----------------------------------------. ,-----------------------------------------. | ||
219 | * | | Reset|RGBRST|RGB ON|Aud on| Win | | Win | |Qwerty|Euclyn|Colemk|Dvorak| | ||
220 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
221 | * | HUE+ | SAT+ | VAL+ |RGB md|Audoff| Mac | | Mac | | | | | | | ||
222 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
223 | * | HUE- | SAT- | VAL- | | | | | | | | | | | | ||
224 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | ||
225 | * | | | | | | | | | | | | | | | | ||
226 | * `-------------------------------------------------------------------------------------------------' | ||
227 | */ | ||
228 | [_ADJUST] = LAYOUT( \ | ||
229 | XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, XXXXXXX, QWERTY, EUCALYN, COLEMAK, DVORAK, \ | ||
230 | RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ | ||
231 | RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ | ||
232 | _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \ | ||
233 | ) | ||
234 | }; | ||
235 | |||
236 | #ifdef AUDIO_ENABLE | ||
237 | |||
238 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
239 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
240 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
241 | float tone_plover[][2] = SONG(PLOVER_SOUND); | ||
242 | float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); | ||
243 | float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); | ||
244 | #endif | ||
245 | |||
246 | static int current_default_layer; | ||
247 | |||
248 | uint32_t default_layer_state_set_kb(uint32_t state) { | ||
249 | // 1<<_QWERTY - 1 == 1 - 1 == _QWERTY (=0) | ||
250 | // 1<<_COLEMAK - 1 == 2 - 1 == _COLEMAK (=1) | ||
251 | current_default_layer = state - 1; | ||
252 | // 1<<_DVORAK - 2 == 4 - 2 == _DVORAK (=2) | ||
253 | if ( current_default_layer == 3 ) current_default_layer -= 1; | ||
254 | // 1<<_EUCALYN - 5 == 8 - 5 == _EUCALYN (=3) | ||
255 | if ( current_default_layer == 7 ) current_default_layer -= 4; | ||
256 | return state; | ||
257 | } | ||
258 | |||
259 | void update_base_layer(int base) | ||
260 | { | ||
261 | if( current_default_layer != base ) { | ||
262 | eeconfig_update_default_layer(1UL<<base); | ||
263 | default_layer_set(1UL<<base); | ||
264 | } | ||
265 | } | ||
266 | |||
267 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
268 | switch (keycode) { | ||
269 | case QWERTY: | ||
270 | if (record->event.pressed) { | ||
271 | #ifdef AUDIO_ENABLE | ||
272 | PLAY_SONG(tone_qwerty); | ||
273 | #endif | ||
274 | update_base_layer(_QWERTY); | ||
275 | } | ||
276 | return false; | ||
277 | break; | ||
278 | case COLEMAK: | ||
279 | if (record->event.pressed) { | ||
280 | #ifdef AUDIO_ENABLE | ||
281 | PLAY_SONG(tone_colemak); | ||
282 | #endif | ||
283 | update_base_layer(_COLEMAK); | ||
284 | } | ||
285 | return false; | ||
286 | break; | ||
287 | case DVORAK: | ||
288 | if (record->event.pressed) { | ||
289 | #ifdef AUDIO_ENABLE | ||
290 | PLAY_SONG(tone_dvorak); | ||
291 | #endif | ||
292 | update_base_layer(_DVORAK); | ||
293 | } | ||
294 | return false; | ||
295 | break; | ||
296 | case EUCALYN: | ||
297 | if (record->event.pressed) { | ||
298 | #ifdef AUDIO_ENABLE | ||
299 | PLAY_SONG(tone_dvorak); | ||
300 | #endif | ||
301 | update_base_layer(_EUCALYN); | ||
302 | } | ||
303 | return false; | ||
304 | break; | ||
305 | case KC_xEISU: | ||
306 | if (record->event.pressed) { | ||
307 | if(keymap_config.swap_lalt_lgui==false){ | ||
308 | register_code(KC_LANG2); | ||
309 | }else{ | ||
310 | SEND_STRING(SS_LALT("`")); | ||
311 | } | ||
312 | } else { | ||
313 | unregister_code(KC_LANG2); | ||
314 | } | ||
315 | return false; | ||
316 | break; | ||
317 | case KC_xKANA: | ||
318 | if (record->event.pressed) { | ||
319 | if(keymap_config.swap_lalt_lgui==false){ | ||
320 | register_code(KC_LANG1); | ||
321 | }else{ | ||
322 | SEND_STRING(SS_LALT("`")); | ||
323 | } | ||
324 | } else { | ||
325 | unregister_code(KC_LANG1); | ||
326 | } | ||
327 | return false; | ||
328 | break; | ||
329 | case RGBRST: | ||
330 | #ifdef RGBLIGHT_ENABLE | ||
331 | if (record->event.pressed) { | ||
332 | eeconfig_update_rgblight_default(); | ||
333 | rgblight_enable(); | ||
334 | } | ||
335 | #endif | ||
336 | break; | ||
337 | } | ||
338 | return true; | ||
339 | } | ||
340 | |||
341 | void matrix_init_user(void) { | ||
342 | #ifdef AUDIO_ENABLE | ||
343 | startup_user(); | ||
344 | #endif | ||
345 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | ||
346 | #ifdef SSD1306OLED | ||
347 | iota_gfx_init(!has_usb()); // turns on the display | ||
348 | #endif | ||
349 | } | ||
350 | |||
351 | |||
352 | #ifdef AUDIO_ENABLE | ||
353 | |||
354 | void startup_user() | ||
355 | { | ||
356 | _delay_ms(50); // gets rid of tick | ||
357 | } | ||
358 | |||
359 | void shutdown_user() | ||
360 | { | ||
361 | _delay_ms(150); | ||
362 | stop_all_notes(); | ||
363 | } | ||
364 | |||
365 | void music_on_user(void) | ||
366 | { | ||
367 | music_scale_user(); | ||
368 | } | ||
369 | |||
370 | void music_scale_user(void) | ||
371 | { | ||
372 | PLAY_SONG(music_scale); | ||
373 | } | ||
374 | |||
375 | #endif | ||
376 | |||
377 | |||
378 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
379 | #ifdef SSD1306OLED | ||
380 | |||
381 | void matrix_scan_user(void) { | ||
382 | iota_gfx_task(); // this is what updates the display continuously | ||
383 | } | ||
384 | |||
385 | void matrix_update(struct CharacterMatrix *dest, | ||
386 | const struct CharacterMatrix *source) { | ||
387 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
388 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
389 | dest->dirty = true; | ||
390 | } | ||
391 | } | ||
392 | |||
393 | static void render_logo(struct CharacterMatrix *matrix) { | ||
394 | |||
395 | static char logo[]={ | ||
396 | 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, | ||
397 | 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, | ||
398 | 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, | ||
399 | 0}; | ||
400 | matrix_write(matrix, logo); | ||
401 | #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_ANIMATIONS) | ||
402 | char buf[30]; | ||
403 | if(rgblight_config.enable) { | ||
404 | snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", | ||
405 | rgblight_config.mode, | ||
406 | rgblight_config.hue/RGBLIGHT_HUE_STEP, | ||
407 | rgblight_config.sat/RGBLIGHT_SAT_STEP, | ||
408 | rgblight_config.val/RGBLIGHT_VAL_STEP); | ||
409 | matrix_write(matrix, buf); | ||
410 | } | ||
411 | #endif | ||
412 | //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); | ||
413 | } | ||
414 | |||
415 | static const char Qwerty_name[] PROGMEM = " Qwerty"; | ||
416 | static const char Colemak_name[] PROGMEM = " Colemak"; | ||
417 | static const char Dvorak_name[] PROGMEM = " Dvorak"; | ||
418 | static const char Eucalyn_name[] PROGMEM = " Eucalyn"; | ||
419 | |||
420 | static const char NumL_name[] PROGMEM = ":NumL"; | ||
421 | static const char NumR_name[] PROGMEM = ":NumR"; | ||
422 | static const char Lower_name[] PROGMEM = ":Func"; | ||
423 | static const char Raise_name[] PROGMEM = ":Extra"; | ||
424 | static const char Adjust_name[] PROGMEM = ":Adjust"; | ||
425 | |||
426 | static const char *layer_names[] = { | ||
427 | [_QWERTY] = Qwerty_name, | ||
428 | [_COLEMAK] = Colemak_name, | ||
429 | [_DVORAK] = Dvorak_name, | ||
430 | [_EUCALYN] = Eucalyn_name, | ||
431 | |||
432 | [_NUML] = NumL_name, | ||
433 | [_NUMR] = NumR_name, | ||
434 | [_LOWER] = Lower_name, | ||
435 | [_RAISE] = Raise_name, | ||
436 | [_ADJUST] = Adjust_name | ||
437 | }; | ||
438 | |||
439 | void render_status(struct CharacterMatrix *matrix) { | ||
440 | |||
441 | // Render to mode icon | ||
442 | static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; | ||
443 | if(keymap_config.swap_lalt_lgui==false){ | ||
444 | matrix_write(matrix, logo[0][0]); | ||
445 | matrix_write_P(matrix, PSTR("\n")); | ||
446 | matrix_write(matrix, logo[0][1]); | ||
447 | }else{ | ||
448 | matrix_write(matrix, logo[1][0]); | ||
449 | matrix_write_P(matrix, PSTR("\n")); | ||
450 | matrix_write(matrix, logo[1][1]); | ||
451 | } | ||
452 | |||
453 | // 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 | ||
454 | int name_num; | ||
455 | uint32_t lstate; | ||
456 | matrix_write_P(matrix, layer_names[current_default_layer]); | ||
457 | matrix_write_P(matrix, PSTR("\n")); | ||
458 | for( lstate = layer_state, name_num = 0; | ||
459 | lstate && name_num < sizeof(layer_names)/sizeof(char *); | ||
460 | lstate >>=1, name_num++ ) { | ||
461 | if( (lstate & 1) != 0 ) { | ||
462 | if( layer_names[name_num] ) { | ||
463 | matrix_write_P(matrix, layer_names[name_num]); | ||
464 | } | ||
465 | } | ||
466 | } | ||
467 | |||
468 | // Host Keyboard LED Status | ||
469 | char led[40]; | ||
470 | snprintf(led, sizeof(led), "\n%s %s %s", | ||
471 | (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", | ||
472 | (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", | ||
473 | (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); | ||
474 | matrix_write(matrix, led); | ||
475 | } | ||
476 | |||
477 | |||
478 | void iota_gfx_task_user(void) { | ||
479 | struct CharacterMatrix matrix; | ||
480 | |||
481 | #if DEBUG_TO_SCREEN | ||
482 | if (debug_enable) { | ||
483 | return; | ||
484 | } | ||
485 | #endif | ||
486 | |||
487 | matrix_clear(&matrix); | ||
488 | if(is_master){ | ||
489 | render_status(&matrix); | ||
490 | }else{ | ||
491 | render_logo(&matrix); | ||
492 | } | ||
493 | matrix_update(&display, &matrix); | ||
494 | } | ||
495 | |||
496 | #endif | ||
diff --git a/keyboards/helix/pico/keymaps/mtei/rules.mk b/keyboards/helix/pico/keymaps/mtei/rules.mk new file mode 100644 index 000000000..c5ee8acb2 --- /dev/null +++ b/keyboards/helix/pico/keymaps/mtei/rules.mk | |||
@@ -0,0 +1,129 @@ | |||
1 | |||
2 | # Build Options | ||
3 | # change to "no" to disable the options, or define them in the Makefile in | ||
4 | # the appropriate keymap folder that will get included automatically | ||
5 | # | ||
6 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
7 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | ||
8 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
9 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
10 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
11 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
12 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
13 | MIDI_ENABLE = no # MIDI controls | ||
14 | AUDIO_ENABLE = yes # Audio output on port B5 | ||
15 | UNICODE_ENABLE = no # Unicode | ||
16 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
17 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. | ||
18 | SWAP_HANDS_ENABLE = no # Enable one-hand typing | ||
19 | |||
20 | define HELIX_CUSTOMISE_MSG | ||
21 | $(info Helix customize) | ||
22 | $(info - OLED_ENABLE=$(OLED_ENABLE)) | ||
23 | $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE)) | ||
24 | $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE)) | ||
25 | $(info - LED_ANIMATION=$(LED_ANIMATIONS)) | ||
26 | $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE)) | ||
27 | endef | ||
28 | |||
29 | # Helix keyboard customize | ||
30 | # you can edit follows 6 Variables | ||
31 | # jp: 以下の6つの変数を必要に応じて編集します。 | ||
32 | OLED_ENABLE = no # OLED_ENABLE | ||
33 | LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" | ||
34 | LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) | ||
35 | LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) | ||
36 | LED_ANIMATIONS = yes # LED animations | ||
37 | IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) | ||
38 | Link_Time_Optimization = no # if firmware size over limit, try this option | ||
39 | |||
40 | #### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. | ||
41 | #### Do not enable these with audio at the same time. | ||
42 | |||
43 | ### Helix keyboard 'default' keymap: convenient command line option | ||
44 | ## make HELIX=<options> helix:defualt | ||
45 | ## option= oled | back | under | na | ios | ||
46 | ## ex. | ||
47 | ## make HELIX=oled helix:defualt | ||
48 | ## make HELIX=oled,back helix:defualt | ||
49 | ## make HELIX=oled,under helix:defualt | ||
50 | ## make HELIX=oled,back,na helix:defualt | ||
51 | ## make HELIX=oled,back,ios helix:defualt | ||
52 | ## | ||
53 | ifneq ($(strip $(HELIX)),) | ||
54 | ifeq ($(findstring oled,$(HELIX)), oled) | ||
55 | OLED_ENABLE = yes | ||
56 | endif | ||
57 | ifeq ($(findstring back,$(HELIX)), back) | ||
58 | LED_BACK_ENABLE = yes | ||
59 | else ifeq ($(findstring under,$(HELIX)), under) | ||
60 | LED_UNDERGLOW_ENABLE = yes | ||
61 | endif | ||
62 | ifeq ($(findstring na,$(HELIX)), na) | ||
63 | LED_ANIMATIONS = no | ||
64 | endif | ||
65 | ifeq ($(findstring ios,$(HELIX)), ios) | ||
66 | IOS_DEVICE_ENABLE = yes | ||
67 | endif | ||
68 | $(eval $(call HELIX_CUSTOMISE_MSG)) | ||
69 | $(info ) | ||
70 | endif | ||
71 | |||
72 | # Uncomment these for checking | ||
73 | # jp: コンパイル時にカスタマイズの状態を表示したい時はコメントをはずします。 | ||
74 | # $(eval $(call HELIX_CUSTOMISE_MSG)) | ||
75 | # $(info ) | ||
76 | |||
77 | ifeq ($(strip $(LED_BACK_ENABLE)), yes) | ||
78 | RGBLIGHT_ENABLE = yes | ||
79 | OPT_DEFS += -DRGBLED_BACK | ||
80 | ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) | ||
81 | $(eval $(call HELIX_CUSTOMISE_MSG)) | ||
82 | $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') | ||
83 | endif | ||
84 | else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) | ||
85 | RGBLIGHT_ENABLE = yes | ||
86 | else | ||
87 | RGBLIGHT_ENABLE = no | ||
88 | endif | ||
89 | |||
90 | ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) | ||
91 | OPT_DEFS += -DIOS_DEVICE_ENABLE | ||
92 | endif | ||
93 | |||
94 | ifeq ($(strip $(LED_ANIMATIONS)), yes) | ||
95 | OPT_DEFS += -DLED_ANIMATIONS | ||
96 | endif | ||
97 | |||
98 | ifeq ($(strip $(OLED_ENABLE)), yes) | ||
99 | OPT_DEFS += -DOLED_ENABLE | ||
100 | endif | ||
101 | |||
102 | ifeq ($(strip $(LOCAL_GLCDFONT)), yes) | ||
103 | OPT_DEFS += -DLOCAL_GLCDFONT | ||
104 | endif | ||
105 | |||
106 | ifeq ($(strip $(AUDIO_ENABLE)),yes) | ||
107 | ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) | ||
108 | Link_Time_Optimization = yes | ||
109 | endif | ||
110 | ifeq ($(strip $(OLED_ENABLE)),yes) | ||
111 | Link_Time_Optimization = yes | ||
112 | endif | ||
113 | endif | ||
114 | |||
115 | ifeq ($(strip $(Link_Time_Optimization)),yes) | ||
116 | EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization | ||
117 | endif | ||
118 | |||
119 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
120 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
121 | |||
122 | ifndef QUANTUM_DIR | ||
123 | include ../../../../Makefile | ||
124 | endif | ||
125 | |||
126 | # Uncomment these for debugging | ||
127 | # $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) | ||
128 | # $(info -- OPT_DEFS=$(OPT_DEFS)) | ||
129 | # $(info ) | ||