aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/crkbd/keymaps/soundmonster/config.h30
-rw-r--r--keyboards/crkbd/keymaps/soundmonster/keymap.c45
-rw-r--r--keyboards/crkbd/keymaps/soundmonster/rules.mk5
3 files changed, 26 insertions, 54 deletions
diff --git a/keyboards/crkbd/keymaps/soundmonster/config.h b/keyboards/crkbd/keymaps/soundmonster/config.h
index 0687f9c5c..3a31f8613 100644
--- a/keyboards/crkbd/keymaps/soundmonster/config.h
+++ b/keyboards/crkbd/keymaps/soundmonster/config.h
@@ -51,9 +51,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
51 #define RGBLIGHT_VAL_STEP 17 51 #define RGBLIGHT_VAL_STEP 17
52#endif 52#endif
53 53
54#define OLED_FONT_H "keyboards/crkbd/keymaps/soundmonster/glcdfont.c" 54
55// #define OLED_FONT_WIDTH 5 55#ifdef OLED_ENABLE
56// #define OLED_FONT_HEIGHT 7 56# define SPLIT_LAYER_STATE_ENABLE
57# define SPLIT_LED_STATE_ENABLE
58# define SPLIT_MODS_ENABLE
59# define SPLIT_OLED_ENABLE
60# define OLED_FONT_H "keyboards/crkbd/keymaps/soundmonster/glcdfont.c"
61# define OLED_TIMEOUT 30000
62#endif
57 63
58#ifdef RGB_MATRIX_ENABLE 64#ifdef RGB_MATRIX_ENABLE
59# define RGB_MATRIX_KEYPRESSES // reacts to keypresses 65# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
@@ -71,12 +77,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
71 77
72/* Disable the animations you don't want/need. You will need to disable a good number of these * 78/* Disable the animations you don't want/need. You will need to disable a good number of these *
73 * because they take up a lot of space. Disable until you can successfully compile your firmware. */ 79 * because they take up a lot of space. Disable until you can successfully compile your firmware. */
74// # undef ENABLE_RGB_MATRIX_ALPHAS_MODS 80# define ENABLE_RGB_MATRIX_ALPHAS_MODS
75# undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN 81# undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
76# undef ENABLE_RGB_MATRIX_BREATHING 82# undef ENABLE_RGB_MATRIX_BREATHING
77// # undef ENABLE_RGB_MATRIX_BAND_SAT 83# undef ENABLE_RGB_MATRIX_BAND_SAT
78# undef ENABLE_RGB_MATRIX_BAND_VAL 84# undef ENABLE_RGB_MATRIX_BAND_VAL
79# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT 85# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
80# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL 86# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
81# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT 87# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
82# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL 88# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
@@ -85,26 +91,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
85# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN 91# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
86# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN 92# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN
87# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL 93# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
88// # undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON 94# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
89# undef ENABLE_RGB_MATRIX_DUAL_BEACON 95# undef ENABLE_RGB_MATRIX_DUAL_BEACON
90# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL 96# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
91# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL 97# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL
92# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON 98# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON
93# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS 99# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
94// # undef ENABLE_RGB_MATRIX_RAINDROPS 100# undef ENABLE_RGB_MATRIX_RAINDROPS
95# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS 101# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
96// # undef ENABLE_RGB_MATRIX_TYPING_HEATMAP 102# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
97// # undef ENABLE_RGB_MATRIX_DIGITAL_RAIN 103# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
98# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE 104# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE
99# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE 105# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
100# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE 106# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
101// # undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE 107# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
102# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS 108# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
103# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS 109# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
104# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS 110# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
105# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS 111# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
106# undef ENABLE_RGB_MATRIX_SPLASH 112# undef ENABLE_RGB_MATRIX_SPLASH
107// # undef ENABLE_RGB_MATRIX_MULTISPLASH 113# define ENABLE_RGB_MATRIX_MULTISPLASH
108# undef ENABLE_RGB_MATRIX_SOLID_SPLASH 114# undef ENABLE_RGB_MATRIX_SOLID_SPLASH
109# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH 115# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
110#endif 116#endif
diff --git a/keyboards/crkbd/keymaps/soundmonster/keymap.c b/keyboards/crkbd/keymaps/soundmonster/keymap.c
index c9e2c8bc4..70fe50e96 100644
--- a/keyboards/crkbd/keymaps/soundmonster/keymap.c
+++ b/keyboards/crkbd/keymaps/soundmonster/keymap.c
@@ -1,3 +1,6 @@
1// Copyright 2022 Soundmonster (@soundmonster)
2// SPDX-License-Identifier: GPL-2.0-or-later
3
1#include QMK_KEYBOARD_H 4#include QMK_KEYBOARD_H
2 5
3extern keymap_config_t keymap_config; 6extern keymap_config_t keymap_config;
@@ -7,10 +10,6 @@ extern keymap_config_t keymap_config;
7extern rgblight_config_t rgblight_config; 10extern rgblight_config_t rgblight_config;
8#endif 11#endif
9 12
10#ifdef OLED_ENABLE
11static uint32_t oled_timer = 0;
12#endif
13
14// Each layer gets a name for readability, which is then used in the keymap matrix below. 13// Each layer gets a name for readability, which is then used in the keymap matrix below.
15// The underscores don't mean anything - you can have a layer called STUFF or any other name. 14// The underscores don't mean anything - you can have a layer called STUFF or any other name.
16// Layer names don't all need to be of the same length, obviously, and you can also skip them 15// Layer names don't all need to be of the same length, obviously, and you can also skip them
@@ -278,53 +277,19 @@ void render_layer_state(void) {
278 } 277 }
279} 278}
280 279
281void render_status_main(void) { 280bool oled_task_user(void) {
282 render_logo(); 281 // Renders the current keyboard state (layers and mods)
283 render_space();
284 render_layer_state();
285 render_space();
286 render_mod_status_gui_alt(get_mods()|get_oneshot_mods());
287 render_mod_status_ctrl_shift(get_mods()|get_oneshot_mods());
288}
289
290void render_status_secondary(void) {
291 render_logo(); 282 render_logo();
292 render_space(); 283 render_space();
293 render_layer_state(); 284 render_layer_state();
294 render_space(); 285 render_space();
295 render_mod_status_gui_alt(get_mods()|get_oneshot_mods()); 286 render_mod_status_gui_alt(get_mods()|get_oneshot_mods());
296 render_mod_status_ctrl_shift(get_mods()|get_oneshot_mods()); 287 render_mod_status_ctrl_shift(get_mods()|get_oneshot_mods());
297}
298
299void suspend_power_down_user() {
300 oled_off();
301}
302
303bool oled_task_user(void) {
304 if (timer_elapsed32(oled_timer) > 30000) {
305 oled_off();
306 return false;
307 }
308#ifndef SPLIT_KEYBOARD
309 else { oled_on(); }
310#endif
311
312 if (is_keyboard_master()) {
313 render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
314 } else {
315 render_status_secondary();
316 }
317 return false; 288 return false;
318} 289}
319 290
320#endif 291#endif
321bool process_record_user(uint16_t keycode, keyrecord_t *record) { 292bool process_record_user(uint16_t keycode, keyrecord_t *record) {
322 if (record->event.pressed) {
323#ifdef OLED_ENABLE
324 oled_timer = timer_read32();
325#endif
326 // set_timelog();
327 }
328 static uint16_t my_colon_timer; 293 static uint16_t my_colon_timer;
329 294
330 switch (keycode) { 295 switch (keycode) {
diff --git a/keyboards/crkbd/keymaps/soundmonster/rules.mk b/keyboards/crkbd/keymaps/soundmonster/rules.mk
index 62971258e..d3a964424 100644
--- a/keyboards/crkbd/keymaps/soundmonster/rules.mk
+++ b/keyboards/crkbd/keymaps/soundmonster/rules.mk
@@ -2,6 +2,7 @@ RGBLIGHT_ENABLE = no
2RGB_MATRIX_ENABLE = yes 2RGB_MATRIX_ENABLE = yes
3MOUSEKEY_ENABLE = no 3MOUSEKEY_ENABLE = no
4NKRO_ENABLE = yes 4NKRO_ENABLE = yes
5OLED_ENABLE = yes 5OLED_ENABLE = yes
6OLED_DRIVER = SSD1306 6OLED_DRIVER = SSD1306
7LTO_ENABLE = yes
7 8