aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/community/ergodox/drashna/config.h1
-rw-r--r--layouts/community/ergodox/drashna/keymap.c63
-rw-r--r--layouts/community/ergodox/drashna/visualizer.c77
-rw-r--r--layouts/community/ortho_4x12/drashna/config.h2
-rw-r--r--layouts/community/ortho_4x12/drashna/keymap.c56
-rw-r--r--layouts/community/split_3x6_3/drashna/config.h36
-rw-r--r--layouts/community/split_3x6_3/drashna/halconf.h22
-rw-r--r--layouts/community/split_3x6_3/drashna/keymap.c81
-rw-r--r--layouts/community/split_3x6_3/drashna/mcuconf.h32
-rw-r--r--layouts/community/split_3x6_3/drashna/rules.mk10
-rw-r--r--layouts/community/split_3x6_3/drashna/ssd1306.c0
11 files changed, 257 insertions, 123 deletions
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h
index a595a93c4..4ccba8f04 100644
--- a/layouts/community/ergodox/drashna/config.h
+++ b/layouts/community/ergodox/drashna/config.h
@@ -42,7 +42,6 @@
42# undef RGB_MATRIX_LED_FLUSH_LIMIT 42# undef RGB_MATRIX_LED_FLUSH_LIMIT
43# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) 43# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
44# define RGBLIGHT_LIMIT_VAL 100 44# define RGBLIGHT_LIMIT_VAL 100
45# undef RGBLIGHT_SLEEP
46# endif 45# endif
47#endif 46#endif
48 47
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c
index 5f1c0c8a0..fb5bcc6bd 100644
--- a/layouts/community/ergodox/drashna/keymap.c
+++ b/layouts/community/ergodox/drashna/keymap.c
@@ -446,70 +446,65 @@ void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); }
446 446
447void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } 447void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); }
448 448
449void rgb_matrix_indicators_user(void) { 449void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
450 if (g_suspend_state || !rgb_matrix_config.enable) return;
451 450
452 if (layer_state_is(_GAMEPAD)) { 451 if (layer_state_is(_GAMEPAD)) {
453 rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q 452 RGB_MATRIX_INDICATOR_SET_COLOR(32, 0x00, 0xFF, 0x00); // Q
454 rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W 453 RGB_MATRIX_INDICATOR_SET_COLOR(31, 0x00, 0xFF, 0xFF); // W
455 rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E 454 RGB_MATRIX_INDICATOR_SET_COLOR(30, 0xFF, 0x00, 0x00); // E
456 rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R 455 RGB_MATRIX_INDICATOR_SET_COLOR(29, 0xFF, 0x80, 0x00); // R
457 rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A 456 RGB_MATRIX_INDICATOR_SET_COLOR(37, 0x00, 0xFF, 0xFF); // A
458 rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S 457 RGB_MATRIX_INDICATOR_SET_COLOR(36, 0x00, 0xFF, 0xFF); // S
459 rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D 458 RGB_MATRIX_INDICATOR_SET_COLOR(35, 0x00, 0xFF, 0xFF); // D
460 rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F 459 RGB_MATRIX_INDICATOR_SET_COLOR(34, 0x7A, 0x00, 0xFF); // F
461 460
462 rgb_matrix_set_color(userspace_config.swapped_numbers ? 27 : 26, 0xFF, 0xFF, 0xFF); // 1 461 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 26 : 27), 0xFF, 0xFF, 0xFF); // 1
463 rgb_matrix_set_color(userspace_config.swapped_numbers ? 26 : 27, 0x00, 0xFF, 0x00); // 2 462 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 27 : 26), 0x00, 0xFF, 0x00); // 2
464 rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 463 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0x7A, 0x00, 0xFF); // 3
465 } 464 }
466 465
467# if defined(RGBLIGHT_ENABLE) 466
468 if (!userspace_config.rgb_layer_change) 467 if (userspace_config.rgb_layer_change) {
469# else
470 if (userspace_config.rgb_layer_change)
471# endif
472 {
473 bool mods_enabled = IS_LAYER_ON(_MODS); 468 bool mods_enabled = IS_LAYER_ON(_MODS);
474 switch (get_highest_layer(layer_state|default_layer_state)) { 469 switch (get_highest_layer(layer_state|default_layer_state)) {
475 case _GAMEPAD: 470 case _GAMEPAD:
476 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 471 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
477 break; 472 break;
478 case _DIABLO: 473 case _DIABLO:
479 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER); 474 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max);
480 break; 475 break;
481 case _RAISE: 476 case _RAISE:
482 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 477 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
483 break; 478 break;
484 case _LOWER: 479 case _LOWER:
485 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 480 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
486 break; 481 break;
487 case _ADJUST: 482 case _ADJUST:
488 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 483 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
489 break; 484 break;
490 case _QWERTY: 485 case _QWERTY:
491 rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 486 rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
492 break; 487 break;
493 case _COLEMAK: 488 case _COLEMAK:
494 rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 489 rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
495 break; 490 break;
496 case _DVORAK: 491 case _DVORAK:
497 rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 492 rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
498 break; 493 break;
499 case _WORKMAN: 494 case _WORKMAN:
500 rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 495 rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
501 break; 496 break;
502 case _NORMAN: 497 case _NORMAN:
503 rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 498 rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
504 break; 499 break;
505 case _MALTRON: 500 case _MALTRON:
506 rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 501 rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
507 break; 502 break;
508 case _EUCALYN: 503 case _EUCALYN:
509 rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 504 rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
510 break; 505 break;
511 case _CARPLAX: 506 case _CARPLAX:
512 rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 507 rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
513 break; 508 break;
514 } 509 }
515 } 510 }
@@ -517,6 +512,7 @@ void rgb_matrix_indicators_user(void) {
517 512
518#endif // RGB_MATRIX_INIT 513#endif // RGB_MATRIX_INIT
519 514
515#ifdef TAPPING_TERM_PER_KEY
520uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { 516uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
521 if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { 517 if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) {
522 if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { 518 if (mod_config(keycode & 0xf) & MOD_MASK_ALT) {
@@ -525,3 +521,4 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
525 } 521 }
526 return TAPPING_TERM; 522 return TAPPING_TERM;
527} 523}
524#endif
diff --git a/layouts/community/ergodox/drashna/visualizer.c b/layouts/community/ergodox/drashna/visualizer.c
new file mode 100644
index 000000000..6b1c3ff49
--- /dev/null
+++ b/layouts/community/ergodox/drashna/visualizer.c
@@ -0,0 +1,77 @@
1/*
2Copyright 2017 Fred Sundvik
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#include "./simple_visualizer.h"
19#include "util.h"
20#include "drashna.h"
21#include "rgblight_list.h"
22
23#define LCD_COLOR_wrapper(...) LCD_COLOR(__VA_ARGS__)
24// This function should be implemented by the keymap visualizer
25// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
26// that the simple_visualizer assumes that you are updating
27// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
28// stopped. This can be done by either double buffering it or by using constant strings
29static void get_visualizer_layer_and_color(visualizer_state_t* state) {
30
31 switch(get_highest_layer(state->status.layer|default_layer_state)) {
32 case _LOWER:
33 state->layer_text = "Lower";
34 state->target_lcd_color = LCD_COLOR_wrapper(HSV_GREEN);
35 break;
36 case _RAISE:
37 state->layer_text = "Raise";
38 state->target_lcd_color = LCD_COLOR_wrapper(HSV_YELLOW);
39 break;
40 case _ADJUST:
41 state->layer_text = "Adjust";
42 state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED);
43 break;
44 case _MACROS:
45 state->layer_text = "Macros";
46 state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE);
47 break;
48 case _MEDIA:
49 state->layer_text = "Media";
50 state->target_lcd_color = LCD_COLOR_wrapper(HSV_CHARTREUSE);
51 break;
52 case _GAMEPAD:
53 state->layer_text = "Game";
54 state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE);
55 break;
56 case _QWERTY:
57 state->layer_text = "QWERTY";
58 state->target_lcd_color = LCD_COLOR_wrapper(HSV_CYAN);
59 break;
60 case _WORKMAN:
61 state->layer_text = "Workman";
62 state->target_lcd_color = LCD_COLOR_wrapper(HSV_GOLDENROD);
63 break;
64 case _DVORAK:
65 state->layer_text = "Dvorak";
66 state->target_lcd_color = LCD_COLOR_wrapper(HSV_SPRINGGREEN);
67 break;
68 case _COLEMAK:
69 state->layer_text = "Colemak";
70 state->target_lcd_color = LCD_COLOR_wrapper(HSV_MAGENTA);
71 break; break;
72 default:
73 state->layer_text = "NONE";
74 state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED);
75 break;
76 }
77}
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h
index 6a99fcda0..4a1d1babe 100644
--- a/layouts/community/ortho_4x12/drashna/config.h
+++ b/layouts/community/ortho_4x12/drashna/config.h
@@ -77,6 +77,8 @@
77# define PRODUCT Drashna Hacked Planck EZ 77# define PRODUCT Drashna Hacked Planck EZ
78# endif 78# endif
79#endif 79#endif
80#undef NO_USB_STARTUP_CHECK
81
80 82
81#define EEPROM_I2C_RM24C512C 83#define EEPROM_I2C_RM24C512C
82 84
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c
index 8070a7d35..d0df7f5c3 100644
--- a/layouts/community/ortho_4x12/drashna/keymap.c
+++ b/layouts/community/ortho_4x12/drashna/keymap.c
@@ -16,9 +16,6 @@
16 16
17#include "drashna.h" 17#include "drashna.h"
18 18
19#ifdef RGBLIGHT_ENABLE
20extern rgblight_config_t rgblight_config;
21#endif
22 19
23#ifdef BACKLIGHT_ENABLE 20#ifdef BACKLIGHT_ENABLE
24enum planck_keycodes { 21enum planck_keycodes {
@@ -231,7 +228,8 @@ void suspend_wakeup_init_keymap(void) {
231} 228}
232// clang-format on 229// clang-format on
233 230
234void rgb_matrix_indicators_user(void) { 231
232void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
235 uint8_t this_mod = get_mods(); 233 uint8_t this_mod = get_mods();
236 uint8_t this_led = host_keyboard_leds(); 234 uint8_t this_led = host_keyboard_leds();
237 uint8_t this_osm = get_oneshot_mods(); 235 uint8_t this_osm = get_oneshot_mods();
@@ -240,8 +238,6 @@ void rgb_matrix_indicators_user(void) {
240 is_ez = true; 238 is_ez = true;
241# endif 239# endif
242 240
243 if (g_suspend_state || !rgb_matrix_config.enable) return;
244
245# if defined(RGBLIGHT_ENABLE) 241# if defined(RGBLIGHT_ENABLE)
246 if (!userspace_config.rgb_layer_change) 242 if (!userspace_config.rgb_layer_change)
247# else 243# else
@@ -250,46 +246,46 @@ void rgb_matrix_indicators_user(void) {
250 { 246 {
251 switch (get_highest_layer(layer_state)) { 247 switch (get_highest_layer(layer_state)) {
252 case _GAMEPAD: 248 case _GAMEPAD:
253 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 249 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
254 break; 250 break;
255 case _DIABLO: 251 case _DIABLO:
256 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER); 252 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max);
257 break; 253 break;
258 case _RAISE: 254 case _RAISE:
259 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 255 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
260 break; 256 break;
261 case _LOWER: 257 case _LOWER:
262 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 258 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
263 break; 259 break;
264 case _ADJUST: 260 case _ADJUST:
265 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 261 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
266 break; 262 break;
267 default: { 263 default: {
268 bool mods_enabled = IS_LAYER_ON(_MODS); 264 bool mods_enabled = IS_LAYER_ON(_MODS);
269 switch (get_highest_layer(default_layer_state)) { 265 switch (get_highest_layer(default_layer_state)) {
270 case _QWERTY: 266 case _QWERTY:
271 rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 267 rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
272 break; 268 break;
273 case _COLEMAK: 269 case _COLEMAK:
274 rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 270 rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
275 break; 271 break;
276 case _DVORAK: 272 case _DVORAK:
277 rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 273 rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
278 break; 274 break;
279 case _WORKMAN: 275 case _WORKMAN:
280 rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 276 rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
281 break; 277 break;
282 case _NORMAN: 278 case _NORMAN:
283 rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 279 rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
284 break; 280 break;
285 case _MALTRON: 281 case _MALTRON:
286 rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 282 rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
287 break; 283 break;
288 case _EUCALYN: 284 case _EUCALYN:
289 rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 285 rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
290 break; 286 break;
291 case _CARPLAX: 287 case _CARPLAX:
292 rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 288 rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
293 break; 289 break;
294 } 290 }
295 break; 291 break;
@@ -299,35 +295,35 @@ void rgb_matrix_indicators_user(void) {
299 295
300 switch (get_highest_layer(default_layer_state)) { 296 switch (get_highest_layer(default_layer_state)) {
301 case _QWERTY: 297 case _QWERTY:
302 rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); 298 RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0x00, 0xFF, 0xFF);
303 break; 299 break;
304 case _COLEMAK: 300 case _COLEMAK:
305 rgb_matrix_set_color(is_ez ? 41 : 42, 0xFF, 0x00, 0xFF); 301 RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0xFF, 0x00, 0xFF);
306 break; 302 break;
307 case _DVORAK: 303 case _DVORAK:
308 rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0x00); 304 RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0x00, 0xFF, 0x00);
309 break; 305 break;
310 case _WORKMAN: 306 case _WORKMAN:
311 rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21); 307 RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0xD9, 0xA5, 0x21);
312 break; 308 break;
313 } 309 }
314 310
315 if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { 311 if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) {
316 if (!layer_state_cmp(layer_state, _ADJUST)) { 312 if (!layer_state_cmp(layer_state, _ADJUST)) {
317 rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); 313 RGB_MATRIX_INDICATOR_SET_COLOR(24, 0x00, 0xFF, 0x00);
318 } 314 }
319 rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); 315 RGB_MATRIX_INDICATOR_SET_COLOR(36, 0x00, 0xFF, 0x00);
320 } 316 }
321 if ((this_mod | this_osm) & MOD_MASK_CTRL) { 317 if ((this_mod | this_osm) & MOD_MASK_CTRL) {
322 rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); 318 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0xFF, 0x00, 0x00);
323 rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); 319 RGB_MATRIX_INDICATOR_SET_COLOR(34, 0xFF, 0x00, 0x00);
324 rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); 320 RGB_MATRIX_INDICATOR_SET_COLOR(37, 0xFF, 0x00, 0x00);
325 } 321 }
326 if ((this_mod | this_osm) & MOD_MASK_GUI) { 322 if ((this_mod | this_osm) & MOD_MASK_GUI) {
327 rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); 323 RGB_MATRIX_INDICATOR_SET_COLOR(39, 0xFF, 0xD9, 0x00);
328 } 324 }
329 if ((this_mod | this_osm) & MOD_MASK_ALT) { 325 if ((this_mod | this_osm) & MOD_MASK_ALT) {
330 rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); 326 RGB_MATRIX_INDICATOR_SET_COLOR(38, 0x00, 0x00, 0xFF);
331 } 327 }
332} 328}
333 329
diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h
index 7db51fb6e..b9b1d073d 100644
--- a/layouts/community/split_3x6_3/drashna/config.h
+++ b/layouts/community/split_3x6_3/drashna/config.h
@@ -19,14 +19,11 @@
19/* Select hand configuration */ 19/* Select hand configuration */
20 20
21// #define MASTER_LEFT 21// #define MASTER_LEFT
22// #define MASTER_RIGHT 22#define MASTER_RIGHT
23#define EE_HANDS 23// #define EE_HAND
24
25#undef USE_I2C 24#undef USE_I2C
26#undef SSD1306OLED 25#undef SSD1306OLED
27 26
28#define USE_SERIAL_PD2
29
30// #define TAPPING_FORCE_HOLD 27// #define TAPPING_FORCE_HOLD
31// #define TAPPING_TERM 100 28// #define TAPPING_TERM 100
32 29
@@ -41,6 +38,10 @@
41#endif 38#endif
42 39
43#ifdef RGB_MATRIX_ENABLE 40#ifdef RGB_MATRIX_ENABLE
41# ifdef CONVERT_TO_PROTON_C
42# undef RGB_DI_PIN
43# define RGB_DI_PIN PAL_LINE(GPIOA, 3)
44# endif
44# define RGB_MATRIX_KEYPRESSES // reacts to keypresses 45# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
45// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) 46// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
46// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects 47// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
@@ -54,6 +55,24 @@
54# define RGB_MATRIX_SPD_STEP 10 55# define RGB_MATRIX_SPD_STEP 10
55#endif 56#endif
56 57
58#ifdef CONVERT_TO_PROTON_C
59# define WS2812_PWM_DRIVER PWMD15 // default: PWMD2
60# define WS2812_PWM_CHANNEL 2 // default: 2
61# define WS2812_PWM_PAL_MODE 9 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
62# define WS2812_DMA_STREAM STM32_DMA1_STREAM5 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
63# define WS2812_DMA_CHANNEL 5 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
64# define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM15_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU.
65
66# undef SOFT_SERIAL_PIN
67# define SOFT_SERIAL_PIN D3
68# define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
69# define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
70
71
72// #define INIT_EE_HANDS_LEFT
73// #define INIT_EE_HANDS_RIGHT
74#endif
75
57#ifdef AUDIO_ENABLE 76#ifdef AUDIO_ENABLE
58# define B6_AUDIO 77# define B6_AUDIO
59# define NO_MUSIC_MODE 78# define NO_MUSIC_MODE
@@ -64,8 +83,11 @@
64#endif 83#endif
65 84
66#undef PRODUCT 85#undef PRODUCT
67#define PRODUCT Drashna Hacked Corne Keyboard 86#ifdef CONVERT_TO_PROTON_C
68 87# define PRODUCT Drashna Hacked ARM Corne Keyboard
88#else
89# define PRODUCT Drashna Hacked Corne Keyboard
90#endif
69#define OLED_FONT_H "layouts/community/split_3x6_3/drashna/glcdfont.c" 91#define OLED_FONT_H "layouts/community/split_3x6_3/drashna/glcdfont.c"
70// #define OLED_FONT_WIDTH 5 92// #define OLED_FONT_WIDTH 5
71// #define OLED_FONT_HEIGHT 7 93// #define OLED_FONT_HEIGHT 7
diff --git a/layouts/community/split_3x6_3/drashna/halconf.h b/layouts/community/split_3x6_3/drashna/halconf.h
new file mode 100644
index 000000000..b099320b3
--- /dev/null
+++ b/layouts/community/split_3x6_3/drashna/halconf.h
@@ -0,0 +1,22 @@
1/* Copyright 2020 Nick Brassel (tzarc)
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 3 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 <https://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18// #define HAL_USE_DAC TRUE
19#define HAL_USE_PWM TRUE
20#define HAL_USE_SERIAL TRUE
21
22#include_next <halconf.h>
diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c
index e53d05397..513cc7f7d 100644
--- a/layouts/community/split_3x6_3/drashna/keymap.c
+++ b/layouts/community/split_3x6_3/drashna/keymap.c
@@ -16,11 +16,6 @@
16 16
17#include "drashna.h" 17#include "drashna.h"
18 18
19#ifdef RGBLIGHT_ENABLE
20// Following line allows macro to read current RGB settings
21extern rgblight_config_t rgblight_config;
22#endif
23
24enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; 19enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
25 20
26/* 21/*
@@ -31,6 +26,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
31 * of use. K## is a placeholder to pass through the individual keycodes 26 * of use. K## is a placeholder to pass through the individual keycodes
32 */ 27 */
33 28
29// clang-format off
34#define LAYOUT_split_3x6_3_base( \ 30#define LAYOUT_split_3x6_3_base( \
35 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ 31 K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
36 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ 32 K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
@@ -40,7 +36,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE };
40 KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ 36 KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
41 ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ 37 ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \
42 OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ 38 OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
43 KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ 39 RGB_MOD, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \
44 ) 40 )
45#define LAYOUT_split_3x6_3_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__) 41#define LAYOUT_split_3x6_3_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__)
46 42
@@ -123,31 +119,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
123}; 119};
124// clang-format on 120// clang-format on
125 121
126bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
127 if (record->event.pressed) {
128#ifndef SPLIT_KEYBOARD
129 if (keycode == RESET && !is_master) {
130 return false;
131 }
132#endif
133 }
134 return true;
135}
136
137#ifdef OLED_DRIVER_ENABLE 122#ifdef OLED_DRIVER_ENABLE
138oled_rotation_t oled_init_user(oled_rotation_t rotation) { 123oled_rotation_t oled_init_user(oled_rotation_t rotation) {
139# ifndef SPLIT_KEYBOARD 124 if (is_keyboard_master()) {
140 if (is_master) {
141# endif
142 return OLED_ROTATION_270; 125 return OLED_ROTATION_270;
143# ifndef SPLIT_KEYBOARD 126 } else {
144 } else {
145 return rotation; 127 return rotation;
146 } 128 }
147# endif
148} 129}
149#endif 130#endif
150 131
132#ifdef TAPPING_TERM_PER_KEY
151uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { 133uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
152 switch (keycode) { 134 switch (keycode) {
153 case ALT_T(KC_A): 135 case ALT_T(KC_A):
@@ -156,75 +138,74 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
156 return TAPPING_TERM; 138 return TAPPING_TERM;
157 } 139 }
158} 140}
141#endif
142
159 143
144void matrix_slave_scan_user(void) {
160#ifdef RGB_MATRIX_ENABLE 145#ifdef RGB_MATRIX_ENABLE
146 rgb_matrix_task();
147#endif
148}
161 149
150#ifdef RGB_MATRIX_ENABLE
162void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } 151void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); }
163 152
164void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } 153void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); }
165 154
166void check_default_layer(uint8_t mode, uint8_t type) { 155void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t led_max) {
167 switch (get_highest_layer(default_layer_state)) { 156 switch (get_highest_layer(default_layer_state)) {
168 case _QWERTY: 157 case _QWERTY:
169 rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type); 158 rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type, led_min, led_max);
170 break; 159 break;
171 case _COLEMAK: 160 case _COLEMAK:
172 rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type); 161 rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type, led_min, led_max);
173 break; 162 break;
174 case _DVORAK: 163 case _DVORAK:
175 rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type); 164 rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type, led_min, led_max);
176 break; 165 break;
177 case _WORKMAN: 166 case _WORKMAN:
178 rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type); 167 rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type, led_min, led_max);
179 break; 168 break;
180 case _NORMAN: 169 case _NORMAN:
181 rgb_matrix_layer_helper(HSV_CORAL, mode, rgb_matrix_config.speed, type); 170 rgb_matrix_layer_helper(HSV_CORAL, mode, rgb_matrix_config.speed, type, led_min, led_max);
182 break; 171 break;
183 case _MALTRON: 172 case _MALTRON:
184 rgb_matrix_layer_helper(HSV_YELLOW, mode, rgb_matrix_config.speed, type); 173 rgb_matrix_layer_helper(HSV_YELLOW, mode, rgb_matrix_config.speed, type, led_min, led_max);
185 break; 174 break;
186 case _EUCALYN: 175 case _EUCALYN:
187 rgb_matrix_layer_helper(HSV_PINK, mode, rgb_matrix_config.speed, type); 176 rgb_matrix_layer_helper(HSV_PINK, mode, rgb_matrix_config.speed, type, led_min, led_max);
188 break; 177 break;
189 case _CARPLAX: 178 case _CARPLAX:
190 rgb_matrix_layer_helper(HSV_BLUE, mode, rgb_matrix_config.speed, type); 179 rgb_matrix_layer_helper(HSV_BLUE, mode, rgb_matrix_config.speed, type, led_min, led_max);
191 break; 180 break;
192 } 181 }
193} 182}
194 183
195void rgb_matrix_indicators_user(void) { 184void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
196 if (userspace_config.rgb_layer_change && 185 if (!is_keyboard_master()) return;
197# ifdef RGB_DISABLE_WHEN_USB_SUSPENDED 186 if (userspace_config.rgb_layer_change) {
198 !g_suspend_state &&
199# endif
200# if defined(RGBLIGHT_ENABLE)
201 (!rgblight_config.enable && rgb_matrix_config.enable)
202# else
203 rgb_matrix_config.enable
204# endif
205 ) {
206 switch (get_highest_layer(layer_state)) { 187 switch (get_highest_layer(layer_state)) {
207 case _GAMEPAD: 188 case _GAMEPAD:
208 rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); 189 rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
209 break; 190 break;
210 case _DIABLO: 191 case _DIABLO:
211 rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); 192 rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
212 break; 193 break;
213 case _RAISE: 194 case _RAISE:
214 rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); 195 rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
215 break; 196 break;
216 case _LOWER: 197 case _LOWER:
217 rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); 198 rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
218 break; 199 break;
219 case _ADJUST: 200 case _ADJUST:
220 rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); 201 rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max);
221 break; 202 break;
222 default: { 203 default: {
223 check_default_layer(IS_LAYER_ON(_MODS), LED_FLAG_UNDERGLOW); 204 check_default_layer(IS_LAYER_ON(_MODS), LED_FLAG_UNDERGLOW, led_min, led_max);
224 break; 205 break;
225 } 206 }
226 } 207 }
227 check_default_layer(0, LED_FLAG_MODIFIER); 208 check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max);
228 } 209 }
229} 210}
230#endif 211#endif
diff --git a/layouts/community/split_3x6_3/drashna/mcuconf.h b/layouts/community/split_3x6_3/drashna/mcuconf.h
new file mode 100644
index 000000000..429e4e1cd
--- /dev/null
+++ b/layouts/community/split_3x6_3/drashna/mcuconf.h
@@ -0,0 +1,32 @@
1/* Copyright 2020 Nick Brassel (tzarc)
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 3 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 <https://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include_next <mcuconf.h>
19
20// #undef STM32_HSE_ENABLED
21// #define STM32_HSE_ENABLED FALSE
22#undef STM32_GPT_USE_TIM15
23#define STM32_GPT_USE_TIM15 FALSE
24
25#undef STM32_PWM_USE_TIM15
26#define STM32_PWM_USE_TIM15 TRUE
27
28#undef STM32_SERIAL_USE_USART1
29#define STM32_SERIAL_USE_USART1 TRUE
30
31#undef STM32_PWM_TIM15_IRQ_PRIORITY
32#define STM32_PWM_TIM15_IRQ_PRIORITY 16
diff --git a/layouts/community/split_3x6_3/drashna/rules.mk b/layouts/community/split_3x6_3/drashna/rules.mk
index 46f543f4e..5358cb0ac 100644
--- a/layouts/community/split_3x6_3/drashna/rules.mk
+++ b/layouts/community/split_3x6_3/drashna/rules.mk
@@ -3,7 +3,7 @@
3# change to "no" to disable the options, or define them in the Makefile in 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 4# the appropriate keymap folder that will get included automatically
5# 5#
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 6BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
7MOUSEKEY_ENABLE = no # Mouse keys(+4700) 7MOUSEKEY_ENABLE = no # Mouse keys(+4700)
8EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 8EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
9CONSOLE_ENABLE = no # Console for debug(+400) 9CONSOLE_ENABLE = no # Console for debug(+400)
@@ -20,9 +20,15 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22 22
23ifeq ($(strip $(KEYBOARD)), crkbd/rev1) 23ifeq ($(strip $(KEYBOARD)), crkbd/rev1/common)
24 OLED_DRIVER_ENABLE = yes 24 OLED_DRIVER_ENABLE = yes
25 RGB_MATRIX_ENABLE = yes 25 RGB_MATRIX_ENABLE = yes
26 HAPTIC_ENABLE = SOLENOID 26 HAPTIC_ENABLE = SOLENOID
27 BOOTLOADER = qmk-dfu 27 BOOTLOADER = qmk-dfu
28endif 28endif
29
30ifeq ($(strip $(CTPC)), yes)
31 HAPTIC_ENABLE = no
32 WS2812_DRIVER = pwm
33 SERIAL_DRIVER = usart
34endif
diff --git a/layouts/community/split_3x6_3/drashna/ssd1306.c b/layouts/community/split_3x6_3/drashna/ssd1306.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/layouts/community/split_3x6_3/drashna/ssd1306.c