diff options
author | Drashna Jaelre <drashna@live.com> | 2020-03-31 16:26:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 16:26:43 -0700 |
commit | c67e30459390982f4f1b47f46c62322f1fe9ba87 (patch) | |
tree | d3504649cb692e58823bc7589d1a032256d9b0c1 /users | |
parent | 8c80475fcc568e04f637ae973086b65a31b5254d (diff) |
[Keymap] Drashna's Cleanup and RGB Divide (#8506)
* Enable External EEPROM on Planck Rev6
* Update KC_MAKE macro to use qmk cli util
* Disable additional gradients for rgb matrix
* Update analog code for newer methods
* Update ergodox layout
* Disable Grave Escape
* Cleanup OLED code a bit
* Remove old unicode code
* Seperate RGB Matrix code from RGB Light code in userspace
* Massive overhaul an generalization of personal OLED code
Now lets hope I NEVER get a keyboard using a 128x32 in a normal orientation.
* Super tiny cleanup
* Enable Diablo layer on kyria
* clang format pass
* Additional OLED cleanup
Diffstat (limited to 'users')
-rw-r--r-- | users/drashna/config.h | 3 | ||||
-rw-r--r-- | users/drashna/drashna.c | 35 | ||||
-rw-r--r-- | users/drashna/drashna.h | 9 | ||||
-rw-r--r-- | users/drashna/oled_stuff.c | 278 | ||||
-rw-r--r-- | users/drashna/oled_stuff.h | 91 | ||||
-rw-r--r-- | users/drashna/process_records.c | 359 | ||||
-rw-r--r-- | users/drashna/process_records.h | 18 | ||||
-rw-r--r-- | users/drashna/rgb_matrix_stuff.c | 86 | ||||
-rw-r--r-- | users/drashna/rgb_matrix_stuff.h | 9 | ||||
-rw-r--r-- | users/drashna/rgb_stuff.c | 404 | ||||
-rw-r--r-- | users/drashna/rgb_stuff.h | 26 | ||||
-rw-r--r-- | users/drashna/rules.mk | 13 |
12 files changed, 854 insertions, 477 deletions
diff --git a/users/drashna/config.h b/users/drashna/config.h index 106ae19c14..64b4b64ab7 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -1,7 +1,7 @@ #pragma once // Use custom magic number so that when switching branches, EEPROM always gets reset -#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1337 +#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1338 /* Set Polling rate to 1000Hz */ #define USB_POLLING_INTERVAL_MS 1 @@ -52,6 +52,7 @@ # if defined(__AVR__) && !defined(__AVR_AT90USB1286__) # define DISABLE_RGB_MATRIX_ALPHAS_MODS # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT # define DISABLE_RGB_MATRIX_BREATHING # define DISABLE_RGB_MATRIX_BAND_SAT # define DISABLE_RGB_MATRIX_BAND_VAL diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 1a4ee9b414..ba19d4803f 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -18,12 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "drashna.h" userspace_config_t userspace_config; -#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) -# define DRASHNA_UNICODE_MODE UC_WIN -#else -// set to 2 for UC_WIN, set to 4 for UC_WINC -# define DRASHNA_UNICODE_MODE 2 -#endif bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { static uint16_t this_timer; @@ -93,19 +87,17 @@ void matrix_init_user(void) { DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); #endif - -#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(DRASHNA_UNICODE_MODE); - get_unicode_input_mode(); -#endif // UNICODE_ENABLE matrix_init_keymap(); } __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - keyboard_post_init_rgb(); +#if defined(RGBLIGHT_ENABLE) + keyboard_post_init_rgb_light(); +#endif +#if defined(RGB_MATRIX_ENABLE) + keyboard_post_init_rgb_matrix(); #endif keyboard_post_init_keymap(); } @@ -155,9 +147,12 @@ void matrix_scan_user(void) { run_diablo_macro_check(); #endif // TAP_DANCE_ENABLE -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - matrix_scan_rgb(); +#if defined(RGBLIGHT_ENABLE) + matrix_scan_rgb_light(); #endif // RGBLIGHT_ENABLE +#if defined(RGB_MATRIX_ENABLE) + matrix_scan_rgb_matrix(); +#endif matrix_scan_keymap(); } @@ -168,8 +163,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) // Then runs keymap's layer change check layer_state_t layer_state_set_user(layer_state_t state) { state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - state = layer_state_set_rgb(state); +#if defined(RGBLIGHT_ENABLE) + state = layer_state_set_rgb_light(state); #endif // RGBLIGHT_ENABLE return layer_state_set_keymap(state); } @@ -200,12 +195,6 @@ void eeconfig_init_user(void) { userspace_config.raw = 0; userspace_config.rgb_layer_change = true; eeconfig_update_user(userspace_config.raw); -#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(DRASHNA_UNICODE_MODE); - get_unicode_input_mode(); -#else - eeprom_update_byte(EECONFIG_UNICODEMODE, DRASHNA_UNICODE_MODE); -#endif eeconfig_init_keymap(); keyboard_init(); } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 0ba1817604..c10ea5114a 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -25,9 +25,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifdef TAP_DANCE_ENABLE # include "tap_dances.h" #endif // TAP_DANCE_ENABLE -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +#if defined(RGBLIGHT_ENABLE) # include "rgb_stuff.h" #endif +#if defined(RGB_MATRIX_ENABLE) +# include "rgb_matrix_stuff.h" +#endif +#if defined(OLED_DRIVER_ENABLE) +# include "oled_stuff.h" +#endif /* Define layer names */ enum userspace_layers { @@ -70,7 +76,6 @@ typedef union { bool rgb_layer_change :1; bool is_overwatch :1; bool nuke_switch :1; - uint8_t unicode_mod :4; bool swapped_numbers :1; bool rgb_matrix_idle_anim :1; }; diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c new file mode 100644 index 0000000000..7580de1d33 --- /dev/null +++ b/users/drashna/oled_stuff.c @@ -0,0 +1,278 @@ +#include "drashna.h" + +extern uint8_t is_master; + +#ifndef KEYLOGGER_LENGTH +// # ifdef OLED_DISPLAY_128X64 +# define KEYLOGGER_LENGTH ((int)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) +// # else +// # define KEYLOGGER_LENGTH (uint8_t *(OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT)) +// # endif +#endif + +static uint32_t oled_timer = 0; +static char keylog_str[KEYLOGGER_LENGTH + 1] = {"\n"}; +static uint16_t log_timer = 0; + +// clang-format off +static const char PROGMEM code_to_name[0xFF] = { +// 0 1 2 3 4 5 6 7 8 9 A B c D E F + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x + '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x + ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x + ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx + 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx +}; +// clang-format on + +void add_keylog(uint16_t keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { + keycode = keycode & 0xFF; + } else if (keycode > 0xFF) { + keycode = 0; + } + + for (uint8_t i = (KEYLOGGER_LENGTH - 1); i > 0; --i) { + keylog_str[i] = keylog_str[i - 1]; + } + + if (keycode < (sizeof(code_to_name) / sizeof(char))) { + keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); + } + + log_timer = timer_read(); +} + +bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef OLED_DRIVER_ENABLE + oled_timer = timer_read32(); + add_keylog(keycode); +#endif + } + return true; +} + +void update_log(void) { + if (timer_elapsed(log_timer) > 750) { + // add_keylog(0); + } +} + +void render_keylogger_status(void) { + oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); + oled_write(keylog_str, false); +} + +void render_default_layer_state(void) { + oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); + switch (get_highest_layer(default_layer_state)) { + case _QWERTY: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_QWERTY), false); + break; + case _COLEMAK: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK), false); + break; + case _DVORAK: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); + break; + case _WORKMAN: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_WORKMAN), false); + break; + case _NORMAN: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_NORMAN), false); + break; + case _MALTRON: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_MALTRON), false); + break; + case _EUCALYN: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_EUCALYN), false); + break; + case _CARPLAX: + oled_write_P(PSTR(OLED_RENDER_LAYOUT_CARPLAX), false); + break; + } +#ifdef OLED_DISPLAY_128X64 + oled_advance_page(true); +#endif +} + +void render_layer_state(void) { + oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_LAYER_LOWER), layer_state_is(_LOWER)); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_LAYER_RAISE), layer_state_is(_RAISE)); +#if _MODS +# ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +# endif + oled_write_P(PSTR(OLED_RENDER_LAYER_MODS), layer_state_is(_MODS)); +#endif +#ifdef OLED_DISPLAY_128X64 + oled_advance_page(true); +#endif +} + +void render_keylock_status(uint8_t led_usb_state) { + oled_write_P(PSTR(OLED_RENDER_LOCK_NAME), false); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_LOCK_NUML), led_usb_state & (1 << USB_LED_NUM_LOCK)); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_LOCK_CAPS), led_usb_state & (1 << USB_LED_CAPS_LOCK)); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_LOCK_SCLK), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); +#ifndef OLED_DISPLAY_128X64 + oled_advance_page(true); +#endif +} + +void render_mod_status(uint8_t modifiers) { + oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); + oled_write_P(PSTR(OLED_RENDER_MODS_SFT), (modifiers & MOD_MASK_SHIFT)); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_MODS_CTL), (modifiers & MOD_MASK_CTRL)); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_MODS_ALT), (modifiers & MOD_MASK_ALT)); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(" "), false); +#endif + oled_write_P(PSTR(OLED_RENDER_MODS_GUI), (modifiers & MOD_MASK_GUI)); +} + +void render_bootmagic_status(void) { + /* Show Ctrl-Gui Swap options */ + static const char PROGMEM logo[][2][3] = { + {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, + {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, + }; + + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false); +#ifdef OLED_DISPLAY_128X64 + if (keymap_config.swap_lctl_lgui) +#else + oled_write_P(PSTR(" "), false); +#endif + { + oled_write_P(logo[1][0], false); +#ifdef OLED_DISPLAY_128X64 + } else { +#endif + oled_write_P(logo[0][0], false); + } + oled_write_P(PSTR(" "), false); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NKRO), keymap_config.nkro); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR(OLED_RENDER_BOOTMAGIC_NOGUI), !keymap_config.no_gui); + oled_write_P(PSTR("Magic "), false); + if (keymap_config.swap_lctl_lgui) +#endif + { + oled_write_P(logo[1][1], false); +#ifdef OLED_DISPLAY_128X64 + } else { +#endif + oled_write_P(logo[0][1], false); + } + oled_write_P(PSTR(" "), false); +#ifdef OLED_DISPLAY_128X64 + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_GRV), keymap_config.swap_grave_esc); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_CAPS), keymap_config.swap_control_capslock); + oled_advance_page(true); +#else + oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NKRO), keymap_config.nkro); +#endif +} + +void render_user_status(void) { + oled_write_P(PSTR(OLED_RENDER_USER_NAME), false); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_USER_ANIM), userspace_config.rgb_matrix_idle_anim); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_USER_LAYR), userspace_config.rgb_layer_change); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(OLED_RENDER_USER_NUKE), userspace_config.nuke_switch); +#ifdef OLED_DISPLAY_128X64 + oled_advance_page(true); +#endif +} + +__attribute__((weak)) void oled_driver_render_logo(void) { + // clang-format off + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + // clang-format on + oled_write_P(qmk_logo, false); +} + +void render_status_secondary(void) { +#if !defined(SPLIT_TRANSPORT_MIRROR) || defined(OLED_DRIVER_128x64) + oled_driver_render_logo(); +#endif +#ifdef SPLIT_TRANSPORT_MIRROR + /* Show Keyboard Layout */ + render_default_layer_state(); + render_layer_state(); + render_mod_status(get_mods() | get_oneshot_mods()); + render_keylogger_status(); + +#endif +} +// clang-format on + +void render_status_main(void) { + /* Show Keyboard Layout */ + render_default_layer_state(); + render_keylock_status(host_keyboard_leds()); + render_bootmagic_status(); + render_user_status(); + + render_keylogger_status(); +} + +void oled_task_user(void) { + if (timer_elapsed32(oled_timer) > 30000) { + oled_off(); + return; + } +#ifndef SPLIT_KEYBOARD + else { + oled_on(); + } +#endif + + update_log(); + + if (is_master) { + render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_status_secondary(); + } +} diff --git a/users/drashna/oled_stuff.h b/users/drashna/oled_stuff.h new file mode 100644 index 0000000000..662e206b76 --- /dev/null +++ b/users/drashna/oled_stuff.h @@ -0,0 +1,91 @@ +#pragma once + +#include "quantum.h" +#include "oled_driver.h" + +void oled_driver_render_logo(void); +bool process_record_user_oled(uint16_t keycode, keyrecord_t *record); + +#ifdef OLED_DISPLAY_128X64 +# define OLED_RENDER_KEYLOGGER "Keylogger: " + +# define OLED_RENDER_LAYOUT_NAME "Layout: " +# define OLED_RENDER_LAYOUT_QWERTY "Qwerty" +# define OLED_RENDER_LAYOUT_COLEMAK "Colemak" +# define OLED_RENDER_LAYOUT_DVORAK "Dvorak" +# define OLED_RENDER_LAYOUT_WORKMAN "Workman" +# define OLED_RENDER_LAYOUT_NORMAN "Norman" +# define OLED_RENDER_LAYOUT_MALTRON "Matron" +# define OLED_RENDER_LAYOUT_EUCALYN "Eucalyn" +# define OLED_RENDER_LAYOUT_CARPLAX "Carplax" + +# define OLED_RENDER_LAYER_NAME "Layer:\n" +# define OLED_RENDER_LAYER_LOWER "Lower" +# define OLED_RENDER_LAYER_RAISE "Raise" +# define OLED_RENDER_LAYER_ADJUST "Adjust" +# define OLED_RENDER_LAYER_MODS "Mods" + +# define OLED_RENDER_LOCK_NAME "Lock: " +# define OLED_RENDER_LOCK_NUML "NUML" +# define OLED_RENDER_LOCK_CAPS "CAPS" +# define OLED_RENDER_LOCK_SCLK "SCLK" + +# define OLED_RENDER_MODS_NAME "Mods: " +# define OLED_RENDER_MODS_SFT "Sft" +# define OLED_RENDER_MODS_CTL "Ctl" +# define OLED_RENDER_MODS_ALT "Alt" +# define OLED_RENDER_MODS_GUI "GUI" + +# define OLED_RENDER_BOOTMAGIC_NAME "Boot " +# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" +# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" +# define OLED_RENDER_BOOTMAGIC_GRV "GRV" +# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" + +# define OLED_RENDER_USER_NAME "USER:" +# define OLED_RENDER_USER_ANIM "Anim" +# define OLED_RENDER_USER_LAYR "Layr" +# define OLED_RENDER_USER_NUKE "Nuke" + +#else +# define OLED_RENDER_KEYLOGGER "KLogr" + +# define OLED_RENDER_LAYOUT_NAME "Lyout" +# define OLED_RENDER_LAYOUT_QWERTY " QRTY" +# define OLED_RENDER_LAYOUT_COLEMAK " COLE" +# define OLED_RENDER_LAYOUT_DVORAK " DVRK" +# define OLED_RENDER_LAYOUT_WORKMAN " WKMN" +# define OLED_RENDER_LAYOUT_NORMAN " NORM" +# define OLED_RENDER_LAYOUT_MALTRON " MLTN" +# define OLED_RENDER_LAYOUT_EUCALYN " ECLN" +# define OLED_RENDER_LAYOUT_CARPLAX " CRPX" + +# define OLED_RENDER_LAYER_NAME "LAYER" +# define OLED_RENDER_LAYER_LOWER "Lower" +# define OLED_RENDER_LAYER_RAISE "Raise" +# define OLED_RENDER_LAYER_ADJUST "Adjst" +# define OLED_RENDER_LAYER_MODS " Mods" + +# define OLED_RENDER_LOCK_NAME "Lock:" +# define OLED_RENDER_LOCK_NUML "N" +# define OLED_RENDER_LOCK_CAPS "C" +# define OLED_RENDER_LOCK_SCLK "S" + +# define OLED_RENDER_MODS_NAME "Mods: " +# define OLED_RENDER_MODS_SFT "S" +# define OLED_RENDER_MODS_CTL "C" +# define OLED_RENDER_MODS_ALT "A" +# define OLED_RENDER_MODS_GUI "G" + +# define OLED_RENDER_BOOTMAGIC_NAME "BTMGK" +# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" +# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" +# define OLED_RENDER_BOOTMAGIC_GRV "GRV" +# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" + +# define OLED_RENDER_USER_NAME "USER:" +# define OLED_RENDER_USER_ANIM "Anim" +# define OLED_RENDER_USER_LAYR "Layr" +# define OLED_RENDER_USER_NUKE "Nuke" + +#endif diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index af3ee9cf05..101b3d95ce 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -17,101 +17,308 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); # endif #endif // KEYLOGGER_ENABLE +#ifdef OLED_DRIVER_ENABLE + process_record_user_oled(keycode, record); +#endif // OLED - switch (keycode) { - case KC_QWERTY ... KC_WORKMAN: - if (record->event.pressed) { - uint8_t mods = mod_config(get_mods() | get_oneshot_mods()); - if (!mods) { - set_single_persistent_default_layer(keycode - KC_QWERTY); - } else if (mods & MOD_MASK_SHIFT) { - set_single_persistent_default_layer(keycode - KC_QWERTY + 4); - } else if (mods & MOD_MASK_CTRL) { - set_single_persistent_default_layer(keycode - KC_QWERTY + 8); + if (process_record_keymap(keycode, record) && process_record_secrets(keycode, record) +#ifdef RGB_MATRIX_ENABLE + && process_record_user_rgb_matrix(keycode, record) +#endif +#ifdef RGBLIGHT_ENABLE + && process_record_user_rgb_light(keycode, record) +#endif + ) { + switch (keycode) { + case KC_QWERTY ... KC_WORKMAN: + if (record->event.pressed) { + uint8_t mods = mod_config(get_mods() | get_oneshot_mods()); + if (!mods) { + set_single_persistent_default_layer(keycode - KC_QWERTY); + } else if (mods & MOD_MASK_SHIFT) { + set_single_persistent_default_layer(keycode - KC_QWERTY + 4); + } else if (mods & MOD_MASK_CTRL) { + set_single_persistent_default_layer(keycode - KC_QWERTY + 8); + } } - } - break; + break; - case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader - if (!record->event.pressed) { - uint8_t temp_mod = mod_config(get_mods()); - uint8_t temp_osm = mod_config(get_oneshot_mods()); - clear_mods(); - clear_oneshot_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { #ifndef MAKE_BOOTLOADER - if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) + uint8_t temp_mod = mod_config(get_mods()); + uint8_t temp_osm = mod_config(get_oneshot_mods()); + clear_mods(); + clear_oneshot_mods(); #endif - { - send_string_with_delay_P(PSTR(":flash"), TAP_CODE_DELAY); - } - if ((temp_mod | temp_osm) & MOD_MASK_CTRL) { - send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); - } + send_string_with_delay_P(PSTR("bin/qmk"), TAP_CODE_DELAY); +#ifndef MAKE_BOOTLOADER + if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) +#endif + { + send_string_with_delay_P(PSTR(" flash "), TAP_CODE_DELAY); +#ifndef MAKE_BOOTLOADER + } else { + send_string_with_delay_P(PSTR(" compile "), TAP_CODE_DELAY); +#endif + } + send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY); #ifdef RGB_MATRIX_SPLIT_RIGHT - send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes"), TAP_CODE_DELAY); + send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes"), TAP_CODE_DELAY); # ifndef OLED_DRIVER_ENABLE - send_string_with_delay_P(PSTR(" OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY); + send_string_with_delay_P(PSTR(" OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY); # endif #endif - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); - } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); + } - break; + break; - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - break; + case VRSN: // Prints firmware version + if (record->event.pressed) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); + } + break; - case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them + case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them #ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - for (uint8_t index = 0; index < 4; index++) { - diablo_timer[index].key_interval = 0; + if (record->event.pressed) { + for (uint8_t index = 0; index < 4; index++) { + diablo_timer[index].key_interval = 0; + } } - } #endif // TAP_DANCE_ENABLE - break; + break; - case KC_CCCV: // One key copy/paste - if (record->event.pressed) { - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - tap_code16(LCTL(KC_C)); - } else { // Tap, paste - tap_code16(LCTL(KC_V)); + case KC_CCCV: // One key copy/paste + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + tap_code16(LCTL(KC_C)); + } else { // Tap, paste + tap_code16(LCTL(KC_V)); + } } - } - break; + break; #ifdef UNICODE_ENABLE - case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ - if (record->event.pressed) { - send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); - } - break; - case UC_TABL: // ┬─┬ノ( º _ ºノ) - if (record->event.pressed) { - send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); - } - break; - case UC_SHRG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); - } - break; - case UC_DISA: // ಠ_ಠ - if (record->event.pressed) { - send_unicode_hex_string("0CA0 005F 0CA0"); - } - break; + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ + if (record->event.pressed) { + send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); + } + break; + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_string("┬─┬ノ( º _ ºノ)"); + } + break; + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_string("¯\\_(ツ)_/¯"); + } + break; + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_string("ಠ_ಠ"); + } + break; #endif - } - return process_record_keymap(keycode, record) && + case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - process_record_user_rgb(keycode, record) && + if (record->event.pressed) { + userspace_config.rgb_layer_change ^= 1; + dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + eeconfig_update_user(userspace_config.raw); + if (userspace_config.rgb_layer_change) { +# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) + rgblight_enable_noeeprom(); +# endif + layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) +# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) + } else { + rgblight_disable_noeeprom(); +# endif + } + } #endif // RGBLIGHT_ENABLE - process_record_secrets(keycode, record); + break; + +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case RGB_TOG: + // Split keyboards need to trigger on key-up for edge-case issue +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_toggle(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_toggle(); +# endif + } + return false; + break; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions + if (record->event.pressed) { + bool is_eeprom_updated; +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (userspace_config.rgb_layer_change) { + userspace_config.rgb_layer_change = false; + dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + is_eeprom_updated = true; + } +# endif +# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (userspace_config.rgb_matrix_idle_anim) { + userspace_config.rgb_matrix_idle_anim = false; + dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); + is_eeprom_updated = true; + } +# endif + if (is_eeprom_updated) { + eeconfig_update_user(userspace_config.raw); + } + } + +# if defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES) + if (keycode == RGB_MODE_FORWARD && record->event.pressed) { + uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); + if (shifted) { +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_step_reverse(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_step_reverse(); +# endif + } else { +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_step(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_step(); +# endif + } + } else if (keycode == RGB_MODE_REVERSE && record->event.pressed) { + uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); + if (shifted) { +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_step(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_step(); +# endif + } else { +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_step_reverse(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_step_reverse(); +# endif + } + } else if (keycode == RGB_HUI) { +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_increase_hue(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_increase_hue(); +# endif + } + } else if (keycode == RGB_HUD) { +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_decrease_hue(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_decrease_hue(); +# endif + } + } else if (keycode == RGB_SAI) { +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_increase_sat(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_increase_sat(); +# endif + } + } else if (keycode == RGB_SAD) { +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_decrease_sat(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_decrease_sat(); +# endif + } + } else if (keycode == RGB_VAI) { +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_increase_val(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_increase_val(); +# endif + } + } else if (keycode == RGB_VAD) { +# ifndef SPLIT_KEYBOARD + if (record->event.pressed) { +# else + if (!record->event.pressed) { +# endif +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_decrease_val(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_decrease_val(); +# endif + } + } else if (keycode == RGB_SPI) { + if (record->event.pressed) { +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_increase_speed(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_increase_speed(); +# endif + } + } else if (keycode == RGB_SPD) { + if (record->event.pressed) { +# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) + rgblight_decrease_speed(); +# endif +# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) + rgb_matrix_decrease_speed(); +# endif + } + } + return false; +# endif +#endif + } + } + return true; } diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index cb7ec3ec40..999882d4bc 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h @@ -34,13 +34,13 @@ enum userspace_custom_keycodes { bool process_record_secrets(uint16_t keycode, keyrecord_t *record); bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define ADJUST MO(_ADJUST) +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) #define TG_MODS TG(_MODS) #define TG_GAME TG(_GAMEPAD) -#define OS_LWR OSL(_LOWER) -#define OS_RSE OSL(_RAISE) +#define OS_LWR OSL(_LOWER) +#define OS_RSE OSL(_RAISE) #define KC_SEC1 KC_SECRET_1 #define KC_SEC2 KC_SECRET_2 @@ -48,13 +48,13 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define KC_SEC4 KC_SECRET_4 #define KC_SEC5 KC_SECRET_5 -#define QWERTY KC_QWERTY -#define DVORAK KC_DVORAK +#define QWERTY KC_QWERTY +#define DVORAK KC_DVORAK #define COLEMAK KC_COLEMAK #define WORKMAN KC_WORKMAN #define KC_RESET RESET -#define KC_RST KC_RESET +#define KC_RST KC_RESET #ifdef SWAP_HANDS_ENABLE # define KC_C1R3 SH_T(KC_TAB) @@ -81,7 +81,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define OS_RCTL OSM(MOD_RCTL) #define OS_LALT OSM(MOD_LALT) #define OS_RALT OSM(MOD_RALT) -#define OS_MEH OSM(MOD_MEH) +#define OS_MEH OSM(MOD_MEH) #define OS_HYPR OSM(MOD_HYPR) #define ALT_APP ALT_T(KC_APP) diff --git a/users/drashna/rgb_matrix_stuff.c b/users/drashna/rgb_matrix_stuff.c new file mode 100644 index 0000000000..0914aab144 --- /dev/null +++ b/users/drashna/rgb_matrix_stuff.c @@ -0,0 +1,86 @@ +#include "drashna.h" + +#include "lib/lib8tion/lib8tion.h" +extern led_config_t g_led_config; + +static uint32_t hypno_timer; +#if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd) +# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL +#else +# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN +#endif + +void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) { + HSV hsv = {hue, sat, val}; + if (hsv.v > rgb_matrix_config.hsv.v) { + hsv.v = rgb_matrix_config.hsv.v; + } + + switch (mode) { + case 1: // breathing + { + uint16_t time = scale16by8(g_rgb_counters.tick, speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + } + break; + } + default: // Solid Color + { + RGB rgb = hsv_to_rgb(hsv); + for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + } + break; + } + } +} + +__attribute__((weak)) void rgb_matrix_indicator_keymap(void) {} + +void matrix_scan_rgb_matrix(void) { +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && timer_elapsed32(hypno_timer) > 15000) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); + } +#endif + rgb_matrix_indicator_keymap(); +} + +void keyboard_post_init_rgb_matrix(void) { +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (userspace_config.rgb_matrix_idle_anim) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); + } +#endif +} + +bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { +#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + hypno_timer = timer_read32(); + if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); + } +#endif + switch (keycode) { + case RGB_IDL: // This allows me to use underglow as layer indication, or as normal +#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + if (record->event.pressed) { + userspace_config.rgb_matrix_idle_anim ^= 1; + dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); + eeconfig_update_user(userspace_config.raw); + if (userspace_config.rgb_matrix_idle_anim) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); + } + } +#endif + break; + } + return true; +} diff --git a/users/drashna/rgb_matrix_stuff.h b/users/drashna/rgb_matrix_stuff.h new file mode 100644 index 0000000000..35b01047b6 --- /dev/null +++ b/users/drashna/rgb_matrix_stuff.h @@ -0,0 +1,9 @@ +#pragma once +#include "quantum.h" + +bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record); +void keyboard_post_init_rgb_matrix(void); +void matrix_scan_rgb_matrix(void); + +void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index e7247f754f..06b1e3c0c4 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -2,89 +2,77 @@ #include "rgb_stuff.h" #include "eeprom.h" -#if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; bool has_initialized; void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); } -#endif // RGBLIGHT_ENABLE - -#if defined(RGB_MATRIX_ENABLE) -static uint32_t hypno_timer; -# if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd) -# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL -# else -# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN -# endif -#endif /* Custom indicators for modifiers. * This allows for certain lights to be lit up, based on what mods are active, giving some visual feedback. * This is especially useful for One Shot Mods, since it's not always obvious if they're still lit up. */ -#ifdef RGBLIGHT_ENABLE -# ifdef INDICATOR_LIGHTS +#ifdef INDICATOR_LIGHTS void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { if (userspace_config.rgb_layer_change && get_highest_layer(layer_state) == 0) { if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { -# ifdef SHFT_LED1 +# ifdef SHFT_LED1 rgblight_sethsv_at(120, 255, 255, SHFT_LED1); -# endif // SHFT_LED1 -# ifdef SHFT_LED2 +# endif // SHFT_LED1 +# ifdef SHFT_LED2 rgblight_sethsv_at(120, 255, 255, SHFT_LED2); -# endif // SHFT_LED2 +# endif // SHFT_LED2 } else { -# ifdef SHFT_LED1 +# ifdef SHFT_LED1 rgblight_sethsv_default_helper(SHFT_LED1); -# endif // SHFT_LED1 -# ifdef SHFT_LED2 +# endif // SHFT_LED1 +# ifdef SHFT_LED2 rgblight_sethsv_default_helper(SHFT_LED2); -# endif // SHFT_LED2 +# endif // SHFT_LED2 } if ((this_mod | this_osm) & MOD_MASK_CTRL) { -# ifdef CTRL_LED1 +# ifdef CTRL_LED1 rgblight_sethsv_at(0, 255, 255, CTRL_LED1); -# endif // CTRL_LED1 -# ifdef CTRL_LED2 +# endif // CTRL_LED1 +# ifdef CTRL_LED2 rgblight_sethsv_at(0, 255, 255, CTRL_LED2); -# endif // CTRL_LED2 +# endif // CTRL_LED2 } else { -# ifdef CTRL_LED1 +# ifdef CTRL_LED1 rgblight_sethsv_default_helper(CTRL_LED1); -# endif // CTRL_LED1 -# ifdef CTRL_LED2 +# endif // CTRL_LED1 +# ifdef CTRL_LED2 rgblight_sethsv_default_helper(CTRL_LED2); -# endif // CTRL_LED2 +# endif // CTRL_LED2 } if ((this_mod | this_osm) & MOD_MASK_GUI) { -# ifdef GUI_LED1 +# ifdef GUI_LED1 rgblight_sethsv_at(51, 255, 255, GUI_LED1); -# endif // GUI_LED1 -# ifdef GUI_LED2 +# endif // GUI_LED1 +# ifdef GUI_LED2 rgblight_sethsv_at(51, 255, 255, GUI_LED2); -# endif // GUI_LED2 +# endif // GUI_LED2 } else { -# ifdef GUI_LED1 +# ifdef GUI_LED1 rgblight_sethsv_default_helper(GUI_LED1); -# endif // GUI_LED1 -# ifdef GUI_LED2 +# endif // GUI_LED1 +# ifdef GUI_LED2 rgblight_sethsv_default_helper(GUI_LED2); -# endif // GUI_LED2 +# endif // GUI_LED2 } if ((this_mod | this_osm) & MOD_MASK_ALT) { -# ifdef ALT_LED1 +# ifdef ALT_LED1 rgblight_sethsv_at(240, 255, 255, ALT_LED1); -# endif // ALT_LED1 -# ifdef GUI_LED2 +# endif // ALT_LED1 +# ifdef GUI_LED2 rgblight_sethsv_at(240, 255, 255, ALT_LED2); -# endif // GUI_LED2 +# endif // GUI_LED2 } else { -# ifdef GUI_LED1 +# ifdef GUI_LED1 rgblight_sethsv_default_helper(ALT_LED1); -# endif // GUI_LED1 -# ifdef GUI_LED2 +# endif // GUI_LED1 +# ifdef GUI_LED2 rgblight_sethsv_default_helper(ALT_LED2); -# endif // GUI_LED2 +# endif // GUI_LED2 } } } @@ -95,9 +83,9 @@ void matrix_scan_indicator(void) { set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); } } -# endif // INDICATOR_LIGHTS +#endif // INDICATOR_LIGHTS -# ifdef RGBLIGHT_TWINKLE +#ifdef RGBLIGHT_TWINKLE static rgblight_fadeout lights[RGBLED_NUM]; __attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; } @@ -105,40 +93,40 @@ __attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { /* This function checks for used LEDs. This way, collisions don't occur and cause weird rendering */ bool rgblight_twinkle_is_led_used(uint8_t index) { switch (index) { -# ifdef INDICATOR_LIGHTS -# ifdef SHFT_LED1 +# ifdef INDICATOR_LIGHTS +# ifdef SHFT_LED1 case SHFT_LED1: return true; -# endif // SHFT_LED1 -# ifdef SHFT_LED2 +# endif // SHFT_LED1 +# ifdef SHFT_LED2 case SHFT_LED2: return true; -# endif // SHFT_LED2 -# ifdef CTRL_LED1 +# endif // SHFT_LED2 +# ifdef CTRL_LED1 case CTRL_LED1: return true; -# endif // CTRL_LED1 -# ifdef CTRL_LED2 +# endif // CTRL_LED1 +# ifdef CTRL_LED2 case CTRL_LED2: return true; -# endif // CTRL_LED2 -# ifdef GUI_LED1 +# endif // CTRL_LED2 +# ifdef GUI_LED1 case GUI_LED1: return true; -# endif // GUI_LED1 -# ifdef GUI_LED2 +# endif // GUI_LED1 +# ifdef GUI_LED2 case GUI_LED2: return true; -# endif // GUI_LED2 -# ifdef ALT_LED1 +# endif // GUI_LED2 +# ifdef ALT_LED1 case ALT_LED1: return true; -# endif // ALT_LED1 -# ifdef ALT_LED2 +# endif // ALT_LED1 +# ifdef ALT_LED2 case ALT_LED2: return true; -# endif // ALT_LED2 -# endif // INDICATOR_LIGHTS +# endif // ALT_LED2 +# endif // INDICATOR_LIGHTS default: return rgblight_twinkle_is_led_used_keymap(index); } @@ -213,23 +201,15 @@ void start_rgb_light(void) { rgblight_sethsv_at(light->hue, 255, light->life, light_index); } -# endif -#endif // RGBLIGHT_ENABLE +#endif -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { +bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { uint16_t temp_keycode = keycode; // Filter out the actual keycode from MT and LT keys. if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { temp_keycode &= 0xFF; } -#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - hypno_timer = timer_read32(); - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } -#endif - switch (temp_keycode) { #ifdef RGBLIGHT_TWINKLE case KC_A ... KC_SLASH: @@ -242,228 +222,19 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { start_rgb_light(); } break; -#endif // RGBLIGHT_TWINKLE - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - if (record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) - rgblight_enable_noeeprom(); -# endif - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) -# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) - } else { - rgblight_disable_noeeprom(); -# endif - } - } -#endif // RGBLIGHT_ENABLE - break; - case RGB_IDL: // This allows me to use underglow as layer indication, or as normal -#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (record->event.pressed) { - userspace_config.rgb_matrix_idle_anim ^= 1; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } - } -#endif - break; -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - case RGB_TOG: - // Split keyboards need to trigger on key-up for edge-case issue -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_toggle(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_toggle(); -# endif - } - return false; - break; - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { - bool is_eeprom_updated; -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled - if (userspace_config.rgb_layer_change) { - userspace_config.rgb_layer_change = false; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - is_eeprom_updated = true; - } -# endif -# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - userspace_config.rgb_matrix_idle_anim = false; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - is_eeprom_updated = true; - } -# endif - if (is_eeprom_updated) { - eeconfig_update_user(userspace_config.raw); - } - } - -# if defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES) - if (keycode == RGB_MODE_FORWARD && record->event.pressed) { - uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); - if (shifted) { -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_step_reverse(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_step_reverse(); -# endif - } else { -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_step(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_step(); -# endif - } - } else if (keycode == RGB_MODE_REVERSE && record->event.pressed) { - uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); - if (shifted) { -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_step(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_step(); -# endif - } else { -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_step_reverse(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_step_reverse(); -# endif - } - } else if (keycode == RGB_HUI) { -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_increase_hue(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_increase_hue(); -# endif - } - } else if (keycode == RGB_HUD) { -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_decrease_hue(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_decrease_hue(); -# endif - } - } else if (keycode == RGB_SAI) { -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_increase_sat(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_increase_sat(); -# endif - } - } else if (keycode == RGB_SAD) { -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_decrease_sat(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_decrease_sat(); -# endif - } - } else if (keycode == RGB_VAI) { -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_increase_val(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_increase_val(); -# endif - } - } else if (keycode == RGB_VAD) { -# ifndef SPLIT_KEYBOARD - if (record->event.pressed) { -# else - if (!record->event.pressed) { -# endif -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_decrease_val(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_decrease_val(); -# endif - } - } else if (keycode == RGB_SPI) { - if (record->event.pressed) { -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_increase_speed(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_increase_speed(); -# endif - } - } else if (keycode == RGB_SPD) { - if (record->event.pressed) { -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) - rgblight_decrease_speed(); -# endif -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_decrease_speed(); -# endif - } - } - return false; -# endif -#endif - - break; +#endif // RGBLIGHT_TWINKLE } return true; } -void keyboard_post_init_rgb(void) { -#if defined(RGBLIGHT_ENABLE) -# if defined(RGBLIGHT_STARTUP_ANIMATION) +void keyboard_post_init_rgb_light(void) { +#if defined(RGBLIGHT_STARTUP_ANIMATION) bool is_enabled = rgblight_config.enable; if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } if (rgblight_config.enable) { - layer_state_set_user(layer_state); + layer_state_set_rgb_light(layer_state); uint16_t old_hue = rgblight_config.hue; rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); for (uint16_t i = 255; i > 0; i--) { @@ -476,17 +247,11 @@ void keyboard_post_init_rgb(void) { rgblight_disable_noeeprom(); } -# endif - layer_state_set_user(layer_state); -#endif -#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } #endif + layer_state_set_rgb_light(layer_state); } -void matrix_scan_rgb(void) { +void matrix_scan_rgb_light(void) { #ifdef RGBLIGHT_ENABLE # ifdef RGBLIGHT_TWINKLE scan_rgblight_fadeout(); @@ -496,23 +261,15 @@ void matrix_scan_rgb(void) { matrix_scan_indicator(); # endif #endif - -#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && timer_elapsed32(hypno_timer) > 15000) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -#endif } -#ifdef RGBLIGHT_ENABLE void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { rgblight_sethsv_noeeprom(hue, sat, val); wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly rgblight_mode_noeeprom(mode); } -#endif -layer_state_t layer_state_set_rgb(layer_state_t state) { +layer_state_t layer_state_set_rgb_light(layer_state_t state) { #ifdef RGBLIGHT_ENABLE if (userspace_config.rgb_layer_change) { switch (get_highest_layer(state)) { @@ -574,40 +331,3 @@ layer_state_t layer_state_set_rgb(layer_state_t state) { return state; } - -#ifdef RGB_MATRIX_ENABLE -# include "lib/lib8tion/lib8tion.h" -extern led_config_t g_led_config; - -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) { - HSV hsv = {hue, sat, val}; - if (hsv.v > rgb_matrix_config.hsv.v) { - hsv.v = rgb_matrix_config.hsv.v; - } - - switch (mode) { - case 1: // breathing - { - uint16_t time = scale16by8(g_rgb_counters.tick, speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - default: // Solid Color - { - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - } -} -#endif diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 50b73c1c3c..98a552db1b 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -1,10 +1,7 @@ #pragma once #include "quantum.h" -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix.h" -#endif -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE) +#if defined(RGBLIGHT_TWINKLE) typedef struct { bool enabled; uint8_t hue; @@ -13,20 +10,13 @@ typedef struct { } rgblight_fadeout; #endif -bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb(void); -void matrix_scan_rgb(void); -layer_state_t layer_state_set_rgb(layer_state_t state); -layer_state_t default_layer_state_set_rgb(layer_state_t state); +bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record); +void keyboard_post_init_rgb_light(void); +void matrix_scan_rgb_light(void); +layer_state_t layer_state_set_rgb_light(layer_state_t state); +layer_state_t default_layer_state_set_rgb_light(layer_state_t state); +void rgblight_sethsv_default_helper(uint8_t index); -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE) +#if defined(RGBLIGHT_TWINKLE) void scan_rgblight_fadeout(void); #endif -#if defined(RGBLIGHT_ENABLE) -void rgblight_sethsv_default_helper(uint8_t index); -#endif - -#ifdef RGB_MATRIX_ENABLE -void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); -#endif diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 4d55da803f..051368ff5e 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -2,9 +2,10 @@ SRC += drashna.c \ process_records.c ifneq ($(PLATFORM),CHIBIOS) - LTO_ENABLE = yes + LTO_ENABLE = yes endif SPACE_CADET_ENABLE = no +GRAVE_ESC_ENABLE = no ifneq ($(strip $(NO_SECRETS)), yes) ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") @@ -19,10 +20,6 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) SRC += tap_dances.c endif - - - - ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) SRC += rgb_stuff.c ifeq ($(strip $(INDICATOR_LIGHTS)), yes) @@ -41,7 +38,7 @@ endif RGB_MATRIX_ENABLE ?= no ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) - SRC += rgb_stuff.c + SRC += rgb_matrix_stuff.c endif @@ -61,3 +58,7 @@ endif ifeq ($(strip $(PROTOCOL)), VUSB) NKRO_ENABLE = no endif + +ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) + SRC += oled_stuff.c +endif |