aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-12-29 20:17:34 -0800
committerGitHub <noreply@github.com>2021-12-29 20:17:34 -0800
commitc4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf (patch)
tree67dc381a45d59626132c4c59b71c4b36fa971f8b /layouts
parent1a8a842cfb3e87a82afb57ba29ca59c5fa6fe97b (diff)
downloadqmk_firmware-c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf.tar.gz
qmk_firmware-c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf.zip
[Keymap] Reorganization, cleanup and readmes for drashna code (#15617)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/community/ergodox/drashna/config.h7
-rw-r--r--layouts/community/ergodox/drashna/keymap.c40
-rw-r--r--layouts/community/ortho_4x12/drashna/keymap.c55
-rw-r--r--layouts/community/ortho_4x12/drashna/rules.mk24
-rw-r--r--layouts/community/split_3x6_3/drashna/config.h4
-rw-r--r--layouts/community/split_3x6_3/drashna/keymap.c5
-rw-r--r--layouts/community/split_3x6_3/drashna/rules.mk35
7 files changed, 46 insertions, 124 deletions
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h
index f9daf277f..d669f2729 100644
--- a/layouts/community/ergodox/drashna/config.h
+++ b/layouts/community/ergodox/drashna/config.h
@@ -45,6 +45,7 @@
45# endif 45# endif
46#endif 46#endif
47 47
48#define PIMORONI_TRACKBALL_INVERT_X 48#ifdef TAPPING_TERM
49#define PIMORONI_TRACKBALL_INVERT_Y 49# undef TAPPING_TERM
50#define PIMORONI_TRACKBALL_CLICK 50#endif
51#define TAPPING_TERM 185
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c
index 3c9bcfeaa..798680628 100644
--- a/layouts/community/ergodox/drashna/keymap.c
+++ b/layouts/community/ergodox/drashna/keymap.c
@@ -317,7 +317,7 @@ void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); }
317 317
318void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } 318void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); }
319 319
320void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { 320bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
321 if (layer_state_is(_GAMEPAD)) { 321 if (layer_state_is(_GAMEPAD)) {
322 RGB_MATRIX_INDICATOR_SET_COLOR(32, 0x00, 0xFF, 0x00); // Q 322 RGB_MATRIX_INDICATOR_SET_COLOR(32, 0x00, 0xFF, 0x00); // Q
323 RGB_MATRIX_INDICATOR_SET_COLOR(31, 0x00, 0xFF, 0xFF); // W 323 RGB_MATRIX_INDICATOR_SET_COLOR(31, 0x00, 0xFF, 0xFF); // W
@@ -332,43 +332,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
332 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 27 : 26), 0x00, 0xFF, 0x00); // 2 332 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 27 : 26), 0x00, 0xFF, 0x00); // 2
333 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0x7A, 0x00, 0xFF); // 3 333 RGB_MATRIX_INDICATOR_SET_COLOR(25, 0x7A, 0x00, 0xFF); // 3
334 } 334 }
335 335 return true;
336# if defined(RGBLIGHT_ENABLE)
337 if (!userspace_config.rgb_layer_change)
338# else
339 if (userspace_config.rgb_layer_change)
340# endif
341 {
342 switch (get_highest_layer(layer_state | default_layer_state)) {
343 case _GAMEPAD:
344 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
345 break;
346 case _DIABLO:
347 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max);
348 break;
349 case _RAISE:
350 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
351 break;
352 case _LOWER:
353 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
354 break;
355 case _ADJUST:
356 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
357 break;
358 case _DEFAULT_LAYER_1:
359 rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
360 break;
361 case _DEFAULT_LAYER_2:
362 rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
363 break;
364 case _DEFAULT_LAYER_3:
365 rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
366 break;
367 case _DEFAULT_LAYER_4:
368 rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
369 break;
370 }
371 }
372} 336}
373 337
374#endif // RGB_MATRIX_INIT 338#endif // RGB_MATRIX_INIT
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c
index 3ba9cf64f..ce241fd76 100644
--- a/layouts/community/ortho_4x12/drashna/keymap.c
+++ b/layouts/community/ortho_4x12/drashna/keymap.c
@@ -201,17 +201,8 @@ led_config_t g_led_config = {
201// clange-format on 201// clange-format on
202# endif 202# endif
203 203
204// clang-format off
205void suspend_power_down_keymap(void) {
206 rgb_matrix_set_suspend_state(true);
207}
208 204
209void suspend_wakeup_init_keymap(void) { 205bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
210 rgb_matrix_set_suspend_state(false);
211}
212// clang-format on
213
214void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
215 uint8_t this_mod = get_mods(); 206 uint8_t this_mod = get_mods();
216 uint8_t this_led = host_keyboard_leds(); 207 uint8_t this_led = host_keyboard_leds();
217 uint8_t this_osm = get_oneshot_mods(); 208 uint8_t this_osm = get_oneshot_mods();
@@ -221,48 +212,6 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
221# define THUMB_LED 42 212# define THUMB_LED 42
222# endif 213# endif
223# define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__) 214# define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__)
224# if defined(RGBLIGHT_ENABLE)
225 if (!userspace_config.rgb_layer_change)
226# else
227 if (userspace_config.rgb_layer_change)
228# endif
229 {
230 switch (get_highest_layer(layer_state)) {
231 case _GAMEPAD:
232 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
233 break;
234 case _DIABLO:
235 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max);
236 break;
237 case _RAISE:
238 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
239 break;
240 case _LOWER:
241 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
242 break;
243 case _ADJUST:
244 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
245 break;
246 default:
247 {
248 switch (get_highest_layer(default_layer_state)) {
249 case _DEFAULT_LAYER_1:
250 rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
251 break;
252 case _DEFAULT_LAYER_2:
253 rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
254 break;
255 case _DEFAULT_LAYER_3:
256 rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
257 break;
258 case _DEFAULT_LAYER_4:
259 rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
260 break;
261 }
262 break;
263 }
264 }
265 }
266 215
267 switch (get_highest_layer(default_layer_state)) { 216 switch (get_highest_layer(default_layer_state)) {
268 case _DEFAULT_LAYER_1: 217 case _DEFAULT_LAYER_1:
@@ -296,6 +245,8 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
296 if ((this_mod | this_osm) & MOD_MASK_ALT) { 245 if ((this_mod | this_osm) & MOD_MASK_ALT) {
297 RGB_MATRIX_INDICATOR_SET_COLOR(38, 0x00, 0x00, 0xFF); 246 RGB_MATRIX_INDICATOR_SET_COLOR(38, 0x00, 0x00, 0xFF);
298 } 247 }
248
249 return true;
299} 250}
300 251
301void matrix_init_keymap(void) { 252void matrix_init_keymap(void) {
diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk
index d76624526..2905fb0fd 100644
--- a/layouts/community/ortho_4x12/drashna/rules.mk
+++ b/layouts/community/ortho_4x12/drashna/rules.mk
@@ -1,33 +1,35 @@
1BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite 1BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
2MOUSEKEY_ENABLE = no # Mouse keys(+4700) 2MOUSEKEY_ENABLE = no # Mouse keys
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 3EXTRAKEY_ENABLE = yes # Audio control and System control
4TAP_DANCE_ENABLE = no 4TAP_DANCE_ENABLE = no
5SPACE_CADET_ENABLE = no 5SPACE_CADET_ENABLE = no
6NKRO_ENABLE = yes 6NKRO_ENABLE = yes
7CAPS_WORD_ENABLE = no
7 8
8ifneq ($(strip $(KEYBOARD)), planck/rev6) 9ifneq ($(strip $(KEYBOARD)), planck/rev6)
9 CONSOLE_ENABLE = no 10 CONSOLE_ENABLE = no
10 COMMAND_ENABLE = no 11 COMMAND_ENABLE = no
11 ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) 12 ifeq ($(strip $(LAYOUT_HAS_RGB)), yes)
12 RGBLIGHT_ENABLE = yes 13 RGBLIGHT_ENABLE = yes
13 INDICATOR_LIGHTS = yes 14 INDICATOR_LIGHTS = yes
14 RGBLIGHT_STARTUP_ANIMATION = yes 15 RGBLIGHT_STARTUP_ANIMATION = yes
15 endif 16 endif
16else 17else
17 CONSOLE_ENABLE = yes 18 CONSOLE_ENABLE = yes
18 COMMAND_ENABLE = yes
19 RGBLIGHT_ENABLE = yes 19 RGBLIGHT_ENABLE = yes
20 RGBLIGHT_STARTUP_ANIMATION = yes 20 RGBLIGHT_STARTUP_ANIMATION = yes
21 RGB_MATRIX_ENABLE = no 21 RGB_MATRIX_ENABLE = no
22 AUDIO_ENABLE = yes 22 AUDIO_ENABLE = yes
23 EEPROM_DRIVER = i2c 23 EEPROM_DRIVER = i2c
24 ENCODER_MAP_ENABLE = yes 24 ENCODER_MAP_ENABLE = yes
25 AUTOCORRECTION_ENABLE = yes
26 CAPS_WORD_ENABLE = yes
25endif 27endif
26ifeq ($(strip $(KEYBOARD)), planck/light) 28ifeq ($(strip $(KEYBOARD)), planck/light)
27 RGB_MATRIX_ENABLE = yes 29 RGB_MATRIX_ENABLE = yes
28 RGBLIGHT_ENABLE = yes 30 RGBLIGHT_ENABLE = yes
29 RGBLIGHT_STARTUP_ANIMATION = yes 31 RGBLIGHT_STARTUP_ANIMATION = yes
30 AUDIO_ENABLE = yes 32 AUDIO_ENABLE = yes
31endif 33endif
32ifeq ($(strip $(KEYBOARD)), planck/ez) 34ifeq ($(strip $(KEYBOARD)), planck/ez)
33 RGBLIGHT_ENABLE = no 35 RGBLIGHT_ENABLE = no
@@ -39,4 +41,6 @@ ifeq ($(strip $(KEYBOARD)), planck/ez)
39 CONSOLE_ENABLE = yes 41 CONSOLE_ENABLE = yes
40 COMMAND_ENABLE = yes 42 COMMAND_ENABLE = yes
41 AUDIO_ENABLE = yes 43 AUDIO_ENABLE = yes
44 AUTOCORRECTION_ENABLE = yes
45 CAPS_WORD_ENABLE = yes
42endif 46endif
diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h
index b86448c67..cfcb873a8 100644
--- a/layouts/community/split_3x6_3/drashna/config.h
+++ b/layouts/community/split_3x6_3/drashna/config.h
@@ -93,3 +93,7 @@
93#endif 93#endif
94 94
95#define TAPPING_TERM_PER_KEY 95#define TAPPING_TERM_PER_KEY
96#ifdef TAPPING_TERM
97# undef TAPPING_TERM
98#endif
99#define TAPPING_TERM 200
diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c
index 7c31972e3..476ca5fce 100644
--- a/layouts/community/split_3x6_3/drashna/keymap.c
+++ b/layouts/community/split_3x6_3/drashna/keymap.c
@@ -90,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
90 KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, 90 KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
91 VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, 91 VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
92 KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, 92 KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL,
93 HPT_TOG, KC_NUKE, _______, _______, TG_MODS, HPT_FBK 93 AUTO_CTN,KC_NUKE, _______, _______, TG_MODS, HPT_FBK
94 ) 94 )
95}; 95};
96// clang-format on 96// clang-format on
@@ -265,7 +265,7 @@ void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t le
265 } 265 }
266} 266}
267 267
268void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { 268bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) {
269 if (userspace_config.rgb_layer_change) { 269 if (userspace_config.rgb_layer_change) {
270 switch (get_highest_layer(layer_state)) { 270 switch (get_highest_layer(layer_state)) {
271 case _GAMEPAD: 271 case _GAMEPAD:
@@ -291,5 +291,6 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
291 } 291 }
292 check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max); 292 check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max);
293 } 293 }
294 return false;
294} 295}
295#endif 296#endif
diff --git a/layouts/community/split_3x6_3/drashna/rules.mk b/layouts/community/split_3x6_3/drashna/rules.mk
index cf2dfbdc8..9164dcdeb 100644
--- a/layouts/community/split_3x6_3/drashna/rules.mk
+++ b/layouts/community/split_3x6_3/drashna/rules.mk
@@ -1,9 +1,8 @@
1
2# Build Options 1# Build Options
3# change to "no" to disable the options, or define them in the Makefile in 2# change to "no" to disable the options
4# the appropriate keymap folder that will get included automatically
5# 3#
6BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite 4
5BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
7MOUSEKEY_ENABLE = no # Mouse keys 6MOUSEKEY_ENABLE = no # Mouse keys
8EXTRAKEY_ENABLE = yes # Audio control and System control 7EXTRAKEY_ENABLE = yes # Audio control and System control
9CONSOLE_ENABLE = no # Console for debug 8CONSOLE_ENABLE = no # Console for debug
@@ -12,27 +11,25 @@ NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see her
12BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 11BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
13AUDIO_ENABLE = no # Audio output 12AUDIO_ENABLE = no # Audio output
14UNICODE_ENABLE = no # Unicode 13UNICODE_ENABLE = no # Unicode
15BLUETOOTH_ENABLE = no # Enable Bluetooth
16RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. 14RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
17SWAP_HANDS_ENABLE = no # Enable one-hand typing 15SWAP_HANDS_ENABLE = no # Enable one-hand typing
18 16
19# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
20SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
21
22ifeq ($(strip $(KEYBOARD)), crkbd/rev1) 17ifeq ($(strip $(KEYBOARD)), crkbd/rev1)
23 OLED_ENABLE = yes 18 OLED_ENABLE = yes
24 RGB_MATRIX_ENABLE = yes 19 RGB_MATRIX_ENABLE = yes
25 HAPTIC_ENABLE = no 20 HAPTIC_ENABLE = no
26endif 21endif
27 22
28ifeq ($(strip $(CTPC)), yes) 23ifeq ($(strip $(CTPC)), yes)
29 HAPTIC_ENABLE = no 24 HAPTIC_ENABLE = no
30 WS2812_DRIVER = pwm # won't work without a patch to the ctpc mk file 25 WS2812_DRIVER = pwm # won't work without a patch to the ctpc mk file
31 SERIAL_DRIVER = usart 26 SERIAL_DRIVER = usart
32 SWAP_HANDS_ENABLE = yes 27 SWAP_HANDS_ENABLE = yes
33 WPM_ENABLE = yes 28 WPM_ENABLE = yes
29 AUTOCORRECTION_ENABLE = yes
30 CAPS_WORD_ENABLE = yes
34else 31else
35 CUSTOM_UNICODE_ENABLE = no 32 CUSTOM_UNICODE_ENABLE = no
36 BOOTLOADER = qmk-hid 33 BOOTLOADER = qmk-hid
37 BOOTLOADER_SIZE = 512 34 BOOTLOADER_SIZE = 512
38endif 35endif