aboutsummaryrefslogtreecommitdiff
path: root/keyboards/crkbd
diff options
context:
space:
mode:
authorDaneEvans <dane@goneepic.com>2021-05-27 15:30:34 +1000
committerGitHub <noreply@github.com>2021-05-26 22:30:34 -0700
commit9da95bc3abc2d5682aea917e56abfeae30a7980f (patch)
tree8da651a066b4fb878e605d097ae13942ec453e7f /keyboards/crkbd
parent088c71b4ea6e083f01d6c5d7248555972c4125a4 (diff)
downloadqmk_firmware-9da95bc3abc2d5682aea917e56abfeae30a7980f.tar.gz
qmk_firmware-9da95bc3abc2d5682aea917e56abfeae30a7980f.zip
[Keymap] add personal keymap files, and sofle_rgb default maps, (#12267)
Diffstat (limited to 'keyboards/crkbd')
-rw-r--r--keyboards/crkbd/keymaps/devdev/config.h117
-rw-r--r--keyboards/crkbd/keymaps/devdev/keymap.c410
-rw-r--r--keyboards/crkbd/keymaps/devdev/rules.mk4
3 files changed, 531 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/devdev/config.h b/keyboards/crkbd/keymaps/devdev/config.h
new file mode 100644
index 000000000..793c7b020
--- /dev/null
+++ b/keyboards/crkbd/keymaps/devdev/config.h
@@ -0,0 +1,117 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6Copyright 2021 Dane Evans
7
8
9This program is free software: you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation, either version 2 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#pragma once
24
25//#define USE_MATRIX_I2C
26
27/* Select hand configuration */
28
29#define MASTER_LEFT
30// #define MASTER_RIGHT
31// #define EE_HANDS
32
33#define CUSTOM_FONT
34
35#define CUSTOM_LAYER_READ //if you remove this it causes issues - needs better guarding
36
37#define TAPPING_FORCE_HOLD
38#define TAPPING_TERM 200
39
40#define RGBLIGHT_SLEEP
41//
42#define RGBLIGHT_LAYERS
43
44#ifdef RGBLIGHT_ENABLE
45 #undef RGBLED_NUM
46
47 //#define RGBLIGHT_ANIMATIONS
48 #define RGBLIGHT_EFFECT_BREATHING
49 #define RGBLIGHT_EFFECT_RAINBOW_MOOD
50 #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
51 #define RGBLIGHT_EFFECT_SNAKE
52 #define RGBLIGHT_EFFECT_KNIGHT
53 //#define RGBLIGHT_EFFECT_CHRISTMAS
54 //#define RGBLIGHT_EFFECT_STATIC_GRADIENT
55 //#define RGBLIGHT_EFFECT_RGB_TEST
56 //#define RGBLIGHT_EFFECT_ALTERNATING
57 //#define RGBLIGHT_EFFECT_TWINKLE
58
59 //#define RGBLED_NUM 54
60 //#define RGBLED_SPLIT 27
61 //#define RGBLED_SPLIT { 27, 27 } // haven't figured out how to use this yet
62
63 #define RGBLED_NUM 27
64 #define RGBLIGHT_LIMIT_VAL 120
65 #define RGBLIGHT_HUE_STEP 10
66 #define RGBLIGHT_SAT_STEP 17
67 #define RGBLIGHT_VAL_STEP 17
68#endif
69
70#ifdef RGB_MATRIX_ENABLE
71# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
72// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
73// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
74# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
75# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
76// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
77// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
78# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
79
80#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_GRADIENT_LEFT_RIGHT
81
82# define RGB_MATRIX_HUE_STEP 8
83# define RGB_MATRIX_SAT_STEP 8
84# define RGB_MATRIX_VAL_STEP 8
85# define RGB_MATRIX_SPD_STEP 10
86
87/* Disable the animations you don't want/need. You will need to disable a good number of these *
88 * because they take up a lot of space. Disable until you can successfully compile your firmware. */
89 # define DISABLE_RGB_MATRIX_ALPHAS_MODS
90// # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
91// # define DISABLE_RGB_MATRIX_BREATHING
92// # define DISABLE_RGB_MATRIX_CYCLE_ALL
93// # define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
94// # define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
95// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN
96// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
97// # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
98// # define DISABLE_RGB_MATRIX_DUAL_BEACON
99// # define DISABLE_RGB_MATRIX_RAINBOW_BEACON
100// # define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS
101// # define DISABLE_RGB_MATRIX_RAINDROPS
102// # define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
103 # define DISABLE_RGB_MATRIX_TYPING_HEATMAP
104// # define DISABLE_RGB_MATRIX_DIGITAL_RAIN
105// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE
106// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
107 # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
108// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
109// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
110// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
111// # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
112 # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
113// # define DISABLE_RGB_MATRIX_SPLASH
114// # define DISABLE_RGB_MATRIX_MULTISPLASH
115// # define DISABLE_RGB_MATRIX_SOLID_SPLASH
116// # define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
117#endif
diff --git a/keyboards/crkbd/keymaps/devdev/keymap.c b/keyboards/crkbd/keymaps/devdev/keymap.c
new file mode 100644
index 000000000..4da3fcaa6
--- /dev/null
+++ b/keyboards/crkbd/keymaps/devdev/keymap.c
@@ -0,0 +1,410 @@
1/* Copyright 2020 Dane Evans
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 2 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 <http://www.gnu.org/licenses/>.
15 */
16
17// CRKBD
18
19#include QMK_KEYBOARD_H
20
21
22char layer_state_str[24];
23
24
25 enum userspace_layers {
26 _DEFAULTS = 0,
27 _COLEMAK = 0,
28 _COLEMAKDH,
29 _QWERTY,
30 _NUM,
31 _SYM,
32 _COMMAND,
33 _NUMPAD,
34 _SWITCH,
35 _MOVE,
36
37};
38
39const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
40
41 // colemak
42 [_COLEMAK] = LAYOUT(
43 //,-----------------------------------------------------. ,-----------------------------------------------------.
44 LT(_NUMPAD,KC_TAB), KC_Q, KC_W, KC_F, KC_P, KC_G, LT(_SWITCH,KC_J), KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
45 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
46 KC_LSFT, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I,LT(_NUMPAD,KC_O),KC_QUOT,
47 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
48 KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
49 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
50 KC_LGUI, MO(_NUM), KC_SPC, KC_ENT, MO(_SYM), KC_LALT
51 //`--------------------------' `--------------------------'
52 ),
53
54 // colemak DH
55 [_COLEMAKDH] = LAYOUT(
56 //,-----------------------------------------------------. ,-----------------------------------------------------.
57 LT(_NUMPAD,KC_TAB), KC_Q, KC_W, KC_F, KC_P, KC_B, LT(_SWITCH,KC_J), KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
58 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
59 KC_LSFT, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I,LT(_NUMPAD,KC_O),KC_QUOT,
60 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
61 KC_LCTL, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
62 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
63 KC_LGUI, MO(_NUM), KC_SPC, KC_ENT, MO(_SYM), KC_LALT
64 //`--------------------------' `--------------------------'
65 ),
66
67 // qwerty
68 [_QWERTY] = LAYOUT(
69 //,-----------------------------------------------------. ,-----------------------------------------------------.
70 KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, LT(_SWITCH,KC_Y), KC_U, KC_I, KC_O, KC_P, KC_TRNS,
71 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
72 KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_NUMPAD,KC_SCLN), KC_TRNS,
73 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
74 KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS,
75 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
76 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
77 //`--------------------------' `--------------------------'
78 ),
79
80
81
82 // numbers - L thumb
83 [_NUM] = LAYOUT(
84 //,-----------------------------------------------------. ,-----------------------------------------------------.
85 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
86 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
87 KC_TRNS, KC_NO, KC_NO, KC_NO, KC_WH_U, KC_PGUP, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_DEL,
88 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
89 KC_TRNS, KC_NO, KC_NO, KC_NO, KC_WH_D, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
90 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
91 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_COMMAND), KC_TRNS
92 //`--------------------------' `--------------------------'
93 ),
94
95 // symbols - R thumb
96 [_SYM] = LAYOUT(
97 //,-----------------------------------------------------. ,-----------------------------------------------------.
98 KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
99 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
100 KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV,
101 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
102 KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD,
103 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
104 KC_TRNS, MO(_COMMAND), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
105 //`--------------------------' `--------------------------'
106 ),
107
108 // commands - both thumbs
109 [_COMMAND] = LAYOUT(
110 //,-----------------------------------------------------. ,-----------------------------------------------------.
111 RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO,
112 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
113 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, DF(1), DF(0), C(G(KC_LEFT)), KC_NO, KC_NO, C(G(KC_RGHT)), KC_NO, KC_NO,
114 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
115 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_NO, DF(2), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
116 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
117 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
118 //`--------------------------' `--------------------------'
119 ),
120
121 // numpad
122 [_NUMPAD] = LAYOUT(
123 //,-----------------------------------------------------. ,-----------------------------------------------------.
124 LT(0,KC_NO), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_CIRC, KC_P7, KC_P8, KC_P9, KC_ASTR, KC_BSPC,
125 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
126 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MINS, KC_P4, KC_P5, KC_P6, KC_EQL, KC_DEL,
127 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
128 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PLUS, KC_P1, KC_P2, KC_P3, KC_SLSH, KC_NO,
129 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
130 OSM(MOD_MEH), KC_NO, KC_TRNS, KC_ENT, KC_P0, KC_PDOT
131 //`--------------------------' `--------------------------'
132 ),
133
134 // layer switcher
135 [_SWITCH] = LAYOUT(
136 //,-----------------------------------------------------. ,-----------------------------------------------------.
137 TO(0), TO(1), TO(2), TO(3), TO(4), TO(5), KC_NO, TO(7), KC_NO, KC_NO, KC_NO, RESET,
138 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
139 KC_NO, KC_NO, KC_BRIU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, EEP_RST,
140 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
141 KC_SYSTEM_SLEEP, KC_NO, KC_BRID, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
142 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
143 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
144 //`--------------------------' `--------------------------'
145
146 ),
147
148 // amovement
149 [_MOVE] = LAYOUT(
150 //,-----------------------------------------------------. ,-----------------------------------------------------.
151 LT(0,KC_NO), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_UP, KC_PGUP, KC_NO, KC_NO, KC_NO,
152 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
153 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_ENT, KC_RGHT, KC_NO, KC_NO, KC_NO,
154 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
155 KC_APP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_END, KC_DOWN, KC_PGDN, KC_DEL, KC_NO, KC_NO,
156 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
157 KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO
158 //`--------------------------' `--------------------------'
159 )
160
161};
162
163
164// it appears that these are different to the board numbering.
165// when you specify n here, it lightss up n+1 on the board diagram - actually may be an entirely different pattern
166
167// _QWERTY,
168// Light on inner column and underglow
169const rgblight_segment_t PROGMEM layer_qwerty_lights[] = RGBLIGHT_LAYER_SEGMENTS(
170 {0, 10, HSV_AZURE}
171);
172
173// _COLEMAKDH,
174// Light on inner column and underglow
175const rgblight_segment_t PROGMEM layer_colemakdh_lights[] = RGBLIGHT_LAYER_SEGMENTS(
176 {0, 10, HSV_RED}
177);
178
179// _NUM,
180// Light on inner column and underglow
181const rgblight_segment_t PROGMEM layer_num_lights[] = RGBLIGHT_LAYER_SEGMENTS(
182 {0, 10, HSV_TEAL}
183);
184// _SYMBOL,
185// Light on inner column and underglow
186const rgblight_segment_t PROGMEM layer_symbol_lights[] = RGBLIGHT_LAYER_SEGMENTS(
187 {0, 10, HSV_BLUE}
188);
189// _COMMAND,
190// Light on inner column and underglow
191const rgblight_segment_t PROGMEM layer_command_lights[] = RGBLIGHT_LAYER_SEGMENTS(
192 {0, 10, HSV_PURPLE}
193);
194
195
196//_NUMPAD
197//havent worked out how to do each side individually either
198const rgblight_segment_t PROGMEM layer_numpad_lights[] = RGBLIGHT_LAYER_SEGMENTS(
199{0, 10, HSV_ORANGE}
200);
201const rgblight_segment_t PROGMEM layer_numpad_rh_lights[] = RGBLIGHT_LAYER_SEGMENTS(
202 {0, 10, HSV_ORANGE},
203 {10, 5, HSV_BLUE},
204 {15, 3, HSV_BLUE},
205 {18, 3, HSV_BLUE}
206);
207
208// _MOVE,
209// Light on inner column and underglow
210const rgblight_segment_t PROGMEM layer_move_lights[] = RGBLIGHT_LAYER_SEGMENTS(
211 {0, 10, HSV_PINK}
212);
213
214// _SWITCHER // light up top row
215const rgblight_segment_t PROGMEM layer_switcher_lights[] = RGBLIGHT_LAYER_SEGMENTS(
216 {0, 6, HSV_GREEN},
217 {9, 2, HSV_GREEN},
218 {17, 2, HSV_GREEN},
219 {23, 2, HSV_GREEN}
220);
221
222
223// Now define the array of layers. Later layers take precedence
224const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
225 layer_qwerty_lights,
226 layer_colemakdh_lights,
227 layer_num_lights,// overrides layer 1
228 layer_symbol_lights,
229 layer_command_lights,
230 layer_numpad_lights,
231 layer_numpad_rh_lights,
232 layer_move_lights,
233 layer_switcher_lights // Overrides other layers
234);
235
236void keyboard_post_init_user(void) {
237 // Enable the LED layers
238 rgblight_layers = my_rgb_layers;
239 rgblight_mode(10);// haven't found a way to set this in a more useful way
240
241}
242
243
244layer_state_t layer_state_set_user(layer_state_t state) {
245 rgblight_set_layer_state(0, layer_state_cmp(state, _DEFAULTS) && layer_state_cmp(default_layer_state,_QWERTY));
246 rgblight_set_layer_state(1, layer_state_cmp(state, _DEFAULTS) && layer_state_cmp(default_layer_state,_QWERTY));
247
248 rgblight_set_layer_state(2, layer_state_cmp(state, _NUM));
249 rgblight_set_layer_state(3, layer_state_cmp(state, _SYM));
250 rgblight_set_layer_state(4, layer_state_cmp(state, _COMMAND));
251 rgblight_set_layer_state(5, layer_state_cmp(state, _NUMPAD));
252 if (!is_keyboard_master())
253 rgblight_set_layer_state(6, layer_state_cmp(state, _NUMPAD));
254 rgblight_set_layer_state(7, layer_state_cmp(state, _MOVE));
255 rgblight_set_layer_state(8, layer_state_cmp(state, _SWITCH));
256 return state;
257}
258
259/*
260bool led_update_user(led_t led_state) {
261 rgblight_set_layer_state(0, led_state.caps_lock);
262 return true;
263}
264*/
265
266
267
268//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
269#ifdef OLED_DRIVER_ENABLE
270oled_rotation_t oled_init_user(oled_rotation_t rotation) {
271 if (!is_keyboard_master()) {
272 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
273 }
274 return rotation;
275}
276// When add source files to SRC in rules.mk, you can use functions.
277const char *read_layer_state(void);
278const char *read_logo(void);
279void set_keylog(uint16_t keycode, keyrecord_t *record);
280const char *read_keylog(void);
281const char *read_keylogs(void);
282
283
284const char *read_mode_icon(bool swap);
285// const char *read_host_led_state(void);
286// void set_timelog(void);
287// const char *read_timelog(void);
288
289
290void oled_render_layer_state(void) {
291 char string [24];
292 switch (get_highest_layer(default_layer_state|layer_state))
293 {
294 case _QWERTY:
295 oled_write_ln_P(PSTR("Layer: QWERTY"),false);
296 break;
297 case _COLEMAK:
298 oled_write_ln_P(PSTR("Layer: COLEMAK"),false);
299 break;
300 case _COLEMAKDH:
301 oled_write_ln_P(PSTR("Layer: COLEMAKDH"),false);
302 break;
303 case _NUM:
304 oled_write_ln_P(PSTR("Layer: Numbers"),false);
305 break;
306 case _SYM:
307 oled_write_ln_P(PSTR("Layer: Symbols"),false);
308 break;
309 case _COMMAND:
310 oled_write_ln_P(PSTR("Layer: Command"),false);
311 break;
312 case _NUMPAD:
313 oled_write_ln_P(PSTR("Layer: Numpad"),false);
314 break;
315 case _MOVE:
316 oled_write_ln_P(PSTR("Layer: Movement"),false);
317 break;
318 case _SWITCH:
319 oled_write_ln_P(PSTR("Layer: Layer Switch"),false);
320 break;
321 default:
322 snprintf(string, sizeof(string), "%ld",layer_state);
323 oled_write_P(PSTR("Layer: Undef-"),false);
324 oled_write_ln(string, false);
325 }
326 }
327
328/*
329void matrix_render_user(struct CharacterMatrix *matrix) {
330 if (has_usb()) {
331 // If you want to change the display of OLED, you need to change here
332 matrix_write_ln(matrix, read_layer_state());
333 matrix_write_ln(matrix, read_keylog());
334 //matrix_write_ln(matrix, read_keylogs());
335 //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
336 //matrix_write_ln(matrix, read_host_led_state());
337 //matrix_write_ln(matrix, read_timelog());
338 } else {
339 matrix_write(matrix, read_logo());
340 }
341}
342*/
343
344char keylog_str[24] = {};
345const char code_to_name[60] = {
346 ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
347 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
348 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
349 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
350 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
351 '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
352
353void set_keylog(uint16_t keycode, keyrecord_t *record) {
354 char name = ' ';
355 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
356 (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; }
357 if (keycode < 60) {
358 name = code_to_name[keycode];
359 }
360
361 // update keylog
362 snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
363 record->event.key.row, record->event.key.col,
364 keycode, name);
365}
366
367void oled_render_keylog(void) {
368 oled_write(keylog_str, false);
369}
370
371void render_bootmagic_status(bool status) {
372 /* Show Ctrl-Gui Swap options */
373 static const char PROGMEM logo[][2][3] = {
374 {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
375 {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
376 };
377 if (status) {
378 oled_write_ln_P(logo[0][0], false);
379 oled_write_ln_P(logo[0][1], false);
380 } else {
381 oled_write_ln_P(logo[1][0], false);
382 oled_write_ln_P(logo[1][1], false);
383 }
384}
385
386void oled_render_logo(void) {
387 static const char PROGMEM crkbd_logo[] = {
388 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
389 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
390 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
391 0};
392 oled_write_P(crkbd_logo, false);
393}
394
395void oled_task_user(void) {
396 if (is_master) {
397 oled_render_layer_state();
398 oled_render_keylog();
399 } else {
400 oled_render_logo();
401 }
402}
403
404bool process_record_user(uint16_t keycode, keyrecord_t *record) {
405 if (record->event.pressed) {
406 set_keylog(keycode, record);
407 }
408 return true;
409}
410#endif // OLED_DRIVER_ENABLE \ No newline at end of file
diff --git a/keyboards/crkbd/keymaps/devdev/rules.mk b/keyboards/crkbd/keymaps/devdev/rules.mk
new file mode 100644
index 000000000..58e90c811
--- /dev/null
+++ b/keyboards/crkbd/keymaps/devdev/rules.mk
@@ -0,0 +1,4 @@
1MOUSEKEY_ENABLE = yes
2EXTRAKEY_ENABLE = yes
3RGBLIGHT_ENABLE = yes
4OLED_DRIVER_ENABLE = yes \ No newline at end of file