aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2019-06-05 18:14:35 -0500
committerDrashna Jaelre <drashna@live.com>2019-06-05 16:14:35 -0700
commitde968eb310b82dbba7c69971ad0d1280aaac7b27 (patch)
tree418b85336efb7f8d581875b7e57f1e985e3a28aa
parentb2f7915994eb514a0348fdb864ead04c54c509c7 (diff)
downloadqmk_firmware-de968eb310b82dbba7c69971ad0d1280aaac7b27.tar.gz
qmk_firmware-de968eb310b82dbba7c69971ad0d1280aaac7b27.zip
[Keymap] Xulkal changes (#6075)
-rw-r--r--keyboards/helix/rev2/keymaps/xulkal/keymap.c69
-rw-r--r--keyboards/helix/rev2/keymaps/xulkal/rules.mk11
-rw-r--r--keyboards/rgbkb/sol/keymaps/xulkal/keymap.c3
-rw-r--r--users/xulkal/custom_oled.c166
-rw-r--r--users/xulkal/custom_tap_dance.c3
-rw-r--r--users/xulkal/rules.mk1
6 files changed, 215 insertions, 38 deletions
diff --git a/keyboards/helix/rev2/keymaps/xulkal/keymap.c b/keyboards/helix/rev2/keymaps/xulkal/keymap.c
new file mode 100644
index 000000000..3fad64dea
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/xulkal/keymap.c
@@ -0,0 +1,69 @@
1#include QMK_KEYBOARD_H
2#include "xulkal.h"
3
4#ifdef PROTOCOL_LUFA
5#include "lufa.h"
6#include "split_util.h"
7#endif
8
9#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__)
10
11const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
12
13 /* Qwerty
14 * ,-----------------------------------------. ,-----------------------------------------.
15 * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BkSp |
16 * |------+------+------+------+------+------| |------+------+------+------+------+------|
17 * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ |
18 * |------+------+------+------+------+------| |------+------+------+------+------+------|
19 * |FN(CAPS)| A | S | D | F | G | | H | J | K | L | ; | Enter|
20 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
21 * | Sft[ | Z | X | C | V | B |RGBTOG|RGBRST| N | M | , | . | / | Sft] |
22 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
23 * | Ctl- | Win | LOWER| RAISE| Alt | Space|RGBRMOD|RGBMOD|Space| Left | Up | Down | Right| Ctl= |
24 * `-------------------------------------------------------------------------------------------------'
25 */
26 [_QWERTY] = EXPAND_LAYOUT( \
27 _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \
28 _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \
29 _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, \
30 _________________QWERTY_L4_________________, RGB_TOG, RGBRST, _________________QWERTY_R4_________________, \
31 _________________QWERTY_L5_________________, RGB_RMOD, RGB_MOD, _________________QWERTY_R5_________________ \
32 ),
33
34#ifndef GAMELAYER_DISABLE
35 [_GAME] = EXPAND_LAYOUT( \
36 ___________________GAME_L1_________________, ___________________GAME_R1_________________, \
37 ___________________GAME_L2_________________, ___________________GAME_R2_________________, \
38 ___________________GAME_L3_________________, ___________________GAME_R3_________________, \
39 ___________________GAME_L4_________________, RGB_TOG, RGBRST, ___________________GAME_R4_________________, \
40 ___________________GAME_L5_________________, RGB_RMOD, RGB_MOD, ___________________GAME_R5_________________ \
41 ),
42#endif
43
44 [_LOWER] = EXPAND_LAYOUT( \
45 __________________LOWER_L1_________________, __________________LOWER_R1_________________, \
46 __________________LOWER_L2_________________, __________________LOWER_R2_________________, \
47 __________________LOWER_L3_________________, __________________LOWER_R3_________________, \
48 __________________LOWER_L4_________________, _______, _______, __________________LOWER_R4_________________, \
49 __________________LOWER_L5_________________, _______, _______, __________________LOWER_R5_________________ \
50 ),
51
52 [_RAISE] = EXPAND_LAYOUT( \
53 __________________RAISE_L1_________________, __________________RAISE_R1_________________, \
54 __________________RAISE_L2_________________, __________________RAISE_R2_________________, \
55 __________________RAISE_L3_________________, __________________RAISE_R3_________________, \
56 __________________RAISE_L4_________________, _______, _______, __________________RAISE_R4_________________, \
57 __________________RAISE_L5_________________, _______, _______, __________________RAISE_R5_________________ \
58 ),
59
60#ifdef TRILAYER_ENABLED
61 [_ADJUST] = EXPAND_LAYOUT( \
62 _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, \
63 _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, \
64 _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, \
65 _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \
66 _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________ \
67 ),
68#endif
69};
diff --git a/keyboards/helix/rev2/keymaps/xulkal/rules.mk b/keyboards/helix/rev2/keymaps/xulkal/rules.mk
new file mode 100644
index 000000000..a636b2a61
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/xulkal/rules.mk
@@ -0,0 +1,11 @@
1RGBLIGHT_ENABLE = yes
2# Enable RGBLIGHT Animations
3OPT_DEFS += -DRGBLIGHT_ANIMATIONS
4# Helix specific define for correct RGBLED_NUM
5OPT_DEFS += -DRGBLED_BACK
6
7OLED_DRIVER_ENABLE = yes
8# Helix specific font file
9OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\"
10# Xulkal specific oled define
11OPT_DEFS += -DOLED_90ROTATION
diff --git a/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c b/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c
index 09c27428e..e51edd907 100644
--- a/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c
+++ b/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c
@@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65 ), 65 ),
66 66
67#ifdef TRILAYER_ENABLED 67#ifdef TRILAYER_ENABLED
68 [_RAISE] = EXPAND_LAYOUT( \ 68 [_ADJUST] = EXPAND_LAYOUT( \
69 _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, \ 69 _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, \
70 _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, \ 70 _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, \
71 _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ 71 _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \
@@ -75,3 +75,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
75 ), 75 ),
76#endif 76#endif
77}; 77};
78
diff --git a/users/xulkal/custom_oled.c b/users/xulkal/custom_oled.c
index 77e580b95..d871e96f0 100644
--- a/users/xulkal/custom_oled.c
+++ b/users/xulkal/custom_oled.c
@@ -5,60 +5,112 @@
5 5
6#ifdef OLED_DRIVER_ENABLE 6#ifdef OLED_DRIVER_ENABLE
7 7
8#ifdef RGBLIGHT_ENABLE
9rgblight_config_t rgblight_config;
10#endif
11
8static void render_logo(void) 12static void render_logo(void)
9{ 13{
10 static const char PROGMEM sol_logo[] = { 14 static const char PROGMEM font_logo[] = {
11 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, 15 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
12 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, 16 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
13 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; 17 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
14 oled_write_P(sol_logo, false); 18 oled_write_P(font_logo, false);
19}
20
21#if defined(OLED_90ROTATION)
22
23// TODO: Need to define this function / extern only for helix based split common keyboards
24extern uint8_t is_master;
25bool is_keyboard_master(void)
26{
27 return is_master;
28}
29
30static void render_layer(uint8_t layer)
31{
32 switch (layer)
33 {
34 case _QWERTY:
35 oled_write_P(PSTR("DFLT "), false);
36 break;
37#ifndef GAMELAYER_DISABLE
38 case _GAME:
39 oled_write_P(PSTR("GAME "), false);
40 break;
41#endif
42 case _LOWER:
43 oled_write_P(PSTR("LOWER"), false);
44 break;
45 case _RAISE:
46 oled_write_P(PSTR("RAISE"), false);
47 break;
48#ifdef TRILAYER_ENABLED
49 case _ADJUST:
50 oled_write_P(PSTR("ADJST"), false);
51 break;
52#endif
53 }
15} 54}
16 55
17static void render_status(void) 56static void render_status(void)
18{ 57{
19 // Render to mode icon 58 // Render to mode icon
20 static const char PROGMEM mode_logo[2][3] = { 59 static const char PROGMEM mode_logo[2][4] = {
21 {0x97,0x98,0}, 60 {0x97,0x98,0x0a,0},
22 {0xb7,0xb8,0} 61 {0xb7,0xb8,0x0a,0} };
23 };
24 62
25 oled_write_P(mode_logo[0], false); 63 oled_write_P(mode_logo[0], false);
64 oled_write_P(mode_logo[1], false);
26 65
27#if defined(RGB_MATRIX_ENABLE) 66 oled_write_P(PSTR("Layer"), false);
28 static char buffer[20] = {0}; 67 uint8_t layer = biton(layer_state);
29 snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val); 68 if (layer != _QWERTY)
30 oled_write(buffer, false); 69 render_layer(layer);
31#endif 70 else
71 render_layer(biton32(default_layer_state));
32 72
33 oled_write_P(mode_logo[1], false); 73 // Host Keyboard LED Status
74 uint8_t led_usb_state = host_keyboard_leds();
75 oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR("-----NUMLK") : PSTR("----- "), false);
76 oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLK") : PSTR(" "), false);
77 oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCRLK") : PSTR(" "), false);
34 78
35#if defined(RGB_MATRIX_ENABLE) 79#if defined(RGB_MATRIX_ENABLE)
36 snprintf(buffer, sizeof(buffer), " s%3d m%3d\n", rgb_matrix_config.speed, rgb_matrix_config.mode); 80 oled_set_cursor(0, oled_max_lines() - 7);
81 oled_write_P(PSTR("-----"), false);
82 static char buffer[26] = {0};
83 snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val, rgb_matrix_config.speed, rgb_matrix_config.mode);
84 oled_write(buffer, false);
85#elif defined(RGBLIGHT_ENABLE)
86 oled_set_cursor(0, oled_max_lines() - 7);
87 oled_write_P(PSTR("-----"), false);
88 static char buffer[31] = {0};
89 snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val, rgblight_config.speed, rgblight_config.mode);
37 oled_write(buffer, false); 90 oled_write(buffer, false);
38#endif 91#endif
92}
39 93
40 // 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 94oled_rotation_t oled_init_user(oled_rotation_t rotation) {
41 oled_write_P(PSTR("Layer: "), false); 95 if (is_keyboard_master())
42 switch (biton32(layer_state)) 96 return OLED_ROTATION_270;
97 return OLED_ROTATION_180;
98}
99
100#else // OLED_90ROTATION
101
102static void render_layer(uint8_t layer)
103{
104 switch (layer)
43 { 105 {
44 case _QWERTY: 106 case _QWERTY:
45#ifndef GAMELAYER_DISABLE
46 switch (biton32(default_layer_state))
47 {
48 case _QWERTY:
49 oled_write_P(PSTR("Default\n"), false);
50 break;
51 case _GAME:
52 oled_write_P(PSTR("Game\n"), false);
53 break;
54 default:
55 oled_write_P(PSTR("Undefined\n"), false);
56 break;
57 }
58#else
59 oled_write_P(PSTR("Default\n"), false); 107 oled_write_P(PSTR("Default\n"), false);
60#endif
61 break; 108 break;
109#ifndef GAMELAYER_DISABLE
110 case _GAME:
111 oled_write_P(PSTR("Game\n"), false);
112 break;
113#endif
62 case _LOWER: 114 case _LOWER:
63 oled_write_P(PSTR("Lower\n"), false); 115 oled_write_P(PSTR("Lower\n"), false);
64 break; 116 break;
@@ -70,18 +122,60 @@ static void render_status(void)
70 oled_write_P(PSTR("Adjust\n"), false); 122 oled_write_P(PSTR("Adjust\n"), false);
71 break; 123 break;
72#endif 124#endif
73 default: 125 }
74 oled_write_P(PSTR("Undefined\n"), false); 126}
75 break; 127
76 } 128static void render_status(void)
129{
130 // Render to mode icon
131 static const char PROGMEM mode_logo[2][3] = {
132 {0x97,0x98,0},
133 {0xb7,0xb8,0}
134 };
135
136 oled_write_P(mode_logo[0], false);
137
138#if defined(RGB_MATRIX_ENABLE)
139 static char buffer[20] = {0};
140 snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val);
141 oled_write(buffer, false);
142#elif defined(RGBLIGHT_ENABLE)
143 static char buffer[20] = {0};
144 snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
145 oled_write(buffer, false);
146#else
147 oled_write_P(PSTR("\n"));
148#endif
149
150 oled_write_P(mode_logo[1], false);
151
152#if defined(RGB_MATRIX_ENABLE)
153 snprintf(buffer, sizeof(buffer), " s%3d m%3d\n", rgb_matrix_config.speed, rgb_matrix_config.mode);
154 oled_write(buffer, false);
155#elif defined(RGBLIGHT_ENABLE)
156 snprintf(buffer, sizeof(buffer), " s%3d m%3d\n", rgblight_config.speed, rgblight_config.mode);
157 oled_write(buffer, false);
158#else
159 oled_write_P(PSTR("\n"));
160#endif
77 161
78 // Host Keyboard LED Status 162 // 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
163 oled_write_P(PSTR("Layer: "), false);
164 uint8_t layer = biton(layer_state);
165 if (layer != _QWERTY)
166 render_layer(layer);
167 else
168 render_layer(biton32(default_layer_state));
169
170 // Host Keyboard LED Status
79 uint8_t led_usb_state = host_keyboard_leds(); 171 uint8_t led_usb_state = host_keyboard_leds();
80 oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); 172 oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
81 oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); 173 oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
82 oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); 174 oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
83} 175}
84 176
177#endif // OLED_90ROTATION
178
85void oled_task_user(void) 179void oled_task_user(void)
86{ 180{
87 if (is_keyboard_master()) 181 if (is_keyboard_master())
diff --git a/users/xulkal/custom_tap_dance.c b/users/xulkal/custom_tap_dance.c
index a1c644efd..7123f1be6 100644
--- a/users/xulkal/custom_tap_dance.c
+++ b/users/xulkal/custom_tap_dance.c
@@ -8,7 +8,8 @@
8qk_tap_dance_action_t tap_dance_actions[] = { 8qk_tap_dance_action_t tap_dance_actions[] = {
9 [COMM_QUOT] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_QUOT), 9 [COMM_QUOT] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_QUOT),
10 [BACKSPACE] = ACTION_TAP_DANCE_DOUBLE (KC_BSPACE, LCTL(KC_BSPACE)), 10 [BACKSPACE] = ACTION_TAP_DANCE_DOUBLE (KC_BSPACE, LCTL(KC_BSPACE)),
11 [DELETE] = ACTION_TAP_DANCE_DOUBLE (KC_DELETE, LCTL(KC_DELETE)) 11 [DELETE] = ACTION_TAP_DANCE_DOUBLE (KC_DELETE, LCTL(KC_DELETE)),
12 [DOT] = ACTION_TAP_DANCE_DOUBLE (KC_DOT, KC_GRAVE)
12}; 13};
13 14
14#else 15#else
diff --git a/users/xulkal/rules.mk b/users/xulkal/rules.mk
index 50dc75d61..ab0231d7d 100644
--- a/users/xulkal/rules.mk
+++ b/users/xulkal/rules.mk
@@ -8,6 +8,7 @@ SRC += xulkal.c \
8# Some usual defaults 8# Some usual defaults
9MOUSEKEY_ENABLE = no # Mouse keys (+4700) 9MOUSEKEY_ENABLE = no # Mouse keys (+4700)
10EXTRAKEY_ENABLE = yes # Audio control and System control (+450) 10EXTRAKEY_ENABLE = yes # Audio control and System control (+450)
11TAP_DANCE_ENABLE = yes
11 12
12ifneq ($(strip $(DISABLE_LTO)), yes) 13ifneq ($(strip $(DISABLE_LTO)), yes)
13 EXTRAFLAGS += -flto 14 EXTRAFLAGS += -flto