From d41961c9eddb78591d3b55ea65e6e0baff4bdd69 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Jul 2019 20:22:33 -0700 Subject: [Keymap] Drashna's Feature madness (#6128) * Fix my Tap Dance issues after I broke them * Cleanup and organization of userspace documentation As well as some additional cleanup of functions due to review of documentation. * Enable Tapdance on Glow and remove more animations * Revert to Eager PR debouncing * Add better check for startup animation * Move where RGB Matrix defines are listed * Limit RGB Matrix max val * Update keyboard for Iris Rev 3 conflicts * Enable encoder support on planck ez * Remove is_master check from corne\'s OLED code * Overhaul OLED screens for my Corne * One last removal * Show RGB valu On both sides * Updates for OLED display info * Fix compile issues for rgb config * Disabled Space Cadet for all drashna keymaps * Fix OLED Screen configs * Minor OLED Tweaks * Revert some Iris changes * Fix song include * Handle MAKE macro for the Corne boards better * Add super hacky-hack for eeconfig initialization * Add audio support for Fractal since Elite Cs support it * Add defines for keycode steps * Add White layout * Update Corne RGB info * Add fun effects to layer indication for RGB Matrix enabled boards * Use proper define for product name detection * Update formatting * Use custom timeout mechanism for OLED timeout * Fix up OLED screen HSV code for new HSV structure * Better handle turning off RGB Matrix when sleeping * Disable MultiSplash Animation * Change Iris back to using serial * Why was RGB disabled?!?!?! * Limit val in rgb_matrix_layer_helper function * Remove EECONFIG setting for RGB matrix --- users/drashna/rgb_stuff.c | 302 ++++++++++++++++++++++++++-------------------- 1 file changed, 168 insertions(+), 134 deletions(-) (limited to 'users/drashna/rgb_stuff.c') diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 7d364fa68..12851e261 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -4,77 +4,75 @@ #if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; -bool has_initialized; +bool has_initialized; #endif #ifdef RGBLIGHT_ENABLE -void rgblight_sethsv_default_helper(uint8_t index) { - rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); -} -#endif // RGBLIGHT_ENABLE +void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); } +#endif // RGBLIGHT_ENABLE #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 && biton32(layer_state) == 0) { - if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1< 10) { - rgblight_fadeout *light = &lights[light_index]; - litup = true; + rgblight_fadeout *light = &lights[light_index]; + litup = true; - if (light->life) { - light->life -= 1; - if (biton32(layer_state) == 0) { - sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); - } - light->timer = timer_read(); - } - else { - if (light->enabled && biton32(layer_state) == 0) { - rgblight_sethsv_default_helper(light_index); + if (light->life) { + light->life -= 1; + if (biton32(layer_state) == 0) { + sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); + } + light->timer = timer_read(); + } else { + if (light->enabled && biton32(layer_state) == 0) { + rgblight_sethsv_default_helper(light_index); + } + litup = light->enabled = false; } - litup = light->enabled = false; - } } } if (litup && biton32(layer_state) == 0) { @@ -161,39 +157,37 @@ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgb } void start_rgb_light(void) { - uint8_t indices[RGBLED_NUM]; - uint8_t indices_count = 0; - uint8_t min_life = 0xFF; + uint8_t indices_count = 0; + uint8_t min_life = 0xFF; uint8_t min_life_index = -1; - for (uint8_t index = 0 ; index < RGBLED_NUM ; ++index ) { - if (rgblight_twinkle_is_led_used(index)) { continue; } - if (lights[index].enabled) { - if (min_life_index == -1 || - lights[index].life < min_life) - { - min_life = lights[index].life; - min_life_index = index; + for (uint8_t index = 0; index < RGBLED_NUM; ++index) { + if (rgblight_twinkle_is_led_used(index)) { + continue; + } + if (lights[index].enabled) { + if (min_life_index == -1 || lights[index].life < min_life) { + min_life = lights[index].life; + min_life_index = index; + } + continue; } - continue; - } - indices[indices_count] = index; - ++indices_count; + indices[indices_count] = index; + ++indices_count; } uint8_t light_index; if (!indices_count) { light_index = min_life_index; - } - else { - light_index = indices[rand() % indices_count]; + } else { + light_index = indices[rand() % indices_count]; } rgblight_fadeout *light = &lights[light_index]; - light->enabled = true; - light->timer = timer_read(); - light->life = 0xC0 + rand() % 0x40; + light->enabled = true; + light->timer = timer_read(); + light->life = 0xC0 + rand() % 0x40; light->hue = rgblight_config.hue + (rand() % 0xB4) - 0x54; @@ -201,7 +195,6 @@ void start_rgb_light(void) { } #endif - bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; @@ -214,9 +207,12 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { case KC_KP_SLASH ... KC_KP_DOT: case KC_F13 ... KC_F24: case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: - if (record->event.pressed) { start_rgb_light(); } - return true; break; -#endif // RGBLIGHT_TWINKLE + if (record->event.pressed) { + start_rgb_light(); + } + return true; + 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) { @@ -224,41 +220,48 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); eeconfig_update_user(userspace_config.raw); if (userspace_config.rgb_layer_change) { - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) + layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) } } -#endif // RGBLIGHT_ENABLE - return false; break; +#endif // RGBLIGHT_ENABLE + return false; + break; #ifdef RGBLIGHT_ENABLE - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions + if (record->event.pressed) { // 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; xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); eeconfig_update_user(userspace_config.raw); } } - return true; break; -#endif // RGBLIGHT_ENABLE - } + return true; + break; +#endif // RGBLIGHT_ENABLE + } return true; } - - void keyboard_post_init_rgb(void) { #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) - if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } + 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); uint16_t old_hue = rgblight_config.hue; rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); + rgblight_sethsv_noeeprom((i + old_hue) % 255, 255, 255); matrix_scan(); wait_ms(10); } } + if (!is_enabled) { + rgblight_disable_noeeprom(); + } + #endif layer_state_set_user(layer_state); } @@ -266,15 +269,13 @@ void keyboard_post_init_rgb(void) { void matrix_scan_rgb(void) { #ifdef RGBLIGHT_TWINKLE scan_rgblight_fadeout(); -#endif // RGBLIGHT_ENABLE +#endif // RGBLIGHT_ENABLE #ifdef INDICATOR_LIGHTS matrix_scan_indicator(); #endif - } - layer_state_t layer_state_set_rgb(layer_state_t state) { #ifdef RGBLIGHT_ENABLE if (userspace_config.rgb_layer_change) { @@ -307,40 +308,73 @@ layer_state_t layer_state_set_rgb(layer_state_t state) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); break; - default: // for any other layers, or the default layer + default: // for any other layers, or the default layer switch (biton32(default_layer_state)) { case _COLEMAK: - rgblight_sethsv_noeeprom_magenta(); break; + rgblight_sethsv_noeeprom_magenta(); + break; case _DVORAK: - rgblight_sethsv_noeeprom_springgreen(); break; + rgblight_sethsv_noeeprom_springgreen(); + break; case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); break; + rgblight_sethsv_noeeprom_goldenrod(); + break; case _NORMAN: - rgblight_sethsv_noeeprom_coral(); break; + rgblight_sethsv_noeeprom_coral(); + break; case _MALTRON: - rgblight_sethsv_noeeprom_yellow(); break; + rgblight_sethsv_noeeprom_yellow(); + break; case _EUCALYN: - rgblight_sethsv_noeeprom_pink(); break; + rgblight_sethsv_noeeprom_pink(); + break; case _CARPLAX: - rgblight_sethsv_noeeprom_blue(); break; + rgblight_sethsv_noeeprom_blue(); + break; default: - rgblight_sethsv_noeeprom_cyan(); break; + rgblight_sethsv_noeeprom_cyan(); + break; } - biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it + biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it break; } } -#endif // RGBLIGHT_ENABLE +#endif // RGBLIGHT_ENABLE 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 red, uint8_t green, uint8_t blue, uint8_t led_type) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color( i, red, green, 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) { + 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; } } } -- cgit v1.2.3-70-g09d2 From e88f80a891138d40acddcdd2b3dface8b2a57404 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 7 Sep 2019 08:57:30 -0700 Subject: [Keymap] Big Drashna code update (#6639) * Add a quefrency keymap * New Alt-ernate layouts * Enable Per Key Tapping Term to preserve sanity * Use underglow and mod lights for status on Corne * Update the drashna_ms keymap for quefrency * Disable Audio since there isn't enough space * Update KC_MAKE to ues :flash target * Cleanup ergodox layout * Enable i2c support for Iris * Add keymap support for CG_SWAP * Enable RGB Matrix Shutdown mode * enable heatmap * Update gitlab CI to install python3 * Remove game macros These are no longer needed, and haven't been used in ages * Cleanup planck layout * Add RGB Matrix fun and RGB cleanup * Add keycode and config for RGB Matrix idle animations * Clean up rgb idle animation code * Add rgb idle keycode to keymaps * Fix issues with rgb matrix idle animation * Fix some handling for idle animation * Reduce idle animation timeout to 15s to be more reasonable * fix up rgb stuff * Fix isses with rgb functions not being called for matrix * Use custom EEPROM Magic Number so testing is easier * Extend Default Layer macro to support a lot more layers * Fix bjohnson macropad * Adjust KC_MAKE to process mods for more consistent behavior * Fix up rgb stuff on corne * Corne OLED Overhaul * Fixes a number of issues with weirdness. * Fixes issues with keylogger (should be more reliable now) * Modulaize the OLED render sections * Rewrite layer display code * Update URL for Font Editor Due to odd issues, I ended up rewriting from scratch. And using PROGMEM versions, since I think I was getting memory overflows. * Update polling rate on all keebs * Fix planck ez layout config * Remove macros from Viterbi --- keyboards/crkbd/keymaps/drashna/glcdfont.c | 4 +- keyboards/crkbd/keymaps/drashna/keymap.c | 305 ++++++++++----------- keyboards/gergo/keymaps/drashna/keymap.c | 2 +- keyboards/keebio/iris/keymaps/drashna/config.h | 4 +- keyboards/keebio/iris/keymaps/drashna/keymap.c | 2 +- keyboards/keebio/iris/keymaps/drashna/rules.mk | 3 +- .../keebio/quefrency/keymaps/drashna_ms/config.h | 39 +++ .../keebio/quefrency/keymaps/drashna_ms/keymap.c | 43 +++ .../keebio/quefrency/keymaps/drashna_ms/rules.mk | 5 + keyboards/keebio/viterbi/keymaps/drashna/keymap.c | 14 +- keyboards/keebio/viterbi/keymaps/drashna/rules.mk | 1 - keyboards/orthodox/keymaps/drashna/keymap.c | 2 +- keyboards/orthodox/keymaps/drashna/rules.mk | 1 - layouts/community/ergodox/drashna/config.h | 2 + layouts/community/ergodox/drashna/keymap.c | 21 +- layouts/community/ergodox/drashna/rules.mk | 1 - layouts/community/numpad_5x6/bjohnson/config.h | 2 +- layouts/community/numpad_5x6/bjohnson/keymap.c | 7 +- layouts/community/numpad_5x6/drashna/rules.mk | 1 - layouts/community/ortho_4x12/drashna/config.h | 1 + layouts/community/ortho_4x12/drashna/keymap.c | 42 ++- layouts/community/ortho_4x12/drashna/rules.mk | 3 - layouts/community/ortho_5x12/drashna/keymap.c | 7 +- layouts/community/ortho_5x12/drashna/rules.mk | 3 - users/drashna/.gitlab-ci.yml | 2 +- users/drashna/config.h | 6 + users/drashna/drashna.c | 37 +-- users/drashna/drashna.h | 16 +- users/drashna/process_records.c | 63 +---- users/drashna/process_records.h | 17 +- users/drashna/rgb_stuff.c | 97 +++++-- users/drashna/rgb_stuff.h | 13 +- users/drashna/rules.mk | 4 - users/drashna/wrappers.h | 4 +- 34 files changed, 423 insertions(+), 351 deletions(-) create mode 100644 keyboards/keebio/quefrency/keymaps/drashna_ms/config.h create mode 100644 keyboards/keebio/quefrency/keymaps/drashna_ms/keymap.c create mode 100644 keyboards/keebio/quefrency/keymaps/drashna_ms/rules.mk (limited to 'users/drashna/rgb_stuff.c') diff --git a/keyboards/crkbd/keymaps/drashna/glcdfont.c b/keyboards/crkbd/keymaps/drashna/glcdfont.c index 28521b428..998b5c408 100644 --- a/keyboards/crkbd/keymaps/drashna/glcdfont.c +++ b/keyboards/crkbd/keymaps/drashna/glcdfont.c @@ -9,8 +9,8 @@ #define PROGMEM #endif -// Helidox 8x6 font with QMK Firmware Logo -// Online editor: http://teripom.x0.com/ +// Corne 8x6 font with QMK Firmware Logo +// Online editor: https://helixfonteditor.netlify.com/ const unsigned char font[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 693c53b16..36a5f5dd3 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -8,6 +8,14 @@ extern uint8_t is_master; // Following line allows macro to read current RGB settings extern rgblight_config_t rgblight_config; #endif +#ifdef OLED_DRIVER_ENABLE +static uint32_t oled_timer = 0; +static char keylog_str[6] = {}; +static uint16_t log_timer = 0; +static const char code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; + +void add_keylog(uint16_t keycode); +#endif enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; @@ -19,7 +27,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ - KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ ) @@ -98,34 +106,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_wrapper( \ KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, - _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, + MG_NKRO, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, _______, KC_NUKE, _______, _______, TG_MODS, _______ ) }; // clang-format on +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { #ifdef OLED_DRIVER_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } -uint16_t oled_timer; - -char keylog_str[5] = {}; -uint8_t keylogs_str_idx = 0; -uint16_t log_timer = 0; + oled_timer = timer_read32(); + add_keylog(keycode); +#endif +#ifndef SPLIT_KEYBOARD + if (keycode == RESET && !is_master) { + return false; + } +#endif + } + return true; +} -const char code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } 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 = keycode & 0xFF; } - for (uint8_t i = 4; i > 0; i--) { + for (uint8_t i = 4; i > 0; --i) { keylog_str[i] = keylog_str[i - 1]; } + if (keycode < 60) { keylog_str[0] = code_to_name[keycode]; } - keylog_str[5] = 0; log_timer = timer_read(); } @@ -136,149 +152,118 @@ void update_log(void) { } } -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - add_keylog(keycode); - oled_timer = timer_read(); - } - return true; -} - -void render_rgb_status(void) { - oled_write_ln("RGB:", false); - static char temp[20] = {0}; - snprintf(temp, sizeof(temp) + 1, "M:%3dH:%3dS:%3dV:%3d", rgb_matrix_config.mode, rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); - oled_write(temp, false); +void render_keylogger_status(void) { + oled_write_P(PSTR("KLogr"), false); + oled_write(keylog_str, false); } -void render_status_main(void) { - /* Show Keyboard Layout */ - oled_write("Lyout", false); +void render_default_layer_state(void) { + oled_write_P(PSTR("Lyout"), false); switch (biton32(default_layer_state)) { case _QWERTY: - oled_write(" QRTY", false); + oled_write_P(PSTR(" QRTY"), false); break; case _COLEMAK: - oled_write(" COLE", false); + oled_write_P(PSTR(" COLE"), false); break; case _DVORAK: - oled_write(" DVRK", false); + oled_write_P(PSTR(" DVRK"), false); break; case _WORKMAN: - oled_write(" WKMN", false); + oled_write_P(PSTR(" WKMN"), false); break; case _NORMAN: - oled_write(" NORM", false); + oled_write_P(PSTR(" NORM"), false); break; case _MALTRON: - oled_write(" MLTN", false); + oled_write_P(PSTR(" MLTN"), false); break; case _EUCALYN: - oled_write(" ECLN", false); + oled_write_P(PSTR(" ECLN"), false); break; case _CARPLAX: - oled_write(" CRPX", false); + oled_write_P(PSTR(" CRPX"), false); break; } +} - /* Show Lock Status (only work on master side) */ - uint8_t led_usb_state = host_keyboard_leds(); - oled_write("Lock:", false); - oled_write(" ", false); - oled_write_ln("NUM", led_usb_state & (1 << USB_LED_NUM_LOCK)); - oled_write(" ", false); - oled_write("CAPS", led_usb_state & (1 << USB_LED_CAPS_LOCK)); - oled_write(" ", false); - oled_write("SCRL", led_usb_state & (1 << USB_LED_SCROLL_LOCK)); - - /* Show Alt-Gui Swap options */ - oled_write("BTMGK", false); - oled_write(" ", false); - oled_write_ln("Win", !keymap_config.swap_lalt_lgui); - oled_write(" ", false); - oled_write_ln("Mac", keymap_config.swap_lalt_lgui); - -# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - /* Show RGB Options */ - render_rgb_status(); -# endif +void render_layer_state(void) { + oled_write_P(PSTR("LAYER"), false); + oled_write_P(PSTR("Lower"), layer_state_is(_LOWER)); + oled_write_P(PSTR("Raise"), layer_state_is(_RAISE)); + oled_write_P(PSTR(" Mods"), layer_state_is(_MODS)); +} - oled_write(keylog_str, false); +void render_keylock_status(uint8_t led_usb_state) { + oled_write_P(PSTR("Lock:"), false); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("NUM "), led_usb_state & (1 << USB_LED_NUM_LOCK)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("CAPS"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("SCRL"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); } -void render_status_secondary(void) { +void render_mod_status(uint8_t modifiers) { + oled_write_P(PSTR("Mods:"), false); + oled_write_P(PSTR(" SHFT"), (modifiers & MOD_MASK_SHIFT)); + oled_write_P(PSTR(" CTRL"), (modifiers & MOD_MASK_CTRL)); + oled_write_P(PSTR(" ALT "), (modifiers & MOD_MASK_ALT)); + oled_write_P(PSTR(" 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("BTMGK"), false); + oled_write_P(PSTR(" "), false); + oled_write_P(logo[0][0], !keymap_config.swap_lctl_lgui); + oled_write_P(logo[1][0], keymap_config.swap_lctl_lgui); + oled_write_P(PSTR(" "), false); + oled_write_P(logo[0][1], !keymap_config.swap_lctl_lgui); + oled_write_P(logo[1][1], keymap_config.swap_lctl_lgui); + oled_write_P(PSTR(" NKRO"), keymap_config.nkro); +} + +void render_user_status(void) { + oled_write_P(PSTR("USER:"), false); + oled_write_P(PSTR(" Anim"), userspace_config.rgb_matrix_idle_anim); + oled_write_P(PSTR(" Layr"), userspace_config.rgb_layer_change); + oled_write_P(PSTR(" Nuke"), userspace_config.nuke_switch); +} + +void render_status_main(void) { /* Show Keyboard Layout */ - oled_write("Lyout", false); - switch (biton32(default_layer_state)) { - case _QWERTY: - oled_write(" QRTY", false); - break; - case _COLEMAK: - oled_write(" COLE", false); - break; - case _DVORAK: - oled_write(" DVRK", false); - break; - case _WORKMAN: - oled_write(" WKMN", false); - break; - case _NORMAN: - oled_write(" NORM", false); - break; - case _MALTRON: - oled_write(" MLTN", false); - break; - case _EUCALYN: - oled_write(" ECLN", false); - break; - case _CARPLAX: - oled_write(" CRPX", false); - break; - } + render_default_layer_state(); + render_keylock_status(host_keyboard_leds()); + render_bootmagic_status(); + render_user_status(); - /* Show Activate layer */ - oled_write("Layer", false); - switch (biton32(layer_state)) { - case _RAISE: - oled_write("Raise", false); - break; - case _LOWER: - oled_write("Lower", false); - break; - case _ADJUST: - oled_write("Adjst", false); - break; - default: - oled_write("Dflt ", false); - break; - } + render_keylogger_status(); +} - /* Show Mod */ - uint8_t modifiers = get_mods() | get_oneshot_mods(); - - oled_write("Mods:", false); - oled_write(" ", false); - oled_write_ln("SFT", (modifiers & MOD_MASK_SHIFT)); - oled_write(" ", false); - oled_write_ln("CTL", (modifiers & MOD_MASK_CTRL)); - oled_write(" ", false); - oled_write_ln("ALT", (modifiers & MOD_MASK_ALT)); - oled_write(" ", false); - oled_write_ln("GUI", (modifiers & MOD_MASK_GUI)); - -# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - render_rgb_status(); -# endif +void render_status_secondary(void) { + /* Show Keyboard Layout */ + render_default_layer_state(); + render_layer_state(); + render_mod_status(get_mods()|get_oneshot_mods()); - /* Show logged Keys */ - oled_write(keylog_str, false); + render_keylogger_status(); } void oled_task_user(void) { - if (timer_elapsed(oled_timer) > 60000) { + 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 { @@ -286,7 +271,6 @@ void oled_task_user(void) { } } -void matrix_scan_keymap(void) { update_log(); } #endif uint16_t get_tapping_term(uint16_t keycode) { @@ -300,25 +284,43 @@ uint16_t get_tapping_term(uint16_t keycode) { #ifdef RGB_MATRIX_ENABLE -static bool is_suspended; -static bool rgb_matrix_enabled; - void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); - if (!is_suspended) { - is_suspended = true; - rgb_matrix_enabled = (bool)rgb_matrix_config.enable; - rgb_matrix_disable_noeeprom(); - } } void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); - is_suspended = false; - if (rgb_matrix_enabled) { - rgb_matrix_enable_noeeprom(); +} + +void check_default_layer(uint8_t mode, uint8_t type) { + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type); + break; + case _COLEMAK: + rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type); + break; + case _DVORAK: + rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type); + break; + case _WORKMAN: + rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type); + break; + case _NORMAN: + rgb_matrix_layer_helper(HSV_CORAL, mode, rgb_matrix_config.speed, type); + break; + case _MALTRON: + rgb_matrix_layer_helper(HSV_YELLOW, mode, rgb_matrix_config.speed, type); + break; + case _EUCALYN: + rgb_matrix_layer_helper(HSV_PINK, mode, rgb_matrix_config.speed, type); + break; + case _CARPLAX: + rgb_matrix_layer_helper(HSV_BLUE, mode, rgb_matrix_config.speed, type); + break; } } + void rgb_matrix_indicators_user(void) { if (userspace_config.rgb_layer_change && # ifdef RGB_DISABLE_WHEN_USB_SUSPENDED @@ -332,51 +334,26 @@ void rgb_matrix_indicators_user(void) { ) { switch (biton32(layer_state)) { case _GAMEPAD: - rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); break; case _DIABLO: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); break; case _RAISE: - rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); break; case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); break; case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); + rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); break; default: { - bool mods_enabled = IS_LAYER_ON(_MODS); - switch (biton32(default_layer_state)) { - case _QWERTY: - rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _COLEMAK: - rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _DVORAK: - rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _WORKMAN: - rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _NORMAN: - rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _MALTRON: - rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _EUCALYN: - rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - case _CARPLAX: - rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); - break; - } + check_default_layer(IS_LAYER_ON(_MODS), LED_FLAG_UNDERGLOW); break; } } + check_default_layer(0, LED_FLAG_MODIFIER); } } #endif diff --git a/keyboards/gergo/keymaps/drashna/keymap.c b/keyboards/gergo/keymaps/drashna/keymap.c index 2843b332a..edc5a9e99 100644 --- a/keyboards/gergo/keymaps/drashna/keymap.c +++ b/keyboards/gergo/keymaps/drashna/keymap.c @@ -17,7 +17,7 @@ ) \ LAYOUT_gergo_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ - KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ KC_GRV, KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT, _______ \ ) diff --git a/keyboards/keebio/iris/keymaps/drashna/config.h b/keyboards/keebio/iris/keymaps/drashna/config.h index ee8ac8aff..6fff5d72c 100644 --- a/keyboards/keebio/iris/keymaps/drashna/config.h +++ b/keyboards/keebio/iris/keymaps/drashna/config.h @@ -19,8 +19,8 @@ along with this program. If not, see . /* Use I2C or Serial, not both */ -#define USE_SERIAL -// #define USE_I2C +// #define USE_SERIAL +#define USE_I2C /* Select hand configuration */ diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index fe10cb275..28783dd8a 100644 --- a/keyboards/keebio/iris/keymaps/drashna/keymap.c +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c @@ -11,7 +11,7 @@ LAYOUT_wrapper( \ KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ KC_GRV, KC_SPC, LT(_LOWER,KC_BSPC), LT(_RAISE,KC_DEL), KC_ENT, RAISE \ ) diff --git a/keyboards/keebio/iris/keymaps/drashna/rules.mk b/keyboards/keebio/iris/keymaps/drashna/rules.mk index 17acd32be..cb398cd4e 100644 --- a/keyboards/keebio/iris/keymaps/drashna/rules.mk +++ b/keyboards/keebio/iris/keymaps/drashna/rules.mk @@ -5,14 +5,13 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes +AUDIO_ENABLE = no NKRO_ENABLE = yes BACKLIGHT_ENABLE = no SWAP_HANDS_ENABLE = no SPACE_CADET_ENABLE = no INDICATOR_LIGHTS = no -MACROS_ENABLED = no RGBLIGHT_TWINKLE = no RGBLIGHT_STARTUP_ANIMATION = no diff --git a/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h b/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h new file mode 100644 index 000000000..ec2a2ea16 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h @@ -0,0 +1,39 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +// #define USE_I2C +#define EE_HANDS + + +#ifdef RGBLIGHT_ENABLE + #define RGBLIGHT_SPLIT + #undef RGBLED_NUM + #define RGBLED_NUM 17 + #define RGBLED_SPLIT { 9, 8 } + #define RGBLIGHT_SLEEP +#endif + +#ifdef AUDIO_ENABLE + #define B7_AUDIO + #define AUDIO_CLICKY +#endif diff --git a/keyboards/keebio/quefrency/keymaps/drashna_ms/keymap.c b/keyboards/keebio/quefrency/keymaps/drashna_ms/keymap.c new file mode 100644 index 000000000..445709bc3 --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/drashna_ms/keymap.c @@ -0,0 +1,43 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +enum layers { + _BASE, + _FN1, +}; + +enum custom_keycodes { + KC_MAKE = SAFE_RANGE, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65_with_macro( + KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_HOME, \ + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1), KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT_65_with_macro( + _______, _______, KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC, RESET, \ + _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP ":dfu" SS_TAP(X_ENTER)), 10); + + break; + } + return true; +} diff --git a/keyboards/keebio/quefrency/keymaps/drashna_ms/rules.mk b/keyboards/keebio/quefrency/keymaps/drashna_ms/rules.mk new file mode 100644 index 000000000..1b8b582ab --- /dev/null +++ b/keyboards/keebio/quefrency/keymaps/drashna_ms/rules.mk @@ -0,0 +1,5 @@ +LINK_TIME_OPTIMIZATION_ENABLE = yes +RGBLIGHT_ENABLE = yes +EXTRAKEY_ENABLE = yes +AUDIO_ENABLE = yes +BOOTLOADER = qmk-dfu diff --git a/keyboards/keebio/viterbi/keymaps/drashna/keymap.c b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c index 1afc59fb9..9c17c5a57 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c @@ -10,7 +10,6 @@ extern keymap_config_t keymap_config; // Fillers to make layering more clear -#define LMACRO OSL(_MACROS) #define DIABLO TG(_DIABLO) #define GAMEPAD TG(_GAMEPAD) #define MEDIA TT(_MEDIA) @@ -23,7 +22,7 @@ extern keymap_config_t keymap_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMLOCK] = LAYOUT_ortho_5x7( - LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, + KC_NO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, MEDIA, KC_CALC, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PAST, KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, @@ -39,22 +38,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_GAMEPAD] = LAYOUT_ortho_5x7( // Game pad layout designed primarily for Overwatch - LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, + KC_NO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V ), - [_MACROS] = LAYOUT_ortho_5x7( - LMACRO, KC_OVERWATCH,GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_C9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_SYMM, KC_TORB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_GLHF, KC_GOODGAME, KC_GGEZ, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_SALT, KC_MORESALT, KC_SALTHARD, KC_JUSTGAME, KC_AIM, XXXXXXX, KC_PENT - ), - - [_MEDIA] = LAYOUT_ortho_5x7( KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, MEDIA, EEP_RST, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, diff --git a/keyboards/keebio/viterbi/keymaps/drashna/rules.mk b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk index f42e065d5..3246c1807 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/rules.mk +++ b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk @@ -11,7 +11,6 @@ SPLIT_KEYBOARD = no SPACE_CADET_ENABLE = no NO_SECRETS = yes -MACROS_ENABLED = yes INDICATOR_LIGHTS = no RGBLIGHT_TWINKLE = no LAYOUTS = ortho_5x7 diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 56799ae2c..bf6b62b41 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -38,7 +38,7 @@ uint8_t last_osm; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF \ ) #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index a122b9e0f..0d28c44a7 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -10,7 +10,6 @@ NKRO_ENABLE = yes SPACE_CADET_ENABLE = no INDICATOR_LIGHTS = yes -MACROS_ENABLED = no RGBLIGHT_TWINKLE = no RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 821710ed8..0ccf10c31 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -14,3 +14,5 @@ #undef DEBOUNCE #define DEBOUNCE 15 + +#define TAPPING_TERM_PER_KEY diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 763b218f7..6ed4558e2 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -23,8 +23,9 @@ along with this program. If not, see . #ifndef UNICODE_ENABLE # define UC(x) KC_NO #endif - -extern userspace_config_t userspace_config; +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; +#endif enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; @@ -40,7 +41,7 @@ bool skip_leds = false; LAYOUT_ergodox_pretty_wrapper( \ KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ @@ -291,8 +292,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), - _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, + _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, TG(_MODS), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -464,3 +465,13 @@ void rgb_matrix_indicators_user(void) { } #endif // RGB_MATRIX_INIT + + +uint16_t get_tapping_term(uint16_t keycode) { + if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { + if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { + return (2 * TAPPING_TERM); + } + } + return TAPPING_TERM; +} diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index f3cd55ea8..f14353f4c 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -12,7 +12,6 @@ BOOTMAGIC_ENABLE = yes UNICODE_ENABLE = yes UNICDOEMAP_ENABLE = no -MACROS_ENABLED = no RGBLIGHT_TWINKLE = no INDICATOR_LIGHTS = no RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/numpad_5x6/bjohnson/config.h b/layouts/community/numpad_5x6/bjohnson/config.h index fe2cffec7..668450d88 100644 --- a/layouts/community/numpad_5x6/bjohnson/config.h +++ b/layouts/community/numpad_5x6/bjohnson/config.h @@ -4,7 +4,7 @@ #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) #define RGB_DI_PIN B7 -#define RGBLED_NUM 16 // Number of LEDs +#define RGBLED_NUM 13 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 12 diff --git a/layouts/community/numpad_5x6/bjohnson/keymap.c b/layouts/community/numpad_5x6/bjohnson/keymap.c index 79e87e69f..4b15ccdfb 100644 --- a/layouts/community/numpad_5x6/bjohnson/keymap.c +++ b/layouts/community/numpad_5x6/bjohnson/keymap.c @@ -25,9 +25,10 @@ void keyboard_post_init_user(void) { uint8_t temp_mode = rgblight_config.mode; rgblight_enable_noeeprom(); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 360; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + 180) % 360, 255, 255); - wait_ms(8); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + 128) % 255, 255, 255); + matrix_scan(); + wait_ms(10); } led_set_user(host_keyboard_leds()); rgblight_mode_noeeprom(temp_mode); diff --git a/layouts/community/numpad_5x6/drashna/rules.mk b/layouts/community/numpad_5x6/drashna/rules.mk index 62bbc365d..0bdf97bae 100644 --- a/layouts/community/numpad_5x6/drashna/rules.mk +++ b/layouts/community/numpad_5x6/drashna/rules.mk @@ -5,6 +5,5 @@ NO_SECRETS = yes BOOTMAGIC_ENABLE = lite INDICATOR_LIGHTS = no RGBLIGHT_TWINKLE = yes -MACROS_ENABLED = no MAKE_BOOTLOADER = yes RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 30db12965..9f3d2b82d 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -17,6 +17,7 @@ #ifdef RGB_MATRIX_ENABLE # define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 3e26b93fc..26f611c08 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -27,6 +27,9 @@ enum planck_keycodes { }; #else # define BACKLIT OSM(MOD_LSFT) +enum planck_keycodes { + TH_LVL = NEW_SAFE_RANGE, +}; #endif #ifdef KEYBOARD_planck_ez @@ -48,8 +51,8 @@ enum planck_keycodes { K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ ) \ LAYOUT_ortho_4x12_wrapper( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_DEL, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) @@ -117,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [_RAISE] = LAYOUT_ortho_4x12_wrapper( @@ -130,8 +133,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ortho_4x12_wrapper( KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, - _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NUKE + TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, + _______, _______, _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, TG_MODS ) }; @@ -149,7 +152,20 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } else { unregister_code(KC_RSFT); } - return false; + break; +#endif +#ifdef KEYBOARD_planck_ez + case TH_LVL: + if (record->event.pressed) { + keyboard_config.led_level++; + if (keyboard_config.led_level > 4) { + keyboard_config.led_level = 0; + } + planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + eeconfig_update_kb(keyboard_config.raw); + layer_state_set_kb(layer_state); + } break; #endif } @@ -265,7 +281,7 @@ void rgb_matrix_indicators_user(void) { break; } if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { - rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); + if (!layer_state_cmp(layer_state, _ADJUST)) { rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); } rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); } if ((this_mod | this_osm) & MOD_MASK_CTRL) { @@ -353,18 +369,18 @@ void dip_update(uint8_t index, bool active) { #ifdef KEYBOARD_planck_ez layer_state_t layer_state_set_keymap(layer_state_t state) { - palClearPad(GPIOB, 8); - palClearPad(GPIOB, 9); + planck_ez_left_led_off(); + planck_ez_right_led_off(); switch (biton32(state)) { case _LOWER: - palSetPad(GPIOB, 9); + planck_ez_left_led_on(); break; case _RAISE: - palSetPad(GPIOB, 8); + planck_ez_right_led_on(); break; case _ADJUST: - palSetPad(GPIOB, 9); - palSetPad(GPIOB, 8); + planck_ez_right_led_on(); + planck_ez_left_led_on(); break; default: break; diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 21ce7ebb1..55f3acd70 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -33,6 +33,3 @@ NKRO_ENABLE = no else NKRO_ENABLE = yes endif - - -MACROS_ENABLED = no diff --git a/layouts/community/ortho_5x12/drashna/keymap.c b/layouts/community/ortho_5x12/drashna/keymap.c index 26be99af5..86a78336c 100644 --- a/layouts/community/ortho_5x12/drashna/keymap.c +++ b/layouts/community/ortho_5x12/drashna/keymap.c @@ -29,10 +29,11 @@ LAYOUT_ortho_5x12_wrapper( \ KC_GRV, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ - KC_ESC, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, KC_QUOT, \ - KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, CTL_T(K3A), KC_ENT, \ + KC_ESC, ALT_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, K2A, RALT_T(KC_QUOT), \ + KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, RCTL_T(K3A), KC_ENT, \ KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) + #define LAYOUT_ortho_5x12_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__) @@ -132,7 +133,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ortho_5x12_wrapper( \ KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST, VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index ee7c2ad63..0606f3e52 100644 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -18,6 +18,3 @@ NKRO_ENABLE = no else NKRO_ENABLE = yes endif - - -MACROS_ENABLED = no diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml index 679bdf435..7218a21be 100644 --- a/users/drashna/.gitlab-ci.yml +++ b/users/drashna/.gitlab-ci.yml @@ -10,7 +10,7 @@ QMK Firmware: image: ubuntu:18.10 before_script: - apt-get update -qy - - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr unzip wget zip + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr python3 unzip wget zip - avr-gcc --version - uname -a script: diff --git a/users/drashna/config.h b/users/drashna/config.h index 8f6e700d2..a0f92d8f3 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -1,5 +1,11 @@ #pragma once +// Use custom magic number so that when switching branches, EEPROM always gets reset +#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1337 + +/* Set Polling rate to 1000Hz */ +#define USB_POLLING_INTERVAL_MS 1 + #ifdef AUDIO_ENABLE # if __GNUC__ > 7 # if __has_include("drashna_song_list.h") diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index c1809dad0..6a436e0af 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -25,26 +25,7 @@ userspace_config_t userspace_config; # define DRASHNA_UNICODE_MODE 2 #endif -// This block is for all of the gaming macros, as they were all doing -// the same thing, but with differring text sent. -bool send_game_macro(const char *str, keyrecord_t *record, bool override) { - if (!record->event.pressed || override) { - uint16_t keycode; - if (userspace_config.is_overwatch) { - keycode = KC_BSPC; - } else { - keycode = KC_ENTER; - } - clear_keyboard(); - tap_code(keycode); - wait_ms(TAP_CODE_DELAY); - send_string_with_delay(str, TAP_CODE_DELAY); - wait_ms(TAP_CODE_DELAY); - tap_code(KC_ENTER); - } - if (override) wait_ms(3000); - return false; -} + bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { static uint16_t this_timer; @@ -123,7 +104,7 @@ __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { -#ifdef RGBLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) keyboard_post_init_rgb(); #endif keyboard_post_init_keymap(); @@ -132,6 +113,8 @@ void keyboard_post_init_user(void) { __attribute__((weak)) void shutdown_keymap(void) {} + void rgb_matrix_update_pwm_buffers(void); + void shutdown_user(void) { #ifdef RGBLIGHT_ENABLE rgblight_enable_noeeprom(); @@ -139,9 +122,9 @@ void shutdown_user(void) { rgblight_setrgb_red(); #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE - // uint16_t timer_start = timer_read(); - // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); - // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } + rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); + rgb_matrix_update_pwm_buffers(); + #endif // RGB_MATRIX_ENABLE shutdown_keymap(); } @@ -176,7 +159,7 @@ void matrix_scan_user(void) { run_diablo_macro_check(); #endif // TAP_DANCE_ENABLE -#ifdef RGBLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) matrix_scan_rgb(); #endif // RGBLIGHT_ENABLE @@ -190,7 +173,7 @@ layer_state_t layer_state_set_keymap(layer_state_t state) { return 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); -#ifdef RGBLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) state = layer_state_set_rgb(state); #endif // RGBLIGHT_ENABLE return layer_state_set_keymap(state); @@ -203,7 +186,7 @@ layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state layer_state_t default_layer_state_set_user(layer_state_t state) { state = default_layer_state_set_keymap(state); #if 0 -# ifdef RGBLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) state = default_layer_state_set_rgb(state); # endif // RGBLIGHT_ENABLE #endif diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 0d6dac380..e3edf8112 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -49,13 +49,8 @@ enum userspace_layers { _ADJUST, }; -/* -define modifiers here, since MOD_* doesn't seem to work for these - */ - bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); -bool send_game_macro(const char *str, keyrecord_t *record, bool override); void matrix_init_keymap(void); void shutdown_keymap(void); void suspend_power_down_keymap(void); @@ -69,11 +64,12 @@ void eeconfig_init_keymap(void); typedef union { uint32_t raw; struct { - bool rgb_layer_change :1; - bool is_overwatch :1; - bool nuke_switch :1; - uint8_t unicode_mod :4; - bool swapped_numbers :1; + 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; }; } userspace_config_t; diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 5666d052d..6eb21d2f2 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -21,16 +21,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif // KEYLOGGER_ENABLE switch (keycode) { - case KC_QWERTY ... KC_CARPLAX: + case KC_QWERTY ... KC_WORKMAN: if (record->event.pressed) { - set_single_persistent_default_layer(keycode - KC_QWERTY); + 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; case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); + 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); @@ -38,15 +45,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) #endif { -#if defined(__arm__) - send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); -#elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); -#elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); -#elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); -#endif // bootloader options + 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); @@ -68,44 +67,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } break; - // These are a serious of gaming macros. - // Only enables for the viterbi, basically, - // to save on firmware space, since it's limited. -#ifdef MACROS_ENABLED - case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros - if (record->event.pressed) { - userspace_config.is_overwatch ^= 1; - eeconfig_update_user(userspace_config.raw); - } -# ifdef RGBLIGHT_ENABLE - userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); -# endif // RGBLIGHT_ENABLE - break; - case KC_SALT: - return send_game_macro("Salt, salt, salt...", record, false); - case KC_MORESALT: - return send_game_macro("Please sir, can I have some more salt?!", record, false); - case KC_SALTHARD: - return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); - case KC_GOODGAME: - return send_game_macro("Good game, everyone!", record, false); - case KC_GLHF: - return send_game_macro("Good luck, have fun!!!", record, false); - case KC_SYMM: - return send_game_macro("Left click to win!", record, false); - case KC_JUSTGAME: - return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false); - case KC_TORB: - return send_game_macro("That was positively riveting!", record, false); - case KC_AIM: - send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); - return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); - case KC_C9: - return send_game_macro("OMG!!! C9!!!", record, false); - case KC_GGEZ: - return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); -#endif // MACROS_ENABLED - case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them #ifdef TAP_DANCE_ENABLE if (record->event.pressed) { diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index 8901a6f91..0ae468a04 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h @@ -13,25 +13,10 @@ enum userspace_custom_keycodes { KC_COLEMAK, // Sets default layer to COLEMAK KC_DVORAK, // Sets default layer to DVORAK KC_WORKMAN, // Sets default layer to WORKMAN - KC_NORMAN, // Sets default layer to NORMAN - KC_MALTRON, // Sets default layer to MALTRON - KC_EUCALYN, // Sets default layer to EUCALYN - KC_CARPLAX, // Sets default layer to CARPLAX KC_DIABLO_CLEAR, // Clears all Diablo Timers - KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) - KC_SALT, // See drashna.c for details - KC_MORESALT, - KC_SALTHARD, - KC_GOODGAME, - KC_SYMM, - KC_JUSTGAME, - KC_GLHF, - KC_TORB, - KC_AIM, - KC_C9, - KC_GGEZ, KC_MAKE, // Run keyboard's customized make command KC_RGB_T, // Toggles RGB Layer Indication mode + RGB_IDL, // RGB Idling animations KC_SECRET_1, // test1 KC_SECRET_2, // test2 KC_SECRET_3, // test3 diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 12851e261..a9af0566e 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -5,12 +5,24 @@ #if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; bool has_initialized; -#endif -#ifdef RGBLIGHT_ENABLE 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 void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { @@ -77,6 +89,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { } } +/* Function for the indicators */ void matrix_scan_indicator(void) { if (has_initialized) { set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); @@ -89,6 +102,7 @@ static rgblight_fadeout lights[RGBLED_NUM]; __attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; } +/* 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 @@ -130,6 +144,7 @@ bool rgblight_twinkle_is_led_used(uint8_t index) { } } +/* Handler for fading/twinkling effect */ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive bool litup = false; for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) { @@ -156,6 +171,9 @@ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rg } } +/* Triggers a LED to fade/twinkle. + * This function handles the selection of the LED and prepres for it to be used. + */ void start_rgb_light(void) { uint8_t indices[RGBLED_NUM]; uint8_t indices_count = 0; @@ -194,12 +212,23 @@ void start_rgb_light(void) { rgblight_sethsv_at(light->hue, 255, light->life, light_index); } #endif +#endif // RGBLIGHT_ENABLE bool process_record_user_rgb(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)) { - keycode = keycode & 0xFF; + temp_keycode &= 0xFF; } - switch (keycode) { + +#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: case KC_F1 ... KC_F12: @@ -210,40 +239,58 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { start_rgb_light(); } - return true; 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; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); + dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); eeconfig_update_user(userspace_config.raw); if (userspace_config.rgb_layer_change) { layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) } } #endif // RGBLIGHT_ENABLE - return false; break; -#ifdef RGBLIGHT_ENABLE + 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; case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (record->event.pressed) { // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (record->event.pressed) { + bool is_eeprom_updated = false; +#ifdef RGBLIGHT_ENABLE + // 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; - xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); + 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); } } - return true; break; -#endif // RGBLIGHT_ENABLE } return true; } void keyboard_post_init_rgb(void) { -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) +#if defined(RGBLIGHT_ENABLE) +# if defined(RGBLIGHT_STARTUP_ANIMATION) bool is_enabled = rgblight_config.enable; if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); @@ -262,17 +309,31 @@ void keyboard_post_init_rgb(void) { rgblight_disable_noeeprom(); } -#endif +# 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 } void matrix_scan_rgb(void) { -#ifdef RGBLIGHT_TWINKLE +#ifdef RGBLIGHT_ENABLE +# ifdef RGBLIGHT_TWINKLE scan_rgblight_fadeout(); -#endif // RGBLIGHT_ENABLE +# endif // RGBLIGHT_ENABLE -#ifdef INDICATOR_LIGHTS +# ifdef INDICATOR_LIGHTS 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 } diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index ce45d6a00..7e34c93c1 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -4,20 +4,29 @@ # include "rgb_matrix.h" #endif +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE) typedef struct { bool enabled; uint8_t hue; uint16_t timer; uint8_t life; } rgblight_fadeout; +#endif bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); -void scan_rgblight_fadeout(void); 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); + +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE) +void scan_rgblight_fadeout(void); +#endif +#if defined(RGBLIGHT_ENABLE) void rgblight_sethsv_default_helper(uint8_t index); -void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); +#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 b414036a4..7b77a51d9 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -40,10 +40,6 @@ ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) endif -ifeq ($(strip $(MACROS_ENABLED)), yes) - OPT_DEFS += -DMACROS_ENABLED -endif - ifdef CONSOLE_ENABLE ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) OPT_DEFS += -DKEYLOGGER_ENABLE diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h index a87247071..d22e2959c 100644 --- a/users/drashna/wrappers.h +++ b/users/drashna/wrappers.h @@ -174,11 +174,11 @@ NOTE: These are all the same length. If you do a search/replace #define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R2_________________ CG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT // clang-format on -- cgit v1.2.3-70-g09d2 From eb91c962886b1bb52c2d457a574cba09e2a8b0f0 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 20 Nov 2019 12:37:24 -0800 Subject: [Keymap] All about (ARM) RGB and OLEDs (drashna keymaps) (#7354) * Add Kyria Keymap * Enable all RGBLIGHT Animations for ARM and high capacity AVR * Reduce GNUC version for __has_include * Cleanup Ortho 4x12 Community layout * Update Collide 39 keymap * Cleanup Keymaps * Enable full 30 LEDs for Ergodox * Change EEPROM Load timing * Use RGB Matrix on Planck Rev6 * Use correct keymap swap * Enable everything for ARM * Only enable rgb sleep on avr until crash is fixed * Add additional Kyria keymap config * Overhaul Kyria OLED display * Improve kyria keymap based on usage * Minor tweaks to rules * Update OLED code to truncate properly * Fix RGB Light layer indication * Switch all of biton32 to get_highest_layer function * Fix OLED Keylogger display * Run qmk cformat over all of my user files * Slight tweak to kyria based on usage * Move around LALT_T config * Add comments about base wrappers to keymaps * Another cformat pass * Temp fix for VUSB boards and NKRO * Convert tabs to spaces in rules.mk files * Only enable RGBLight if it's enabled * Add Encoder Flip setting * Update OLED font file --- .../40percentclub/nano/keymaps/drashna/keymap.c | 10 +- keyboards/c39/keymaps/drashna/config.h | 9 +- keyboards/c39/keymaps/drashna/keymap.c | 132 +++++--- keyboards/c39/keymaps/drashna/rules.mk | 4 +- keyboards/crkbd/keymaps/drashna/glcdfont.c | 9 +- keyboards/crkbd/keymaps/drashna/keymap.c | 49 +-- keyboards/gergo/keymaps/drashna/keymap.c | 18 +- keyboards/keebio/iris/keymaps/drashna/config.h | 3 +- keyboards/keebio/iris/keymaps/drashna/keymap.c | 14 +- keyboards/keebio/viterbi/keymaps/drashna/config.h | 31 +- keyboards/keebio/viterbi/keymaps/drashna/keymap.c | 50 +-- keyboards/kyria/keymaps/drashna/config.h | 38 +++ keyboards/kyria/keymaps/drashna/keymap.c | 372 +++++++++++++++++++++ keyboards/kyria/keymaps/drashna/rules.mk | 22 ++ keyboards/orthodox/keymaps/drashna/config.h | 45 ++- keyboards/orthodox/keymaps/drashna/keymap.c | 39 +-- layouts/community/ergodox/drashna/config.h | 15 +- layouts/community/ergodox/drashna/keymap.c | 33 +- layouts/community/ergodox/drashna/rules.mk | 4 +- layouts/community/numpad_5x6/drashna/config.h | 20 +- layouts/community/numpad_5x6/drashna/keymap.c | 1 - layouts/community/ortho_4x12/drashna/config.h | 37 +- layouts/community/ortho_4x12/drashna/keymap.c | 81 +++-- layouts/community/ortho_4x12/drashna/rules.mk | 60 ++-- layouts/community/ortho_5x12/drashna/keymap.c | 32 +- layouts/community/ortho_5x12/drashna/rules.mk | 18 +- users/drashna/config.h | 14 +- users/drashna/drashna.c | 60 ++-- users/drashna/drashna.h | 5 +- users/drashna/font_gmk_bad.h | 241 +++++++++++++ users/drashna/hue_manitee_font.h | 241 +++++++++++++ users/drashna/process_records.c | 8 +- users/drashna/rgb_stuff.c | 194 +++++------ users/drashna/rgb_stuff.h | 6 +- users/drashna/rgblight_breathe_table.h | 8 +- users/drashna/rules.mk | 23 +- users/drashna/template.c | 130 +++---- users/drashna/template.h | 15 +- 38 files changed, 1499 insertions(+), 592 deletions(-) mode change 100755 => 100644 keyboards/c39/keymaps/drashna/config.h create mode 100644 keyboards/kyria/keymaps/drashna/config.h create mode 100644 keyboards/kyria/keymaps/drashna/keymap.c create mode 100644 keyboards/kyria/keymaps/drashna/rules.mk create mode 100644 users/drashna/font_gmk_bad.h create mode 100644 users/drashna/hue_manitee_font.h (limited to 'users/drashna/rgb_stuff.c') diff --git a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c index 6c5b97457..668178967 100644 --- a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c +++ b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c @@ -1,12 +1,11 @@ -#include QMK_KEYBOARD_H #include "drashna.h" #include "analog.c" #include "pointing_device.h" #include "pincontrol.h" - #define KC_X0 LT(_FN, KC_ESC) +// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( KC_VOLU, KC_MPLY, KC_MPRV, RESET, @@ -14,6 +13,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; +// clang-format on // Joystick // Set Pins @@ -39,7 +39,7 @@ int16_t xOrigin, yOrigin; uint16_t lastCursor = 0; int16_t axisCoordinate(uint8_t pin, uint16_t origin) { - int8_t direction; + int8_t direction; int16_t distanceFromOrigin; int16_t range; @@ -57,8 +57,8 @@ int16_t axisCoordinate(uint8_t pin, uint16_t origin) { direction = 1; } - float percent = (float)distanceFromOrigin / range; - int16_t coordinate = (int16_t)(percent * 100); + float percent = (float)distanceFromOrigin / range; + int16_t coordinate = (int16_t)(percent * 100); if (coordinate < 0) { return 0; } else if (coordinate > 100) { diff --git a/keyboards/c39/keymaps/drashna/config.h b/keyboards/c39/keymaps/drashna/config.h old mode 100755 new mode 100644 index 361f68a78..5d53fe54b --- a/keyboards/c39/keymaps/drashna/config.h +++ b/keyboards/c39/keymaps/drashna/config.h @@ -2,6 +2,11 @@ // place overrides here #undef MATRIX_COL_PINS -#define MATRIX_COL_PINS { A3, A2, A1, A0, B13, B14, B15, B9, B3, B2, B4, A10, A9 } +#define MATRIX_COL_PINS \ + { A3, A2, A1, A0, B13, B14, B15, B9, B3, B2, B4, A10, A9 } #undef MATRIX_ROW_PINS -#define MATRIX_ROW_PINS { B7, B1, B0 } +#define MATRIX_ROW_PINS \ + { B7, B1, B0 } + +#define RGB_DI_PIN B10 +#define RGBLED_NUM 15 diff --git a/keyboards/c39/keymaps/drashna/keymap.c b/keyboards/c39/keymaps/drashna/keymap.c index 9de75190d..882938138 100755 --- a/keyboards/c39/keymaps/drashna/keymap.c +++ b/keyboards/c39/keymaps/drashna/keymap.c @@ -1,45 +1,97 @@ -#include QMK_KEYBOARD_H +#include "drashna.h" -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _FN1 1 - -// Defines for task manager and such -#define CALTDEL LCTL(LALT(KC_DEL)) -#define TSKMGR LCTL(LSFT(KC_ESC)) +/* + * The `LAYOUT_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ +// clang-format off +#define LAYOUT_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, KC_NO, K06, K07, K08, K09, K0A, KC_DEL, \ + ALT_T(KC_TAB), K11, K12, K13, K14, K15, KC_BSPC, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + KC_MLSF, CTL_T(K21), K22, K23, K24, LT(_LOWER,K25), KC_SPC, LT(_RAISE,K26), K27, K28, K29, RCTL_T(K2A), KC_ENT \ + ) +#define LAYOUT_base_wrapper(...) LAYOUT_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty - * ,----------------------------------------------------------------------------. ,-------------. - * | Q | W | E | R | T | Bksp | Y | U | I | O | P | | M1 | M2 | - * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| - * | A | S | D | F | G | Enter| H | J | K | L | ; | | M3 | M4 | - * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| - * | Z | X | C | V | B | FN1 | N | M | , | . | / | | M5 | M6 | - * `----------------------------------------------------------------------------' `-------------' - */ -[_QWERTY] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_1, KC_2, - KC_A, KC_S, KC_D, KC_F, KC_G, MT(MOD_LSFT, KC_ENT), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_3, KC_4, - KC_Z, KC_X, KC_C, KC_V, KC_B, LT(_FN1, KC_SPC), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_5, KC_6 -), - -/* FN1 - * ,----------------------------------------------------------------------------. ,-------------. - * | 1 | 2 | 3 | 4 | 5 | Bksp | 6 | 7 | 8 | 9 | 0 | | M1 | M2 | - * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| - * | 4 | 5 | 6 | + | | Enter| | | | | | | M3 | M4 | - * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| - * | 7 | 8 | 9 | 0 | | FN1 | | | | | | | M5 | M6 | - * `----------------------------------------------------------------------------' `-------------' - */ -[_FN1] = LAYOUT( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_BSPC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_1, KC_2, - KC_4, KC_5, KC_6, KC_PLUS, _______, KC_ENT, _______, _______, _______, _______, _______, KC_3, KC_4, - KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, _______, KC_5, KC_6 -), + [_QWERTY] = LAYOUT_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + + [_COLEMAK] = LAYOUT_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + [_MODS] = LAYOUT_wrapper( + _______, ___________________BLANK___________________, _______, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, _______, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, ___________________BLANK___________________, _______ + ), + + [_LOWER] = LAYOUT_wrapper( + KC_TILD, _________________LOWER_L1__________________, _______, _________________LOWER_R1__________________, KC_BSPC, + KC_DEL, _________________LOWER_L2__________________, _______, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _______, _________________LOWER_R3__________________, _______ + ), + + [_RAISE] = LAYOUT_wrapper( + KC_GRV, _________________RAISE_L1__________________, _______, _________________RAISE_R1__________________, KC_BSPC, + KC_DEL, _________________RAISE_L2__________________, _______, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _________________RAISE_R3__________________, _______ + ), + + [_ADJUST] = LAYOUT_wrapper( + KC_MAKE, _________________ADJUST_L1_________________, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, + VRSN, _________________ADJUST_L2_________________, MG_NKRO, _________________ADJUST_R2_________________, EEP_RST, + TG_MODS, _________________ADJUST_L3_________________, KC_RGB_T,_________________ADJUST_R3_________________, RGB_IDL + ) }; +// clang-format on diff --git a/keyboards/c39/keymaps/drashna/rules.mk b/keyboards/c39/keymaps/drashna/rules.mk index ae0cc9efe..d216f6abe 100644 --- a/keyboards/c39/keymaps/drashna/rules.mk +++ b/keyboards/c39/keymaps/drashna/rules.mk @@ -15,4 +15,6 @@ MIDI_ENABLE = no # MIDI controls UNICODE_ENABLE = yes # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = yes # Audio output on port C6 -RGBLIGHT_ENABLE = no # RGB Enable / Disable +RGBLIGHT_ENABLE = yes # RGB Enable / Disable + +RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/keyboards/crkbd/keymaps/drashna/glcdfont.c b/keyboards/crkbd/keymaps/drashna/glcdfont.c index 998b5c408..2bfc3fac6 100644 --- a/keyboards/crkbd/keymaps/drashna/glcdfont.c +++ b/keyboards/crkbd/keymaps/drashna/glcdfont.c @@ -1,17 +1,18 @@ #pragma once #ifdef __AVR__ - #include - #include +# include +# include #elif defined(ESP8266) - #include +# include #else - #define PROGMEM +# define PROGMEM #endif // Corne 8x6 font with QMK Firmware Logo // Online editor: https://helixfonteditor.netlify.com/ +// clang-format off const unsigned char font[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index cd84f0d91..9a1beeb74 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -1,17 +1,17 @@ -#include QMK_KEYBOARD_H #include "drashna.h" -extern keymap_config_t keymap_config; -extern uint8_t is_master; +extern uint8_t is_master; #ifdef RGBLIGHT_ENABLE // Following line allows macro to read current RGB settings extern rgblight_config_t rgblight_config; #endif #ifdef OLED_DRIVER_ENABLE -static uint32_t oled_timer = 0; -static char keylog_str[6] = {}; -static uint16_t log_timer = 0; +# define KEYLOGGER_LENGTH 5 +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 @@ -37,7 +37,14 @@ void add_keylog(uint16_t keycode); enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; -// clang-format off +/* + * The `LAYOUT_crkbd_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ + #define LAYOUT_crkbd_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ @@ -155,7 +162,7 @@ void add_keylog(uint16_t keycode) { keycode = 0; } - for (uint8_t i = 4; i > 0; --i) { + for (uint8_t i = (KEYLOGGER_LENGTH - 1); i > 0; --i) { keylog_str[i] = keylog_str[i - 1]; } @@ -168,7 +175,7 @@ void add_keylog(uint16_t keycode) { void update_log(void) { if (timer_elapsed(log_timer) > 750) { - //add_keylog(0); + // add_keylog(0); } } @@ -179,7 +186,7 @@ void render_keylogger_status(void) { void render_default_layer_state(void) { oled_write_P(PSTR("Lyout"), false); - switch (biton32(default_layer_state)) { + switch (get_highest_layer(default_layer_state)) { case _QWERTY: oled_write_P(PSTR(" QRTY"), false); break; @@ -268,7 +275,7 @@ void render_status_secondary(void) { /* Show Keyboard Layout */ render_default_layer_state(); render_layer_state(); - render_mod_status(get_mods()|get_oneshot_mods()); + render_mod_status(get_mods() | get_oneshot_mods()); render_keylogger_status(); } @@ -278,9 +285,11 @@ void oled_task_user(void) { oled_off(); return; } -#ifndef SPLIT_KEYBOARD - else { oled_on(); } -#endif +# ifndef SPLIT_KEYBOARD + else { + oled_on(); + } +# endif update_log(); if (is_master) { @@ -303,16 +312,12 @@ uint16_t get_tapping_term(uint16_t keycode) { #ifdef RGB_MATRIX_ENABLE -void suspend_power_down_keymap(void) { - rgb_matrix_set_suspend_state(true); -} +void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } -void suspend_wakeup_init_keymap(void) { - rgb_matrix_set_suspend_state(false); -} +void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } void check_default_layer(uint8_t mode, uint8_t type) { - switch (biton32(default_layer_state)) { + switch (get_highest_layer(default_layer_state)) { case _QWERTY: rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type); break; @@ -351,7 +356,7 @@ void rgb_matrix_indicators_user(void) { rgb_matrix_config.enable # endif ) { - switch (biton32(layer_state)) { + switch (get_highest_layer(layer_state)) { case _GAMEPAD: rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); break; diff --git a/keyboards/gergo/keymaps/drashna/keymap.c b/keyboards/gergo/keymaps/drashna/keymap.c index edc5a9e99..d1e622406 100644 --- a/keyboards/gergo/keymaps/drashna/keymap.c +++ b/keyboards/gergo/keymaps/drashna/keymap.c @@ -1,14 +1,12 @@ -/* Good on you for modifying your layout! if you don't have - * time to read the QMK docs, a list of keycodes can be found at - * - * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md - * - * There's also a template for adding new layers at the bottom of this file! - */ - -#include QMK_KEYBOARD_H #include "drashna.h" +/* + * The `LAYOUT_gergo_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ // clang-format off #define LAYOUT_gergo_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -17,7 +15,7 @@ ) \ LAYOUT_gergo_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ - KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + LALT_T(KC_TAB), K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ KC_GRV, KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT, _______ \ ) diff --git a/keyboards/keebio/iris/keymaps/drashna/config.h b/keyboards/keebio/iris/keymaps/drashna/config.h index 6fff5d72c..25678bd67 100644 --- a/keyboards/keebio/iris/keymaps/drashna/config.h +++ b/keyboards/keebio/iris/keymaps/drashna/config.h @@ -32,7 +32,8 @@ along with this program. If not, see . # undef RGBLED_NUM # define RGBLED_NUM 18 // Number of LEDs # undef RGBLED_SPLIT -# define RGBLED_SPLIT { 9, 9 } +# define RGBLED_SPLIT \ + { 9, 9 } # define RGBLIGHT_HUE_STEP 8 # define RGBLIGHT_SAT_STEP 8 # define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index de19f7ca0..edfcd23e7 100644 --- a/keyboards/keebio/iris/keymaps/drashna/keymap.c +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c @@ -1,7 +1,13 @@ - -#include QMK_KEYBOARD_H #include "drashna.h" +/* + * The `LAYOUT_iris_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ + // clang-format off #define LAYOUT_iris_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -10,8 +16,8 @@ ) \ LAYOUT_wrapper( \ KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ - KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + LALT_T(KC_TAB), K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ + KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ KC_GRV, KC_SPC, LT(_LOWER,KC_BSPC), LT(_RAISE,KC_DEL), KC_ENT, RAISE \ ) diff --git a/keyboards/keebio/viterbi/keymaps/drashna/config.h b/keyboards/keebio/viterbi/keymaps/drashna/config.h index 201c02e41..40a5bbd0e 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/config.h +++ b/keyboards/keebio/viterbi/keymaps/drashna/config.h @@ -21,27 +21,25 @@ along with this program. If not, see . #define MATRIX_ROWS 5 #ifdef RGBLIGHT_ENABLE -# undef RGBLED_NUM -# define RGBLED_NUM 16 - -# define RGBLIGHT_HUE_STEP 8 -# define RGBLIGHT_SAT_STEP 8 -# define RGBLIGHT_VAL_STEP 8 -# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#endif // RGBLIGHT_ENABLE - - +# undef RGBLED_NUM +# define RGBLED_NUM 16 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#endif // RGBLIGHT_ENABLE #undef PRODUCT -#define PRODUCT Drashnas Viterbi Macro Pad +#define PRODUCT Drashnas Viterbi Macro Pad #ifdef AUDIO_ENABLE -# define C6_AUDIO -# define NO_MUSIC_MODE +# define C6_AUDIO +# define NO_MUSIC_MODE #endif +// clang-format off #define LAYOUT_ortho_5x7( \ L00, L01, L02, L03, L04, L05, L06, \ L10, L11, L12, L13, L14, L15, L16, \ @@ -56,8 +54,9 @@ along with this program. If not, see . { L30, L31, L32, L33, L34, L35, L36 }, \ { L40, L41, L42, L43, L44, L45, L46 }, \ } +// clang-format on -#define QMK_ESC_OUTPUT F5 // usually COL -#define QMK_ESC_INPUT D4 // usually ROW +#define QMK_ESC_OUTPUT F5 // usually COL +#define QMK_ESC_INPUT D4 // usually ROW #define QMK_LED B0 #define QMK_SPEAKER C6 diff --git a/keyboards/keebio/viterbi/keymaps/drashna/keymap.c b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c index 9c17c5a57..3b213418d 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/keebio/viterbi/keymaps/drashna/keymap.c @@ -1,24 +1,15 @@ -#include QMK_KEYBOARD_H #include "drashna.h" -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - - // Fillers to make layering more clear -#define DIABLO TG(_DIABLO) -#define GAMEPAD TG(_GAMEPAD) -#define MEDIA TT(_MEDIA) +#define DIABLO TG(_DIABLO) +#define GAMEPAD TG(_GAMEPAD) +#define MEDIA TT(_MEDIA) - -//enum more_custom_keycodes { +// enum more_custom_keycodes { // KC_P00 = NEW_SAFE_RANGE //}; +// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMLOCK] = LAYOUT_ortho_5x7( @@ -55,32 +46,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - - +// clang-format on bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - - //switch (keycode) { - //case KC_P00: - // if (!record->event.pressed) { - // tap(KC_KP_0); - // tap(KC_KP_0); - // } - // return false; - // break; - //} - return true; + // switch (keycode) { + // case KC_P00: + // if (!record->event.pressed) { + // tap(KC_KP_0); + // tap(KC_KP_0); + // } + // return false; + // break; + //} + return true; } - - - void matrix_init_keymap(void) { - #ifndef CONVERT_TO_PROTON_C +#ifndef CONVERT_TO_PROTON_C setPinOutput(D5); writePinHigh(D5); setPinOutput(B0); writePinHigh(B0); - #endif +#endif } diff --git a/keyboards/kyria/keymaps/drashna/config.h b/keyboards/kyria/keymaps/drashna/config.h new file mode 100644 index 000000000..83d6283f5 --- /dev/null +++ b/keyboards/kyria/keymaps/drashna/config.h @@ -0,0 +1,38 @@ +/* Copyright 2019 Thomas Baart + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define EE_HANDS + +#ifdef OLED_DRIVER_ENABLE +# define OLED_DISPLAY_128X64 +# define OLED_FONT_H "font_gmk_bad.h" +# define OLED_DISABLE_TIMEOUT +# define OLED_SCROLL_TIMEOUT_RIGHT 60000 +#endif + +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_SLEEP +# define RGBLIGHT_LIMIT_VAL 200 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +#endif + +// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +#define SPLIT_USB_DETECT +#define SPLIT_USB_TIMEOUT 1000 diff --git a/keyboards/kyria/keymaps/drashna/keymap.c b/keyboards/kyria/keymaps/drashna/keymap.c new file mode 100644 index 000000000..bdb00e596 --- /dev/null +++ b/keyboards/kyria/keymaps/drashna/keymap.c @@ -0,0 +1,372 @@ +#include "drashna.h" + +uint8_t is_master; + +#ifdef OLED_DRIVER_ENABLE +# define KEYLOGGER_LENGTH 10 +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 +}; + +void add_keylog(uint16_t keycode); +#endif + +#ifndef UNICODE_ENABLE +# define UC(x) KC_NO +#endif + +/* + * The `LAYOUT_kyria_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ + +// clang-format off +#define LAYOUT_kyria_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ + LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, KC_NO, KC_NO, KC_NO, KC_NO, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ + KC_MUTE, OS_LALT, KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI, UC(0x03A8), UC(0x2E2E) \ + ) +/* Re-pass though to allow templates to be used */ +#define LAYOUT_kyria_base_wrapper(...) LAYOUT_kyria_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kyria_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + + [_COLEMAK] = LAYOUT_kyria_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_kyria_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_kyria_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_kyria_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_kyria_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_kyria_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_kyria_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + [_MODS] = LAYOUT_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, _______, _______, _______, ___________________BLANK___________________, KC_RSFT, + _______, _______, KC_LALT, _______, _______, _______, _______, KC_RGUI, _______, _______ + ), + [_LOWER] = LAYOUT_wrapper( + KC_F12, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, + _______, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _______, _______, _______, _______, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_RAISE] = LAYOUT_wrapper( + KC_F12, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_F11, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_ADJUST] = LAYOUT_wrapper( + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, HPT_TOG, HPT_FBK, MG_NKRO, UC_MOD, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, _______ + ), +// [_LAYERINDEX] = LAYOUT_wrapper( +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ), +}; +// clang-format on + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef OLED_DRIVER_ENABLE + oled_timer = timer_read32(); + add_keylog(keycode); +#endif +#ifndef SPLIT_KEYBOARD + if (keycode == RESET && !is_master) { + return false; + } +#endif + } + return true; +} +void matrix_init_keymap(void) { is_master = (uint8_t)is_keyboard_master(); } + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } + +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(); +} + +void update_log(void) { + if (timer_elapsed(log_timer) > 750) { + // add_keylog(0); + } +} + +void render_keylogger_status(void) { + oled_write_P(PSTR("Keylogger: "), false); + oled_write(keylog_str, false); +} + +void render_default_layer_state(void) { + oled_write_P(PSTR("Layout: "), false); + switch (get_highest_layer(default_layer_state)) { + case _QWERTY: + oled_write_ln_P(PSTR("Qwerty "), false); + break; + case _COLEMAK: + oled_write_ln_P(PSTR("Colemak"), false); + break; + case _DVORAK: + oled_write_ln_P(PSTR("Dvorak"), false); + break; + case _WORKMAN: + oled_write_ln_P(PSTR("Workman"), false); + break; + case _NORMAN: + oled_write_ln_P(PSTR("Norman"), false); + break; + case _MALTRON: + oled_write_ln_P(PSTR("Maltron"), false); + break; + case _EUCALYN: + oled_write_ln_P(PSTR("Eucalyn"), false); + break; + case _CARPLAX: + oled_write_ln_P(PSTR("Carplax"), false); + break; + } +} + +void render_layer_state(void) { + oled_write_ln_P(PSTR("Layer:"), false); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Lower"), layer_state_is(_LOWER)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Raise"), layer_state_is(_RAISE)); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("Mods"), layer_state_is(_MODS)); +} + +void render_keylock_status(uint8_t led_usb_state) { + oled_write_P(PSTR("Lock: "), false); + oled_write_P(PSTR("NUM"), led_usb_state & (1 << USB_LED_NUM_LOCK)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("CAPS"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("SCL"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); +} + +void render_mod_status(uint8_t modifiers) { + oled_write_P(PSTR("Mods: "), false); + oled_write_P(PSTR("Sft"), (modifiers & MOD_MASK_SHIFT)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Ctl"), (modifiers & MOD_MASK_CTRL)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Alt"), (modifiers & MOD_MASK_ALT)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("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("Boot "), false); + oled_write_P(logo[0][0], !keymap_config.swap_lctl_lgui); + oled_write_P(logo[1][0], keymap_config.swap_lctl_lgui); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("NKRO"), keymap_config.nkro); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("GUI"), !keymap_config.no_gui); + oled_write_P(PSTR("Magic "), false); + oled_write_P(logo[0][1], !keymap_config.swap_lctl_lgui); + oled_write_P(logo[1][1], keymap_config.swap_lctl_lgui); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("GRV"), keymap_config.swap_grave_esc); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("CAPS"), keymap_config.swap_control_capslock); +} + +void render_user_status(void) { + oled_write_P(PSTR("USER: "), false); + oled_write_P(PSTR("Anim"), userspace_config.rgb_matrix_idle_anim); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("Layr"), userspace_config.rgb_layer_change); + oled_write_P(PSTR(" "), false); + oled_write_ln_P(PSTR("Nuke"), userspace_config.nuke_switch); +} + +// clang-format off +void render_logo(void) { + 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}; + + oled_write_P(qmk_logo, false); +} + +# ifndef SPLIT_TRANSPORT_MIRROR +void render_kyria_logo(void) { + static const char PROGMEM kyria_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,224,240,112,120, 56, 60, 28, 30, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 30, 28, 60, 56,120,112,240,224,192,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,192,224,240,124, 62, 31, 15, 7, 3, 1,128,192,224,240,120, 56, 60, 28, 30, 14, 14, 7, 7,135,231,127, 31,255,255, 31,127,231,135, 7, 7, 14, 14, 30, 28, 60, 56,120,240,224,192,128, 1, 3, 7, 15, 31, 62,124,240,224,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,240,252,255, 31, 7, 1, 0, 0,192,240,252,254,255,247,243,177,176, 48, 48, 48, 48, 48, 48, 48,120,254,135, 1, 0, 0,255,255, 0, 0, 1,135,254,120, 48, 48, 48, 48, 48, 48, 48,176,177,243,247,255,254,252,240,192, 0, 0, 1, 7, 31,255,252,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,254,255,255, 1, 1, 7, 30,120,225,129,131,131,134,134,140,140,152,152,177,183,254,248,224,255,255,224,248,254,183,177,152,152,140,140,134,134,131,131,129,225,120, 30, 7, 1, 1,255,255,254, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0,255,255, 0, 0,192,192, 48, 48, 0, 0,240,240, 0, 0, 0, 0, 0, 0,240,240, 0, 0,240,240,192,192, 48, 48, 48, 48,192,192, 0, 0, 48, 48,243,243, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,192,192, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,127,255,255,128,128,224,120, 30,135,129,193,193, 97, 97, 49, 49, 25, 25,141,237,127, 31, 7,255,255, 7, 31,127,237,141, 25, 25, 49, 49, 97, 97,193,193,129,135, 30,120,224,128,128,255,255,127, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 63, 63, 3, 3, 12, 12, 48, 48, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 15, 15, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 63, 63, 48, 48, 0, 0, 12, 12, 51, 51, 51, 51, 51, 51, 63, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 63,255,248,224,128, 0, 0, 3, 15, 63,127,255,239,207,141, 13, 12, 12, 12, 12, 12, 12, 12, 30,127,225,128, 0, 0,255,255, 0, 0,128,225,127, 30, 12, 12, 12, 12, 12, 12, 12, 13,141,207,239,255,127, 63, 15, 3, 0, 0,128,224,248,255, 63, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 7, 15, 62,124,248,240,224,192,128, 1, 3, 7, 15, 30, 28, 60, 56,120,112,112,224,224,225,231,254,248,255,255,248,254,231,225,224,224,112,112,120, 56, 60, 28, 30, 15, 7, 3, 1,128,192,224,240,248,124, 62, 15, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 15, 14, 30, 28, 60, 56,120,112,112,112,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,112,112,112,120, 56, 60, 28, 30, 14, 15, 7, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + oled_write_raw_P(kyria_logo, sizeof(kyria_logo)); +} +# 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 render_status_secondary(void) { + /* Show Keyboard Layout */ + render_logo(); + render_default_layer_state(); + render_layer_state(); + render_mod_status(get_mods() | get_oneshot_mods()); + + 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 { +# ifdef SPLIT_TRANSPORT_MIRROR + render_status_secondary(); +# else + render_kyria_logo(); +# endif + } +} + +#endif + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + // Volume control + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + // Page up/Page down + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } +} +#endif diff --git a/keyboards/kyria/keymaps/drashna/rules.mk b/keyboards/kyria/keymaps/drashna/rules.mk new file mode 100644 index 000000000..c1a37f5c5 --- /dev/null +++ b/keyboards/kyria/keymaps/drashna/rules.mk @@ -0,0 +1,22 @@ +OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays +ENCODER_ENABLE = yes # ENables the use of one or more encoders +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_STARTUP_ANIMATION = yes + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs + +BOOTLOADER = atmel-dfu + +SPLIT_TRANSPORT = mirror diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 4719c2269..585c91640 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -34,41 +34,40 @@ along with this program. If not, see . /* key combination for magic key command */ #undef IS_COMMAND -#define IS_COMMAND() ( \ - get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT)) \ -) +#define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT))) #ifdef RGBLIGHT_ENABLE -# define RGB_DI_PIN D3 -# define RGBLED_NUM 16 // Number of LEDs -# define RGBLED_SPLIT { 8, 8 } - -# define RGBLIGHT_HUE_STEP 12 -# define RGBLIGHT_SAT_STEP 12 -# define RGBLIGHT_VAL_STEP 12 -# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#endif // RGBLIGHT_ENABLE +# define RGB_DI_PIN D3 +# define RGBLED_NUM 16 // Number of LEDs +# define RGBLED_SPLIT \ + { 8, 8 } + +# define RGBLIGHT_HUE_STEP 12 +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_VAL_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#endif // RGBLIGHT_ENABLE #ifdef AUDIO_ENABLE -# define C6_AUDIO -# ifdef RGBLIGHT_ENABLE -# define NO_MUSIC_MODE -# endif -#endif //AUDIO_ENABLE +# define C6_AUDIO +# ifdef RGBLIGHT_ENABLE +# define NO_MUSIC_MODE +# endif +#endif // AUDIO_ENABLE #undef PRODUCT #ifdef KEYBOARD_orthodox_rev1 -# define PRODUCT Drashna Hacked Orthodox Rev.1 +# define PRODUCT Drashna Hacked Orthodox Rev .1 #elif KEYBOARD_orthodox_rev3 -# define PRODUCT Drashna Hacked Orthodox Rev.3 +# define PRODUCT Drashna Hacked Orthodox Rev .3 #endif -#define QMK_ESC_OUTPUT D7 // usually COL +#define QMK_ESC_OUTPUT D7 // usually COL #ifdef KEYBOARD_orthodox_rev1 -# define QMK_ESC_INPUT D4 // usually ROW +# define QMK_ESC_INPUT D4 // usually ROW #else -# define QMK_ESC_INPUT D2 // usually ROW +# define QMK_ESC_INPUT D2 // usually ROW #endif #define QMK_LED B0 #define QMK_SPEAKER C6 diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index bf6b62b41..2dbe18634 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -1,35 +1,12 @@ -/* -This is the keymap for the keyboard - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2017 Art Ortenburger - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include QMK_KEYBOARD_H #include "drashna.h" -#ifdef INDICATOR_LIGHTS -extern userspace_config_t userspace_config; - -uint8_t last_mod; -uint8_t last_led; -uint8_t last_osm; -#endif - +/* + * The `LAYOUT_orthodox_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ // clang-format off #define LAYOUT_orthodox_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -38,7 +15,7 @@ uint8_t last_osm; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, ALT_T(K11), K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + LALT_T(KC_TAB), K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF \ ) #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 494383299..0091ebcde 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -1,18 +1,19 @@ #pragma once #ifdef RGBLIGHT_ENABLE -# undef RGBLIGHT_SAT_STEP -# define RGBLIGHT_SAT_STEP 12 - -# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 -# define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 -#endif // RGBLIGHT_ENABLE +# undef RGBLIGHT_SAT_STEP +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 +#endif // RGBLIGHT_ENABLE #undef PRODUCT -#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine +#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine #undef DEBOUNCE #define DEBOUNCE 30 #define TAPPING_TERM_PER_KEY + +#define ERGODOX_LED_30 diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 6ed4558e2..8308bfdaa 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -1,20 +1,3 @@ -/* -This is the keymap for the keyboard -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2017 Art Ortenburger -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include QMK_KEYBOARD_H #include "drashna.h" #ifdef UNICODEMAP_ENABLE @@ -32,6 +15,13 @@ enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; // define layer change stuff for underglow indicator bool skip_leds = false; +/* + * The `LAYOUT_ergodox_pretty_base` macro is a template to allow the use of + * identical modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, + * etc), so that there is no need to set them up for each layout, and modify + * all of them if I want to change them. This helps to keep consistency and + * ease of use. K## is a placeholder to pass through the individual keycodes + */ // clang-format off #define LAYOUT_ergodox_pretty_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -40,8 +30,8 @@ bool skip_leds = false; ) \ LAYOUT_ergodox_pretty_wrapper( \ KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ - KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ + KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ @@ -402,7 +392,7 @@ void rgb_matrix_indicators_user(void) { rgb_matrix_config.enable # endif ) { - switch (biton32(layer_state)) { + switch (get_highest_layer(layer_state)) { case _GAMEPAD: rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q @@ -432,7 +422,7 @@ void rgb_matrix_indicators_user(void) { break; default: { bool mods_enabled = IS_LAYER_ON(_MODS); - switch (biton32(default_layer_state)) { + switch (get_highest_layer(default_layer_state)) { case _QWERTY: rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); break; @@ -466,7 +456,6 @@ void rgb_matrix_indicators_user(void) { #endif // RGB_MATRIX_INIT - uint16_t get_tapping_term(uint16_t keycode) { if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index f9f9ea2ba..3aee59df6 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -3,8 +3,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend COMMAND_ENABLE = no # Commands for debug and configuration SPACE_CADET_ENABLE = no ifeq ($(strip $(KEYBOARD)), ergodox_ez) - RGBLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no + RGBLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no endif CONSOLE_ENABLE = no BOOTMAGIC_ENABLE = yes diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h index 2fc5ab658..29045148e 100644 --- a/layouts/community/numpad_5x6/drashna/config.h +++ b/layouts/community/numpad_5x6/drashna/config.h @@ -3,17 +3,17 @@ // #define B6_AUDIO #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) -# define RGB_DI_PIN B1 -# define RGBLED_NUM 16 // Number of LEDs +# define RGB_DI_PIN B1 +# define RGBLED_NUM 16 // Number of LEDs -# define RGBLIGHT_HUE_STEP 12 -# define RGBLIGHT_SAT_STEP 12 -# define RGBLIGHT_VAL_STEP 12 -# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#endif // RGBLIGHT_ENABLE +# define RGBLIGHT_HUE_STEP 12 +# define RGBLIGHT_SAT_STEP 12 +# define RGBLIGHT_VAL_STEP 12 +# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#endif // RGBLIGHT_ENABLE #if defined(KEYBOARD_primekb_prime_m) -# undef PRODUCT -# define PRODUCT Drashna Hacked Prime_M Macro Pad +# undef PRODUCT +# define PRODUCT Drashna Hacked Prime_M Macro Pad #endif diff --git a/layouts/community/numpad_5x6/drashna/keymap.c b/layouts/community/numpad_5x6/drashna/keymap.c index 81710221d..3d325a4c1 100644 --- a/layouts/community/numpad_5x6/drashna/keymap.c +++ b/layouts/community/numpad_5x6/drashna/keymap.c @@ -1,4 +1,3 @@ -#include QMK_KEYBOARD_H #include "drashna.h" #define F2_MCRO LT(_GAMEPAD, KC_F2) diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index d8ac5e6d1..663708afa 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -1,9 +1,10 @@ #pragma once #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) -# define RGB_DI_PIN A0 -# define RGBLED_NUM 13 // Number of LEDs -# define RGBLIGHT_ANIMATIONS +# if defined(KEYBOARD_planck_light) +# define RGB_DI_PIN A0 +# define RGBLED_NUM 13 // Number of LEDs +# endif # define RGBLIGHT_HUE_STEP 12 # define RGBLIGHT_SAT_STEP 12 # define RGBLIGHT_VAL_STEP 12 @@ -23,6 +24,9 @@ # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended # undef RGB_MATRIX_LED_PROCESS_LIMIT # undef RGB_MATRIX_LED_FLUSH_LIMIT +# ifdef KEYBOARD_planck_rev6 +# define DRIVER_LED_TOTAL RGBLED_NUM +# endif #endif #if defined(KEYBOARD_lets_split_rev2) @@ -34,7 +38,7 @@ #if !defined(KEYBOARD_planck_light) # ifdef RGBLIGHT_ENABLE # define NO_MUSIC_MODE -# endif // RGBLIGHT_ENABLE +# endif // RGBLIGHT_ENABLE #else # undef QMK_ESC_OUTPUT # define QMK_ESC_OUTPUT E6 // usually COL @@ -45,7 +49,7 @@ # undef QMK_SPEAKER # define QMK_SPEAKER B5 # define SOLENOID_PIN A1 -#endif // KEYBOARD_planck_light +#endif // KEYBOARD_planck_light #if defined(KEYBOARD_planck) # undef PRODUCT @@ -58,6 +62,7 @@ # endif #endif +#define ENCODER_DIRECTION_FLIP /* * MIDI options */ @@ -82,26 +87,26 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ #define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ -#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ /* default 3V ERM vibration motor voltage and library*/ #if FB_ERM_LRA == 0 -#define RATED_VOLTAGE 3 -#define V_RMS 2.3 -#define V_PEAK 3.30 +# define RATED_VOLTAGE 3 +# define V_RMS 2.3 +# define V_PEAK 3.30 /* Library Selection */ -#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +# define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ /* default 2V LRA voltage and library */ #elif FB_ERM_LRA == 1 -#define RATED_VOLTAGE 2 -#define V_RMS 2.0 -#define V_PEAK 2.85 -#define F_LRA 200 +# define RATED_VOLTAGE 2 +# define V_RMS 2.0 +# define V_PEAK 2.85 +# define F_LRA 200 /* Library Selection */ -#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +# define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ #endif diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 1c894c764..c3899cd03 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -1,20 +1,3 @@ -/* Copyright 2015-2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H #include "drashna.h" #ifdef RGBLIGHT_ENABLE @@ -46,6 +29,13 @@ enum planck_keycodes { # define PLNK_4 ET_RAIS #endif +/* + * The `LAYOUT_ortho_4x12_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ // clang-format off #define LAYOUT_ortho_4x12_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -54,7 +44,7 @@ enum planck_keycodes { ) \ LAYOUT_ortho_4x12_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_DEL, \ - KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) @@ -159,14 +149,14 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { #ifdef KEYBOARD_planck_ez case TH_LVL: if (record->event.pressed) { - keyboard_config.led_level++; - if (keyboard_config.led_level > 4) { + keyboard_config.led_level++; + if (keyboard_config.led_level > 4) { keyboard_config.led_level = 0; - } - planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); - planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); - eeconfig_update_kb(keyboard_config.raw); - layer_state_set_kb(layer_state); + } + planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4); + planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4); + eeconfig_update_kb(keyboard_config.raw); + layer_state_set_kb(layer_state); } break; #endif @@ -190,6 +180,31 @@ bool music_mask_user(uint16_t keycode) { #ifdef RGB_MATRIX_ENABLE +# ifdef KEYBOARD_planck_rev6 +// clang-format off +led_config_t g_led_config = { + { + // Key Matrix to LED Index + { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, + { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, + { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED } + }, { + // LED Index to Physical Position + {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} + }, { + // LED Index to Flag + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL + } +}; +// clange-format on +# endif + // clang-format off void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); @@ -219,7 +234,7 @@ void rgb_matrix_indicators_user(void) { rgb_matrix_config.enable # endif ) { - switch (biton32(layer_state)) { + switch (get_highest_layer(layer_state)) { case _GAMEPAD: rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); break; @@ -237,7 +252,7 @@ void rgb_matrix_indicators_user(void) { break; default: { bool mods_enabled = IS_LAYER_ON(_MODS); - switch (biton32(default_layer_state)) { + switch (get_highest_layer(default_layer_state)) { case _QWERTY: rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); break; @@ -268,7 +283,7 @@ void rgb_matrix_indicators_user(void) { } } - switch (biton32(default_layer_state)) { + switch (get_highest_layer(default_layer_state)) { case _QWERTY: rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); break; @@ -283,7 +298,9 @@ void rgb_matrix_indicators_user(void) { break; } if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { - if (!layer_state_cmp(layer_state, _ADJUST)) { rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); } + if (!layer_state_cmp(layer_state, _ADJUST)) { + rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); + } rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); } if ((this_mod | this_osm) & MOD_MASK_CTRL) { @@ -320,7 +337,7 @@ void matrix_init_keymap(void) { #ifdef ENCODER_ENABLE void encoder_update(bool clockwise) { - switch (biton32(layer_state)) { + switch (get_highest_layer(layer_state)) { case _RAISE: clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); break; @@ -363,7 +380,7 @@ void dip_update(uint8_t index, bool active) { } break; case 2: - keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; + keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = active; break; case 3: userspace_config.nuke_switch = active; @@ -376,7 +393,7 @@ void dip_update(uint8_t index, bool active) { layer_state_t layer_state_set_keymap(layer_state_t state) { planck_ez_left_led_off(); planck_ez_right_led_off(); - switch (biton32(state)) { + switch (get_highest_layer(state)) { case _LOWER: planck_ez_left_led_on(); break; diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index d4726b7a8..38d0d4517 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -1,36 +1,40 @@ -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -AUDIO_ENABLE = yes +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +TAP_DANCE_ENABLE = no +AUDIO_ENABLE = yes SPACE_CADET_ENABLE = no +NKRO_ENABLE = yes ifneq ($(strip $(KEYBOARD)), planck/rev6) - RGBLIGHT_ENABLE = yes - INDICATOR_LIGHTS = yes - RGBLIGHT_TWINKLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes + CONSOLE_ENABLE = no + COMMAND_ENABLE = no + ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) + RGBLIGHT_ENABLE = yes + endif + INDICATOR_LIGHTS = yes + RGBLIGHT_TWINKLE = yes + RGBLIGHT_STARTUP_ANIMATION = yes +else + CONSOLE_ENABLE = yes + COMMAND_ENABLE = yes + RGBLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = WS2812 endif ifeq ($(strip $(KEYBOARD)), planck/light) - RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = no - RGBLIGHT_STARTUP_ANIMATION = no - HAPTIC_ENABLE += SOLENOID + RGB_MATRIX_ENABLE = yes + RGBLIGHT_ENABLE = no + RGBLIGHT_STARTUP_ANIMATION = no + # HAPTIC_ENABLE += SOLENOID endif ifeq ($(strip $(KEYBOARD)), planck/ez) - RGBLIGHT_ENABLE = no - # SERIAL_LINK_ENABLE = yes - ENCODER_ENABLE = yes - RGB_MATRIX_ENABLE = IS31FL3737 - INDICATOR_LIGHTS = yes - RGBLIGHT_TWINKLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes -endif - -ifeq ($(strip $(PROTOCOL)), VUSB) - NKRO_ENABLE = no -else - NKRO_ENABLE = yes + RGBLIGHT_ENABLE = no + # SERIAL_LINK_ENABLE = yes + ENCODER_ENABLE = yes + RGB_MATRIX_ENABLE = IS31FL3737 + INDICATOR_LIGHTS = yes + RGBLIGHT_TWINKLE = yes + RGBLIGHT_STARTUP_ANIMATION = yes + CONSOLE_ENABLE = yes + COMMAND_ENABLE = yes endif diff --git a/layouts/community/ortho_5x12/drashna/keymap.c b/layouts/community/ortho_5x12/drashna/keymap.c index 86a78336c..0ee9dfb10 100644 --- a/layouts/community/ortho_5x12/drashna/keymap.c +++ b/layouts/community/ortho_5x12/drashna/keymap.c @@ -1,24 +1,12 @@ -/* Copyright 2015-2017 Jack Humbert - * Modified by KeyPCB for the Fractal keyboard - * Backlight isn't on the Fractal, so I've removed the keycode from the keymaps - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H #include "drashna.h" +/* + * The `LAYOUT_ortho_5x12_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ // clang-format off #define LAYOUT_ortho_5x12_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -27,9 +15,9 @@ K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A \ ) \ LAYOUT_ortho_5x12_wrapper( \ - KC_GRV, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ - KC_ESC, ALT_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, K2A, RALT_T(KC_QUOT), \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ + LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ + KC_C1R3, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, RCTL_T(K3A), KC_ENT, \ KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index 75affedd1..cae4b27ba 100644 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -5,16 +5,12 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no AUDIO_ENABLE = yes -ifeq ($(strip $(KEYBOARD)), fractal) - RGB_MATRIX_ENABLE = no - AUDIO_ENABLE = yes - RGBLIGHT_ENABLE = yes - RGBLIGHT_TWINKLE = yes - BOOTLOADER = qmk-dfu -endif - -ifeq ($(strip $(PROTOCOL)), VUSB) -NKRO_ENABLE = no -else NKRO_ENABLE = yes + +ifeq ($(strip $(KEYBOARD)), fractal) + RGB_MATRIX_ENABLE = no + AUDIO_ENABLE = yes + RGBLIGHT_ENABLE = yes + RGBLIGHT_TWINKLE = yes + BOOTLOADER = qmk-dfu endif diff --git a/users/drashna/config.h b/users/drashna/config.h index a0f92d8f3..6fafff860 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -7,7 +7,7 @@ #define USB_POLLING_INTERVAL_MS 1 #ifdef AUDIO_ENABLE -# if __GNUC__ > 7 +# if __GNUC__ > 5 # if __has_include("drashna_song_list.h") # include "drashna_song_list.h" # endif // if file exists @@ -29,11 +29,15 @@ #endif // !AUDIO_ENABLE #ifdef RGBLIGHT_ENABLE -# define RGBLIGHT_SLEEP # undef RGBLIGHT_ANIMATIONS -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT +# if defined(__AVR__) && !defined(__AVR_AT90USB1286__) +# define RGBLIGHT_SLEEP +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +# else +# define RGBLIGHT_ANIMATIONS +# endif #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index b48d837d0..71779a621 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -25,8 +25,6 @@ userspace_config_t userspace_config; # 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; if (pressed) { @@ -73,19 +71,22 @@ void bootmagic_lite(void) { } } +__attribute__((weak)) void keyboard_pre_init_keymap(void) {} + +void keyboard_pre_init_user(void) { + userspace_config.raw = eeconfig_read_user(); + keyboard_pre_init_keymap(); +} // Add reconfigurable functions here, for keymap customization // This allows for a global, userspace functions, and continued // customization of the keymap. Use _keymap instead of _user // functions in the keymaps -__attribute__((weak)) -void matrix_init_keymap(void) {} +__attribute__((weak)) void matrix_init_keymap(void) {} // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - userspace_config.raw = eeconfig_read_user(); - -#ifdef BOOTLOADER_CATERINA +#if defined(BOOTLOADER_CATERINA) && defined(__AVR__) DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); @@ -100,8 +101,7 @@ void matrix_init_user(void) { matrix_init_keymap(); } -__attribute__((weak)) -void keyboard_post_init_keymap(void) {} +__attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) @@ -110,10 +110,9 @@ void keyboard_post_init_user(void) { keyboard_post_init_keymap(); } -__attribute__((weak)) -void shutdown_keymap(void) {} +__attribute__((weak)) void shutdown_keymap(void) {} - void rgb_matrix_update_pwm_buffers(void); +void rgb_matrix_update_pwm_buffers(void); void shutdown_user(void) { #ifdef RGBLIGHT_ENABLE @@ -122,29 +121,22 @@ void shutdown_user(void) { rgblight_setrgb_red(); #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE - rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); + rgb_matrix_set_color_all(0xFF, 0x00, 0x00); rgb_matrix_update_pwm_buffers(); #endif // RGB_MATRIX_ENABLE shutdown_keymap(); } -__attribute__((weak)) -void suspend_power_down_keymap(void) {} +__attribute__((weak)) void suspend_power_down_keymap(void) {} -void suspend_power_down_user(void) { - suspend_power_down_keymap(); -} +void suspend_power_down_user(void) { suspend_power_down_keymap(); } -__attribute__((weak)) -void suspend_wakeup_init_keymap(void) {} +__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} -void suspend_wakeup_init_user(void) { - suspend_wakeup_init_keymap(); -} +void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); } -__attribute__((weak)) -void matrix_scan_keymap(void) {} +__attribute__((weak)) void matrix_scan_keymap(void) {} // No global matrix scan code, so just run keymap's matrix // scan function @@ -166,8 +158,7 @@ void matrix_scan_user(void) { matrix_scan_keymap(); } -__attribute__((weak)) -layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } +__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } // on layer change, no matter where the change was initiated // Then runs keymap's layer change check @@ -179,32 +170,27 @@ layer_state_t layer_state_set_user(layer_state_t state) { return layer_state_set_keymap(state); } -__attribute__((weak)) -layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } +__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } // Runs state check and changes underglow color and animation layer_state_t default_layer_state_set_user(layer_state_t state) { state = default_layer_state_set_keymap(state); #if 0 -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) state = default_layer_state_set_rgb(state); # endif // RGBLIGHT_ENABLE #endif return state; } -__attribute__((weak)) -void led_set_keymap(uint8_t usb_led) {} +__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} // Any custom LED code goes here. // So far, I only have keyboard specific code, // So nothing goes here. -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} +void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } -__attribute__((weak)) -void eeconfig_init_keymap(void) {} +__attribute__((weak)) void eeconfig_init_keymap(void) {} void eeconfig_init_user(void) { userspace_config.raw = 0; diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 0ccb7614f..0ba181760 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -16,7 +16,8 @@ along with this program. If not, see . */ #pragma once -#include "quantum.h" +#include QMK_KEYBOARD_H + #include "version.h" #include "eeprom.h" #include "wrappers.h" @@ -62,6 +63,7 @@ void led_set_keymap(uint8_t usb_led); void eeconfig_init_keymap(void); bool hasAllBitsInMask(uint8_t value, uint8_t mask); +// clang-format off typedef union { uint32_t raw; struct { @@ -73,6 +75,7 @@ typedef union { bool rgb_matrix_idle_anim :1; }; } userspace_config_t; +// clang-format on extern userspace_config_t userspace_config; diff --git a/users/drashna/font_gmk_bad.h b/users/drashna/font_gmk_bad.h new file mode 100644 index 000000000..c1c5c390a --- /dev/null +++ b/users/drashna/font_gmk_bad.h @@ -0,0 +1,241 @@ +#pragma once + +#ifdef __AVR__ +# include +# include +#elif defined(ESP8266) +# include +#else +# define PROGMEM +#endif + +// Corne 8x6 font with QMK Firmware Logo +// Online editor: https://helixfonteditor.netlify.com/ + +// clang-format off +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x10, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xC0, 0xE0, 0xF0, 0xF0, 0x70, + 0x38, 0x38, 0x38, 0x78, 0x70, 0xF0, + 0xE0, 0xE0, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xF0, 0xF8, + 0xF8, 0xF8, 0xF8, 0x00, 0x00, 0x00, + 0x80, 0xE0, 0xF8, 0xF8, 0xF8, 0xF8, + 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x00, + 0x80, 0xE0, 0xF0, 0xF8, 0x78, 0x38, + 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xF8, 0xF8, 0xF8, 0x38, 0x38, + 0x38, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xFC, 0xFC, + 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, + 0xFF, 0xFF, 0xFF, 0xC1, 0x80, 0x00, + 0x00, 0x38, 0x38, 0xB8, 0xB8, 0xF9, + 0xF9, 0xF8, 0x38, 0x00, 0x00, 0x00, + 0x00, 0xC0, 0xF8, 0xFF, 0xFF, 0x1F, + 0x01, 0x3F, 0xFF, 0xFF, 0xF0, 0xFE, + 0x7F, 0x0F, 0x03, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xFF, 0xFF, 0xFF, 0x3F, 0x1E, 0x7F, + 0xFF, 0xFF, 0xF3, 0xC1, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xFF, 0xFF, 0xFF, 0x3F, 0x1C, 0x1C, + 0x9C, 0xFF, 0xFF, 0xF3, 0xE1, 0x00, + 0x00, 0x00, 0x00, 0xF0, 0xFC, 0xFE, + 0xFF, 0x0F, 0x07, 0x07, 0x8E, 0xFF, + 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0xF0, 0xFC, 0xFE, 0xFF, 0x8F, + 0x07, 0x07, 0x8E, 0xFF, 0xFF, 0xFF, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x03, 0x03, 0x03, 0x07, + 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x07, 0x07, 0x07, 0x01, 0x00, + 0x00, 0x00, 0x07, 0x07, 0x07, 0x01, + 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x07, 0x07, 0x07, 0x06, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, + 0x07, 0x07, 0x07, 0x03, 0x07, 0x07, + 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, + 0x07, 0x03, 0x07, 0x07, 0x07, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, + 0x07, 0x07, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/users/drashna/hue_manitee_font.h b/users/drashna/hue_manitee_font.h new file mode 100644 index 000000000..72d50f7a6 --- /dev/null +++ b/users/drashna/hue_manitee_font.h @@ -0,0 +1,241 @@ +#pragma once + +#ifdef __AVR__ +# include +# include +#elif defined(ESP8266) +# include +#else +# define PROGMEM +#endif + +// Corne 8x6 font with QMK Firmware Logo +// Online editor: https://helixfonteditor.netlify.com/ + +// clang-format off +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x10, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, + 0x90, 0x70, 0xE8, 0xA8, 0xE4, 0xC4, + 0xC4, 0xA0, 0xE4, 0xB0, 0xDC, 0xE4, + 0xFC, 0xFC, 0xFC, 0xFC, 0x3C, 0x3C, + 0xFC, 0xF8, 0xF0, 0xF0, 0xE0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, + 0xFC, 0xF6, 0xF7, 0xEF, 0xFF, 0x87, + 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, + 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, + 0xFF, 0x07, 0x1F, 0x1F, 0x19, 0x15, + 0xF7, 0x16, 0x1A, 0x1B, 0x16, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0C, 0x0C, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0xC0, 0xC0, + 0x00, 0x00, 0x03, 0x03, 0xFF, 0xFF, + 0x03, 0x03, 0x00, 0x00, 0xC0, 0xC0, + 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0xFC, + 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x30, 0x30, 0xCC, 0xCC, + 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x03, 0x07, 0x07, 0x07, 0x07, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, + 0x03, 0x00, 0x00, 0x02, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 6eb21d2f2..2f79ad11c 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -2,11 +2,9 @@ uint16_t copy_paste_timer; -__attribute__((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -__attribute__((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } // Defines actions tor my global custom keycodes. Defined in drashna.h file // Then runs the _keymap's record handier if not processed here @@ -23,7 +21,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case KC_QWERTY ... KC_WORKMAN: if (record->event.pressed) { - uint8_t mods = mod_config(get_mods()|get_oneshot_mods()); + 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) { diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index a9af0566e..52ec61c22 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -12,9 +12,9 @@ void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight #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 +# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL # else -# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN +# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN # endif #endif @@ -23,68 +23,68 @@ static uint32_t hypno_timer; * 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 && biton32(layer_state) == 0) { + 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 +95,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 +105,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); } @@ -154,19 +154,19 @@ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rg if (light->life) { light->life -= 1; - if (biton32(layer_state) == 0) { + if (get_highest_layer(layer_state) == 0) { sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); } light->timer = timer_read(); } else { - if (light->enabled && biton32(layer_state) == 0) { + if (light->enabled && get_highest_layer(layer_state) == 0) { rgblight_sethsv_default_helper(light_index); } litup = light->enabled = false; } } } - if (litup && biton32(layer_state) == 0) { + if (litup && get_highest_layer(layer_state) == 0) { rgblight_set(); } } @@ -211,8 +211,8 @@ void start_rgb_light(void) { rgblight_sethsv_at(light->hue, 255, light->life, light_index); } -#endif -#endif // RGBLIGHT_ENABLE +# endif +#endif // RGBLIGHT_ENABLE bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { uint16_t temp_keycode = keycode; @@ -259,7 +259,9 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { 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); } + if (userspace_config.rgb_matrix_idle_anim) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); + } } #endif break; @@ -281,7 +283,9 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { is_eeprom_updated = true; } #endif - if (is_eeprom_updated) { eeconfig_update_user(userspace_config.raw); } + if (is_eeprom_updated) { + eeconfig_update_user(userspace_config.raw); + } } break; } @@ -290,7 +294,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { void keyboard_post_init_rgb(void) { #if defined(RGBLIGHT_ENABLE) -# if defined(RGBLIGHT_STARTUP_ANIMATION) +# if defined(RGBLIGHT_STARTUP_ANIMATION) bool is_enabled = rgblight_config.enable; if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); @@ -309,13 +313,13 @@ void keyboard_post_init_rgb(void) { rgblight_disable_noeeprom(); } -# endif +# 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); - } + if (userspace_config.rgb_matrix_idle_anim) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); + } #endif } @@ -337,67 +341,70 @@ void matrix_scan_rgb(void) { #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) { #ifdef RGBLIGHT_ENABLE if (userspace_config.rgb_layer_change) { - switch (biton32(state)) { + switch (get_highest_layer(state)) { case _MACROS: - rgblight_sethsv_noeeprom_orange(); - userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); + rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3); break; case _MEDIA: - rgblight_sethsv_noeeprom_chartreuse(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); + rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); break; case _GAMEPAD: - rgblight_sethsv_noeeprom_orange(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); + rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2); break; case _DIABLO: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3); break; case _RAISE: - rgblight_sethsv_noeeprom_yellow(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3); break; case _LOWER: - rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3); break; case _ADJUST: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); break; default: // for any other layers, or the default layer - switch (biton32(default_layer_state)) { + { + uint8_t mode = get_highest_layer(state) == _MODS ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT; + switch (get_highest_layer(default_layer_state)) { case _COLEMAK: - rgblight_sethsv_noeeprom_magenta(); + rgblight_set_hsv_and_mode(HSV_MAGENTA, mode); break; case _DVORAK: - rgblight_sethsv_noeeprom_springgreen(); + rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, mode); break; case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); + rgblight_set_hsv_and_mode(HSV_GOLDENROD, mode); break; case _NORMAN: - rgblight_sethsv_noeeprom_coral(); + rgblight_set_hsv_and_mode(HSV_CORAL, mode); break; case _MALTRON: - rgblight_sethsv_noeeprom_yellow(); + rgblight_set_hsv_and_mode(HSV_YELLOW, mode); break; case _EUCALYN: - rgblight_sethsv_noeeprom_pink(); + rgblight_set_hsv_and_mode(HSV_PINK, mode); break; case _CARPLAX: - rgblight_sethsv_noeeprom_blue(); + rgblight_set_hsv_and_mode(HSV_BLUE, mode); break; default: - rgblight_sethsv_noeeprom_cyan(); + rgblight_set_hsv_and_mode(HSV_CYAN, mode); break; } - biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it break; + } } } #endif // RGBLIGHT_ENABLE @@ -408,6 +415,7 @@ layer_state_t layer_state_set_rgb(layer_state_t 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) { diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 7e34c93c1..50b73c1c3 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -20,13 +20,13 @@ layer_state_t layer_state_set_rgb(layer_state_t state); layer_state_t default_layer_state_set_rgb(layer_state_t state); #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_TWINKLE) -void scan_rgblight_fadeout(void); +void scan_rgblight_fadeout(void); #endif #if defined(RGBLIGHT_ENABLE) -void rgblight_sethsv_default_helper(uint8_t index); +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_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/rgblight_breathe_table.h b/users/drashna/rgblight_breathe_table.h index 05d347fcd..4c6ae38fa 100644 --- a/users/drashna/rgblight_breathe_table.h +++ b/users/drashna/rgblight_breathe_table.h @@ -1,9 +1,10 @@ #ifndef RGBLIGHT_EFFECT_BREATHE_TABLE #define RGBLIGHT_EFFECT_BREATHE_TABLE +// clang-format off const uint8_t rgblight_effect_breathe_table[] PROGMEM = { - /* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */ - /* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ +/* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */ +/* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 0x44, 0x45, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4e, @@ -110,7 +111,8 @@ const uint8_t rgblight_effect_breathe_table[] PROGMEM = { 0x4e, 0x48 #endif /* 64 bytes table */ }; +// clang-format on -static const int table_scale = 256/sizeof(rgblight_effect_breathe_table); +static const int table_scale = 256 / sizeof(rgblight_effect_breathe_table); #endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 1b5a86385..882857fc8 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,16 +1,16 @@ SRC += drashna.c \ process_records.c -LINK_TIME_OPTIMIZATION_ENABLE = yes -SPACE_CADET_ENABLE = no +LTO_ENABLE = yes +SPACE_CADET_ENABLE = no ifneq ($(strip $(NO_SECRETS)), yes) - ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") - SRC += secrets.c - endif - ifeq ($(strip $(NO_SECRETS)), lite) - OPT_DEFS += -DNO_SECRETS - endif + ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c + endif + ifeq ($(strip $(NO_SECRETS)), lite) + OPT_DEFS += -DNO_SECRETS + endif endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) @@ -52,3 +52,10 @@ endif ifeq ($(strip $(MAKE_BOOTLOADER)), yes) OPT_DEFS += -DMAKE_BOOTLOADER endif + +# At least until build.mk or the like drops, this is here to prevent +# VUSB boards from enabling NKRO, as they do not support it. Ideally +# this should be handled per keyboard, but until that happens ... +ifeq ($(strip $(PROTOCOL)), VUSB) + NKRO_ENABLE = no +endif \ No newline at end of file diff --git a/users/drashna/template.c b/users/drashna/template.c index d90e6bdec..833447daa 100644 --- a/users/drashna/template.c +++ b/users/drashna/template.c @@ -1,124 +1,82 @@ #include "template.h" - // Add reconfigurable functions here, for keymap customization // This allows for a global, userspace functions, and continued // customization of the keymap. Use _keymap instead of _user // functions in the keymaps -__attribute__ ((weak)) -void matrix_init_keymap(void) {} +__attribute__((weak)) void matrix_init_keymap(void) {} // Call user matrix init, then call the keymap's init function -void matrix_init_user(void) { - matrix_init_keymap(); -} +void matrix_init_user(void) { matrix_init_keymap(); } - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} +__attribute__((weak)) void matrix_scan_keymap(void) {} // No global matrix scan code, so just run keymap's matix // scan function -void matrix_scan_user(void) { - matrix_scan_keymap(); -} +void matrix_scan_user(void) { matrix_scan_keymap(); } - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} +__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } // Defines actions tor my global custom keycodes. Defined in drashna.h file // Then runs the _keymap's recod handier if not processed here, // And use "NEWPLACEHOLDER" for new safe range bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - case KC_MAKE: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP -#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) - ":dfu" + switch (keycode) { + case KC_MAKE: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP +#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) + ":dfu" #elif defined(BOOTLOADER_HALFKAY) - ":teensy" + ":teensy" #elif defined(BOOTLOADER_CATERINA) - ":avrdude" + ":avrdude" #endif - SS_TAP(X_ENTER)); + SS_TAP(X_ENTER)); + } + return false; + break; + + case VRSN: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; } - return false; - break; - - case VRSN: - if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - } - return process_record_keymap(keycode, record); -} - - -__attribute__ ((weak)) -layer_state_t layer_state_set_keymap (layer_state_t state) { - return state; -} - -layer_state_t layer_state_set_user (layer_state_t state) { - return layer_state_set_keymap (state); + return process_record_keymap(keycode, record); } +__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } +layer_state_t layer_state_set_user(layer_state_t state) { return layer_state_set_keymap(state); } -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - -void led_set_user(uint8_t usb_led) { - led_set_keymap(usb_led); -} - +__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} +void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } -__attribute__ ((weak)) -void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) -{ - suspend_power_down_keymap(); -} - +__attribute__((weak)) void suspend_power_down_keymap(void) {} +void suspend_power_down_user(void) { suspend_power_down_keymap(); } -__attribute__ ((weak)) -void suspend_wakeup_init_keymap(void) {} +__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} -void suspend_wakeup_init_user(void) -{ - suspend_wakeup_init_keymap(); - #ifdef KEYBOARD_ergodox_ez - wait_ms(10); - #endif +void suspend_wakeup_init_user(void) { + suspend_wakeup_init_keymap(); +#ifdef KEYBOARD_ergodox_ez + wait_ms(10); +#endif } +__attribute__((weak)) void startup_keymap(void) {} - -__attribute__ ((weak)) -void startup_keymap(void) {} - -void startup_user (void) { - #ifdef RGBLIGHT_ENABLE +void startup_user(void) { +#ifdef RGBLIGHT_ENABLE matrix_init_rgb(); - #endif //RGBLIGHT_ENABLE - startup_keymap(); +#endif // RGBLIGHT_ENABLE + startup_keymap(); } +__attribute__((weak)) void shutdown_keymap(void) {} - -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -void shutdown_user (void) { - shutdown_keymap(); -} +void shutdown_user(void) { shutdown_keymap(); } diff --git a/users/drashna/template.h b/users/drashna/template.h index dd1c48760..178f96e22 100644 --- a/users/drashna/template.h +++ b/users/drashna/template.h @@ -1,7 +1,6 @@ -#ifndef USERSPACE -#define USERSPACE +#pragma once -#include "quantum.h" +#include QMK_KEYBOARD_H #include "version.h" #include "eeprom.h" @@ -9,10 +8,8 @@ #define BASE 0 enum custom_keycodes { - VRSN = SAFE_RANGE, // can always be here - KC_MAKE, - KC_RESET, - NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes + VRSN = SAFE_RANGE, // can always be here + KC_MAKE, + KC_RESET, + NEWPLACEHOLDER // use "NEWPLACEHOLDER for keymap specific codes }; - -#endif -- cgit v1.2.3-70-g09d2