aboutsummaryrefslogtreecommitdiff
path: root/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/rgbkb/sol/keymaps/xulkal/keymap.c')
-rw-r--r--keyboards/rgbkb/sol/keymaps/xulkal/keymap.c93
1 files changed, 1 insertions, 92 deletions
diff --git a/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c b/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c
index 5c560abad..09c27428e 100644
--- a/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c
+++ b/keyboards/rgbkb/sol/keymaps/xulkal/keymap.c
@@ -6,10 +6,6 @@
6#include "split_util.h" 6#include "split_util.h"
7#endif 7#endif
8 8
9#ifdef OLED_DRIVER_ENABLE
10 #include "oled_driver.h"
11#endif
12
13#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) 9#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__)
14 10
15// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns 11// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns
@@ -36,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
36 _________________QWERTY_L3_________________, KC_GRV, KC_QUOT, _________________QWERTY_R3_________________, \ 32 _________________QWERTY_L3_________________, KC_GRV, KC_QUOT, _________________QWERTY_R3_________________, \
37 _________________QWERTY_L4_________________, RGB_TOG, RGBRST, _________________QWERTY_R4_________________, \ 33 _________________QWERTY_L4_________________, RGB_TOG, RGBRST, _________________QWERTY_R4_________________, \
38 _________________QWERTY_L5_________________, RGB_RMOD, RGB_MOD, _________________QWERTY_R5_________________, \ 34 _________________QWERTY_L5_________________, RGB_RMOD, RGB_MOD, _________________QWERTY_R5_________________, \
39 KC_SPC, KC_DEL, KC_ENT, KC_SPC \ 35 KC_SPC, TD_DEL, KC_ENT, KC_SPC \
40 ), 36 ),
41 37
42#ifndef GAMELAYER_DISABLE 38#ifndef GAMELAYER_DISABLE
@@ -79,90 +75,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
79 ), 75 ),
80#endif 76#endif
81}; 77};
82
83//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
84#ifdef OLED_DRIVER_ENABLE
85
86static void render_logo(void) {
87 static const char PROGMEM sol_logo[] = {
88 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
89 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
90 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
91
92 oled_write_P(sol_logo, false);
93}
94
95
96static void render_status(void) {
97 // Render to mode icon
98 static const char PROGMEM mode_logo[2][3] = {
99 {0x97,0x98,0},
100 {0xb7,0xb8,0} };
101
102 oled_write_P(mode_logo[0], false);
103
104#if defined(RGB_MATRIX_ENABLE)
105 static char buffer[20] = {0};
106 snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val);
107 oled_write(buffer, false);
108#endif
109
110 oled_write_P(mode_logo[1], false);
111
112#if defined(RGB_MATRIX_ENABLE)
113 snprintf(buffer, sizeof(buffer), " s%3d m%3d\n", rgb_matrix_config.speed, rgb_matrix_config.mode);
114 oled_write(buffer, false);
115#endif
116
117 // 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
118 oled_write_P(PSTR("Layer: "), false);
119 switch (biton32(layer_state)) {
120 case _QWERTY:
121#ifndef GAMELAYER_DISABLE
122 switch (biton32(default_layer_state)) {
123 case _QWERTY:
124 oled_write_P(PSTR("Default\n"), false);
125 break;
126 case _GAME:
127 oled_write_P(PSTR("Game\n"), false);
128 break;
129 default:
130 oled_write_P(PSTR("Undefined\n"), false);
131 break;
132 }
133#else
134 oled_write_P(PSTR("Default\n"), false);
135#endif
136 break;
137 case _LOWER:
138 oled_write_P(PSTR("Lower\n"), false);
139 break;
140 case _RAISE:
141 oled_write_P(PSTR("Raise\n"), false);
142 break;
143#ifdef TRILAYER_ENABLED
144 case _ADJUST:
145 oled_write_P(PSTR("Adjust\n"), false);
146 break;
147#endif
148 default:
149 oled_write_P(PSTR("Undefined\n"), false);
150 }
151
152 // Host Keyboard LED Status
153 uint8_t led_usb_state = host_keyboard_leds();
154 oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
155 oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
156 oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
157}
158
159void oled_task_user(void) {
160 if (is_keyboard_master()) {
161 render_status();
162 } else {
163 render_logo();
164 oled_scroll_left();
165 }
166}
167
168#endif