diff options
Diffstat (limited to 'keyboards')
| -rw-r--r-- | keyboards/crkbd/keymaps/drashna/config.h | 59 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/drashna/keymap.c | 289 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/drashna/rules.mk | 5 | ||||
| -rw-r--r-- | keyboards/gergo/keymaps/drashna/keymap.c | 3 | ||||
| -rw-r--r-- | keyboards/keebio/iris/keymaps/drashna/config.h | 53 | ||||
| -rw-r--r-- | keyboards/keebio/iris/keymaps/drashna/keymap.c | 11 | ||||
| -rw-r--r-- | keyboards/keebio/iris/keymaps/drashna/rules.mk | 2 | ||||
| -rw-r--r-- | keyboards/orthodox/keymaps/drashna/keymap.c | 3 |
8 files changed, 229 insertions, 196 deletions
diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index 724d52c38..d35f723da 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h | |||
| @@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 20 | 20 | ||
| 21 | #pragma once | 21 | #pragma once |
| 22 | 22 | ||
| 23 | |||
| 24 | /* Select hand configuration */ | 23 | /* Select hand configuration */ |
| 25 | 24 | ||
| 26 | // #define MASTER_LEFT | 25 | // #define MASTER_LEFT |
| @@ -36,52 +35,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 36 | // #define TAPPING_TERM 100 | 35 | // #define TAPPING_TERM 100 |
| 37 | 36 | ||
| 38 | #ifdef RGBLIGHT_ENABLE | 37 | #ifdef RGBLIGHT_ENABLE |
| 39 | # undef RGBLED_NUM | 38 | # undef RGBLED_NUM |
| 40 | # define RGBLED_NUM 27 | 39 | # define RGBLED_NUM 27 |
| 41 | 40 | ||
| 42 | # define RGBLIGHT_HUE_STEP 8 | 41 | # define RGBLIGHT_HUE_STEP 8 |
| 43 | # define RGBLIGHT_SAT_STEP 8 | 42 | # define RGBLIGHT_SAT_STEP 8 |
| 44 | # define RGBLIGHT_VAL_STEP 8 | 43 | # define RGBLIGHT_VAL_STEP 5 |
| 45 | # define RGBLIGHT_LIMIT_VAL 100 | 44 | # define RGBLIGHT_LIMIT_VAL 150 |
| 46 | #endif | 45 | #endif |
| 47 | 46 | ||
| 48 | #ifdef RGB_MATRIX_ENABLE | 47 | #ifdef RGB_MATRIX_ENABLE |
| 49 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses | 48 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses |
| 50 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended | 49 | // # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) |
| 51 | # define RGB_MATRIX_FRAMEBUFFER_EFFECTS | 50 | // # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 52 | 51 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended | |
| 53 | // # define DISABLE_RGB_MATRIX_ALPHAS_MODS | 52 | // # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) |
| 54 | # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | 53 | // # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) |
| 55 | # define DISABLE_RGB_MATRIX_BREATHING | 54 | # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 |
| 56 | # define DISABLE_RGB_MATRIX_CYCLE_ALL | 55 | # define RGB_MATRIX_HUE_STEP 8 |
| 57 | # define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | 56 | # define RGB_MATRIX_SAT_STEP 8 |
| 58 | # define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | 57 | # define RGB_MATRIX_VAL_STEP 5 |
| 59 | // # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN | 58 | # define RGB_MATRIX_SPD_STEP 10 |
| 60 | // # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
| 61 | # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 62 | # define DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 63 | # define DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 64 | # define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 65 | // # define DISABLE_RGB_MATRIX_RAINDROPS | ||
| 66 | // # define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 67 | // # define DISABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 68 | // # define DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 69 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 70 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 71 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 72 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 73 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 74 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 75 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 76 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 77 | # define DISABLE_RGB_MATRIX_SPLASH | ||
| 78 | // # define DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 79 | # define DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 80 | # define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 81 | #endif | 59 | #endif |
| 82 | 60 | ||
| 83 | #ifdef AUDIO_ENABLE | 61 | #ifdef AUDIO_ENABLE |
| 84 | # define B6_AUDIO | 62 | # define B6_AUDIO |
| 85 | // #define NO_MUSIC_MODE | 63 | // #define NO_MUSIC_MODE |
| 86 | #endif | 64 | #endif |
| 87 | 65 | ||
| @@ -92,4 +70,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 92 | // #define OLED_FONT_WIDTH 5 | 70 | // #define OLED_FONT_WIDTH 5 |
| 93 | // #define OLED_FONT_HEIGHT 7 | 71 | // #define OLED_FONT_HEIGHT 7 |
| 94 | 72 | ||
| 73 | #define OLED_DISABLE_TIMEOUT | ||
| 95 | #define TAPPING_TERM_PER_KEY | 74 | #define TAPPING_TERM_PER_KEY |
diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index af0bc0d9a..693c53b16 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c | |||
| @@ -2,17 +2,16 @@ | |||
| 2 | #include "drashna.h" | 2 | #include "drashna.h" |
| 3 | 3 | ||
| 4 | extern keymap_config_t keymap_config; | 4 | extern keymap_config_t keymap_config; |
| 5 | extern uint8_t is_master; | 5 | extern uint8_t is_master; |
| 6 | 6 | ||
| 7 | #ifdef RGBLIGHT_ENABLE | 7 | #ifdef RGBLIGHT_ENABLE |
| 8 | //Following line allows macro to read current RGB settings | 8 | // Following line allows macro to read current RGB settings |
| 9 | extern rgblight_config_t rgblight_config; | 9 | extern rgblight_config_t rgblight_config; |
| 10 | #endif | 10 | #endif |
| 11 | 11 | ||
| 12 | enum crkbd_keycodes { | 12 | enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; |
| 13 | RGBRST = NEW_SAFE_RANGE | ||
| 14 | }; | ||
| 15 | 13 | ||
| 14 | // clang-format off | ||
| 16 | #define LAYOUT_crkbd_base( \ | 15 | #define LAYOUT_crkbd_base( \ |
| 17 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 16 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| 18 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 17 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
| @@ -103,60 +102,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 103 | _______, KC_NUKE, _______, _______, TG_MODS, _______ | 102 | _______, KC_NUKE, _______, _______, TG_MODS, _______ |
| 104 | ) | 103 | ) |
| 105 | }; | 104 | }; |
| 106 | 105 | // clang-format on | |
| 107 | void matrix_init_keymap(void) { | ||
| 108 | #ifndef CONVERT_TO_PROTON_C | ||
| 109 | setPinOutput(D5); | ||
| 110 | writePinHigh(D5); | ||
| 111 | |||
| 112 | setPinOutput(B0); | ||
| 113 | writePinHigh(B0); | ||
| 114 | #endif | ||
| 115 | } | ||
| 116 | |||
| 117 | 106 | ||
| 118 | #ifdef OLED_DRIVER_ENABLE | 107 | #ifdef OLED_DRIVER_ENABLE |
| 119 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | 108 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } |
| 120 | if (is_master) { | 109 | uint16_t oled_timer; |
| 121 | return OLED_ROTATION_270; | ||
| 122 | } else { | ||
| 123 | return rotation; | ||
| 124 | } | ||
| 125 | } | ||
| 126 | |||
| 127 | void render_crkbd_logo(void) { | ||
| 128 | static const char PROGMEM crkbd_logo[] = { | ||
| 129 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
| 130 | 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, | ||
| 131 | 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, | ||
| 132 | 0}; | ||
| 133 | oled_write_P(crkbd_logo, false); | ||
| 134 | } | ||
| 135 | 110 | ||
| 136 | #define KEYLOG_LEN (int)(32 / OLED_FONT_WIDTH) | 111 | char keylog_str[5] = {}; |
| 137 | char keylog_str[KEYLOG_LEN] = {}; | 112 | uint8_t keylogs_str_idx = 0; |
| 138 | uint8_t keylogs_str_idx = 0; | 113 | uint16_t log_timer = 0; |
| 139 | uint16_t log_timer = 0; | ||
| 140 | 114 | ||
| 141 | const char code_to_name[60] = { | 115 | 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', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; |
| 142 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', | ||
| 143 | 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', | ||
| 144 | 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', | ||
| 145 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', | ||
| 146 | 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', | ||
| 147 | '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; | ||
| 148 | 116 | ||
| 149 | void add_keylog(uint16_t keycode) { | 117 | void add_keylog(uint16_t keycode) { |
| 150 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || | 118 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { |
| 151 | (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } | 119 | keycode = keycode & 0xFF; |
| 120 | } | ||
| 152 | 121 | ||
| 153 | for (uint8_t i = KEYLOG_LEN - 1; i > 0; i--) { | 122 | for (uint8_t i = 4; i > 0; i--) { |
| 154 | keylog_str[i] = keylog_str[i - 1]; | 123 | keylog_str[i] = keylog_str[i - 1]; |
| 155 | } | 124 | } |
| 156 | if (keycode < 60) { | 125 | if (keycode < 60) { |
| 157 | keylog_str[0] = code_to_name[keycode]; | 126 | keylog_str[0] = code_to_name[keycode]; |
| 158 | } | 127 | } |
| 159 | keylog_str[KEYLOG_LEN] = 0; | 128 | keylog_str[5] = 0; |
| 160 | 129 | ||
| 161 | log_timer = timer_read(); | 130 | log_timer = timer_read(); |
| 162 | } | 131 | } |
| @@ -167,94 +136,153 @@ void update_log(void) { | |||
| 167 | } | 136 | } |
| 168 | } | 137 | } |
| 169 | 138 | ||
| 170 | |||
| 171 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 139 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 172 | if (record->event.pressed) { add_keylog(keycode); } | 140 | if (record->event.pressed) { |
| 141 | add_keylog(keycode); | ||
| 142 | oled_timer = timer_read(); | ||
| 143 | } | ||
| 173 | return true; | 144 | return true; |
| 174 | } | 145 | } |
| 175 | 146 | ||
| 176 | void render_status(void) { | 147 | void render_rgb_status(void) { |
| 148 | oled_write_ln("RGB:", false); | ||
| 149 | static char temp[20] = {0}; | ||
| 150 | 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); | ||
| 151 | oled_write(temp, false); | ||
| 152 | } | ||
| 177 | 153 | ||
| 178 | oled_write_P(PSTR("Layer"), false); | 154 | void render_status_main(void) { |
| 179 | switch (biton32(layer_state)) { | 155 | /* Show Keyboard Layout */ |
| 180 | case 0: | 156 | oled_write("Lyout", false); |
| 181 | oled_write_P(PSTR("Base "), false); | 157 | switch (biton32(default_layer_state)) { |
| 158 | case _QWERTY: | ||
| 159 | oled_write(" QRTY", false); | ||
| 182 | break; | 160 | break; |
| 183 | case _RAISE: | 161 | case _COLEMAK: |
| 184 | oled_write_P(PSTR("Raise"), false); | 162 | oled_write(" COLE", false); |
| 185 | break; | 163 | break; |
| 186 | case _LOWER: | 164 | case _DVORAK: |
| 187 | oled_write_P(PSTR("Lower"), false); | 165 | oled_write(" DVRK", false); |
| 188 | break; | 166 | break; |
| 189 | case _ADJUST: | 167 | case _WORKMAN: |
| 190 | oled_write_P(PSTR("Adjst"), false); | 168 | oled_write(" WKMN", false); |
| 191 | break; | 169 | break; |
| 192 | default: | 170 | case _NORMAN: |
| 193 | oled_write_P(PSTR("Unkn "), false); | 171 | oled_write(" NORM", false); |
| 172 | break; | ||
| 173 | case _MALTRON: | ||
| 174 | oled_write(" MLTN", false); | ||
| 175 | break; | ||
| 176 | case _EUCALYN: | ||
| 177 | oled_write(" ECLN", false); | ||
| 178 | break; | ||
| 179 | case _CARPLAX: | ||
| 180 | oled_write(" CRPX", false); | ||
| 194 | break; | 181 | break; |
| 195 | } | 182 | } |
| 196 | oled_write_P(PSTR("Lyout"), false); | 183 | |
| 184 | /* Show Lock Status (only work on master side) */ | ||
| 185 | uint8_t led_usb_state = host_keyboard_leds(); | ||
| 186 | oled_write("Lock:", false); | ||
| 187 | oled_write(" ", false); | ||
| 188 | oled_write_ln("NUM", led_usb_state & (1 << USB_LED_NUM_LOCK)); | ||
| 189 | oled_write(" ", false); | ||
| 190 | oled_write("CAPS", led_usb_state & (1 << USB_LED_CAPS_LOCK)); | ||
| 191 | oled_write(" ", false); | ||
| 192 | oled_write("SCRL", led_usb_state & (1 << USB_LED_SCROLL_LOCK)); | ||
| 193 | |||
| 194 | /* Show Alt-Gui Swap options */ | ||
| 195 | oled_write("BTMGK", false); | ||
| 196 | oled_write(" ", false); | ||
| 197 | oled_write_ln("Win", !keymap_config.swap_lalt_lgui); | ||
| 198 | oled_write(" ", false); | ||
| 199 | oled_write_ln("Mac", keymap_config.swap_lalt_lgui); | ||
| 200 | |||
| 201 | # if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | ||
| 202 | /* Show RGB Options */ | ||
| 203 | render_rgb_status(); | ||
| 204 | # endif | ||
| 205 | |||
| 206 | oled_write(keylog_str, false); | ||
| 207 | } | ||
| 208 | |||
| 209 | void render_status_secondary(void) { | ||
| 210 | /* Show Keyboard Layout */ | ||
| 211 | oled_write("Lyout", false); | ||
| 197 | switch (biton32(default_layer_state)) { | 212 | switch (biton32(default_layer_state)) { |
| 198 | case _QWERTY: | 213 | case _QWERTY: |
| 199 | oled_write_P(PSTR("QWRTY"), false); | 214 | oled_write(" QRTY", false); |
| 200 | break; | 215 | break; |
| 201 | case _COLEMAK: | 216 | case _COLEMAK: |
| 202 | oled_write_P(PSTR("COLMK"), false); | 217 | oled_write(" COLE", false); |
| 203 | break; | 218 | break; |
| 204 | case _DVORAK: | 219 | case _DVORAK: |
| 205 | oled_write_P(PSTR("DVRAK"), false); | 220 | oled_write(" DVRK", false); |
| 206 | break; | 221 | break; |
| 207 | case _WORKMAN: | 222 | case _WORKMAN: |
| 208 | oled_write_P(PSTR("WRKMN"), false); | 223 | oled_write(" WKMN", false); |
| 209 | break; | 224 | break; |
| 210 | case _NORMAN: | 225 | case _NORMAN: |
| 211 | oled_write_P(PSTR("NORMN"), false); | 226 | oled_write(" NORM", false); |
| 212 | break; | 227 | break; |
| 213 | case _MALTRON: | 228 | case _MALTRON: |
| 214 | oled_write_P(PSTR("MLTRN"), false); | 229 | oled_write(" MLTN", false); |
| 215 | break; | 230 | break; |
| 216 | case _EUCALYN: | 231 | case _EUCALYN: |
| 217 | oled_write_P(PSTR("ECLYN"), false); | 232 | oled_write(" ECLN", false); |
| 218 | break; | 233 | break; |
| 219 | case _CARPLAX: | 234 | case _CARPLAX: |
| 220 | oled_write_P(PSTR("CRPLX"), false); | 235 | oled_write(" CRPX", false); |
| 221 | break; | 236 | break; |
| 222 | } | 237 | } |
| 223 | 238 | ||
| 224 | uint8_t modifiers = get_mods(); | 239 | /* Show Activate layer */ |
| 225 | uint8_t one_shot = get_oneshot_mods(); | 240 | oled_write("Layer", false); |
| 226 | 241 | switch (biton32(layer_state)) { | |
| 227 | oled_write_P(PSTR("Mods:"), false); | 242 | case _RAISE: |
| 228 | oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false); | 243 | oled_write("Raise", false); |
| 229 | oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false); | 244 | break; |
| 230 | oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false); | 245 | case _LOWER: |
| 231 | oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false); | 246 | oled_write("Lower", false); |
| 232 | 247 | break; | |
| 248 | case _ADJUST: | ||
| 249 | oled_write("Adjst", false); | ||
| 250 | break; | ||
| 251 | default: | ||
| 252 | oled_write("Dflt ", false); | ||
| 253 | break; | ||
| 254 | } | ||
| 233 | 255 | ||
| 234 | oled_write_P(PSTR("BTMGK"), false); | 256 | /* Show Mod */ |
| 257 | uint8_t modifiers = get_mods() | get_oneshot_mods(); | ||
| 235 | 258 | ||
| 236 | if (keymap_config.swap_lalt_lgui) { | 259 | oled_write("Mods:", false); |
| 237 | oled_write_P(PSTR(" Mac "), false); | 260 | oled_write(" ", false); |
| 238 | } else { | 261 | oled_write_ln("SFT", (modifiers & MOD_MASK_SHIFT)); |
| 239 | oled_write_P(PSTR(" Win "), false); | 262 | oled_write(" ", false); |
| 240 | } | 263 | oled_write_ln("CTL", (modifiers & MOD_MASK_CTRL)); |
| 264 | oled_write(" ", false); | ||
| 265 | oled_write_ln("ALT", (modifiers & MOD_MASK_ALT)); | ||
| 266 | oled_write(" ", false); | ||
| 267 | oled_write_ln("GUI", (modifiers & MOD_MASK_GUI)); | ||
| 241 | 268 | ||
| 242 | uint8_t led_usb_state = host_keyboard_leds(); | 269 | # if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| 243 | oled_write_P(PSTR("Lock:"), false); | 270 | render_rgb_status(); |
| 244 | oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR(" "), false); | 271 | # endif |
| 245 | oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR(" "), false); | ||
| 246 | oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR(" SCRL") : PSTR(" "), false); | ||
| 247 | 272 | ||
| 273 | /* Show logged Keys */ | ||
| 248 | oled_write(keylog_str, false); | 274 | oled_write(keylog_str, false); |
| 249 | } | 275 | } |
| 250 | 276 | ||
| 251 | |||
| 252 | void oled_task_user(void) { | 277 | void oled_task_user(void) { |
| 278 | if (timer_elapsed(oled_timer) > 60000) { | ||
| 279 | oled_off(); | ||
| 280 | return; | ||
| 281 | } | ||
| 253 | if (is_master) { | 282 | if (is_master) { |
| 254 | render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) | 283 | render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) |
| 255 | } else { | 284 | } else { |
| 256 | render_crkbd_logo(); | 285 | render_status_secondary(); |
| 257 | oled_scroll_left(); // Turns on scrolling | ||
| 258 | } | 286 | } |
| 259 | } | 287 | } |
| 260 | 288 | ||
| @@ -272,57 +300,82 @@ uint16_t get_tapping_term(uint16_t keycode) { | |||
| 272 | 300 | ||
| 273 | #ifdef RGB_MATRIX_ENABLE | 301 | #ifdef RGB_MATRIX_ENABLE |
| 274 | 302 | ||
| 303 | static bool is_suspended; | ||
| 304 | static bool rgb_matrix_enabled; | ||
| 305 | |||
| 275 | void suspend_power_down_keymap(void) { | 306 | void suspend_power_down_keymap(void) { |
| 276 | rgb_matrix_set_suspend_state(true); | 307 | rgb_matrix_set_suspend_state(true); |
| 308 | if (!is_suspended) { | ||
| 309 | is_suspended = true; | ||
| 310 | rgb_matrix_enabled = (bool)rgb_matrix_config.enable; | ||
| 311 | rgb_matrix_disable_noeeprom(); | ||
| 312 | } | ||
| 277 | } | 313 | } |
| 278 | 314 | ||
| 279 | void suspend_wakeup_init_keymap(void) { | 315 | void suspend_wakeup_init_keymap(void) { |
| 280 | rgb_matrix_set_suspend_state(false); | 316 | rgb_matrix_set_suspend_state(false); |
| 317 | is_suspended = false; | ||
| 318 | if (rgb_matrix_enabled) { | ||
| 319 | rgb_matrix_enable_noeeprom(); | ||
| 320 | } | ||
| 281 | } | 321 | } |
| 282 | |||
| 283 | void rgb_matrix_indicators_user(void) { | 322 | void rgb_matrix_indicators_user(void) { |
| 284 | if ( userspace_config.rgb_layer_change && | 323 | if (userspace_config.rgb_layer_change && |
| 285 | #ifdef RGB_DISABLE_WHEN_USB_SUSPENDED | 324 | # ifdef RGB_DISABLE_WHEN_USB_SUSPENDED |
| 286 | !g_suspend_state && | 325 | !g_suspend_state && |
| 287 | #endif | 326 | # endif |
| 288 | #if defined(RGBLIGHT_ENABLE) | 327 | # if defined(RGBLIGHT_ENABLE) |
| 289 | (!rgblight_config.enable && rgb_matrix_config.enable) | 328 | (!rgblight_config.enable && rgb_matrix_config.enable) |
| 290 | #else | 329 | # else |
| 291 | rgb_matrix_config.enable | 330 | rgb_matrix_config.enable |
| 292 | #endif | 331 | # endif |
| 293 | ) { | 332 | ) { |
| 294 | switch (biton32(layer_state)) { | 333 | switch (biton32(layer_state)) { |
| 295 | case _MODS: | ||
| 296 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break; | ||
| 297 | case _GAMEPAD: | 334 | case _GAMEPAD: |
| 298 | rgb_matrix_layer_helper(0xFF, 0x80, 0x00, LED_FLAG_UNDERGLOW); break; | 335 | rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 336 | break; | ||
| 299 | case _DIABLO: | 337 | case _DIABLO: |
| 300 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00, LED_FLAG_UNDERGLOW); break; | 338 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 339 | break; | ||
| 301 | case _RAISE: | 340 | case _RAISE: |
| 302 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break; | 341 | rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 342 | break; | ||
| 303 | case _LOWER: | 343 | case _LOWER: |
| 304 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break; | 344 | rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 345 | break; | ||
| 305 | case _ADJUST: | 346 | case _ADJUST: |
| 306 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00, LED_FLAG_UNDERGLOW); break; | 347 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 307 | default: | 348 | break; |
| 349 | default: { | ||
| 350 | bool mods_enabled = IS_LAYER_ON(_MODS); | ||
| 308 | switch (biton32(default_layer_state)) { | 351 | switch (biton32(default_layer_state)) { |
| 309 | case _QWERTY: | 352 | case _QWERTY: |
| 310 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, LED_FLAG_UNDERGLOW); break; | 353 | rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 354 | break; | ||
| 311 | case _COLEMAK: | 355 | case _COLEMAK: |
| 312 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, LED_FLAG_UNDERGLOW); break; | 356 | rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 357 | break; | ||
| 313 | case _DVORAK: | 358 | case _DVORAK: |
| 314 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break; | 359 | rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 360 | break; | ||
| 315 | case _WORKMAN: | 361 | case _WORKMAN: |
| 316 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, LED_FLAG_UNDERGLOW); break; | 362 | rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 363 | break; | ||
| 317 | case _NORMAN: | 364 | case _NORMAN: |
| 318 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D, LED_FLAG_UNDERGLOW); break; | 365 | rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 366 | break; | ||
| 319 | case _MALTRON: | 367 | case _MALTRON: |
| 320 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break; | 368 | rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 369 | break; | ||
| 321 | case _EUCALYN: | 370 | case _EUCALYN: |
| 322 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF, LED_FLAG_UNDERGLOW); break; | 371 | rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 372 | break; | ||
| 323 | case _CARPLAX: | 373 | case _CARPLAX: |
| 324 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF, LED_FLAG_UNDERGLOW); break; | 374 | rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); |
| 375 | break; | ||
| 325 | } | 376 | } |
| 377 | break; | ||
| 378 | } | ||
| 326 | } | 379 | } |
| 327 | } | 380 | } |
| 328 | } | 381 | } |
diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index 39b48f944..af3404597 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk | |||
| @@ -16,7 +16,6 @@ UNICODE_ENABLE = no # Unicode | |||
| 16 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | 16 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID |
| 17 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. | 17 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. |
| 18 | SWAP_HANDS_ENABLE = no # Enable one-hand typing | 18 | SWAP_HANDS_ENABLE = no # Enable one-hand typing |
| 19 | RGBLIGHT_STARTUP_ANIMATION = yes | ||
| 20 | RGB_MATRIX_ENABLE = WS2812 | 19 | RGB_MATRIX_ENABLE = WS2812 |
| 21 | 20 | ||
| 22 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 21 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| @@ -25,7 +24,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | |||
| 25 | BOOTLOADER = qmk-dfu | 24 | BOOTLOADER = qmk-dfu |
| 26 | 25 | ||
| 27 | OLED_DRIVER_ENABLE = yes | 26 | OLED_DRIVER_ENABLE = yes |
| 28 | |||
| 29 | ifneq ($(strip $(OLED_DRIVER_ENABLE)), yes) | ||
| 30 | RGB_MATRIX_SPLIT_RIGHT=yes | ||
| 31 | endif | ||
diff --git a/keyboards/gergo/keymaps/drashna/keymap.c b/keyboards/gergo/keymaps/drashna/keymap.c index ffa23462e..2843b332a 100644 --- a/keyboards/gergo/keymaps/drashna/keymap.c +++ b/keyboards/gergo/keymaps/drashna/keymap.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include QMK_KEYBOARD_H | 9 | #include QMK_KEYBOARD_H |
| 10 | #include "drashna.h" | 10 | #include "drashna.h" |
| 11 | 11 | ||
| 12 | 12 | // clang-format off | |
| 13 | #define LAYOUT_gergo_base( \ | 13 | #define LAYOUT_gergo_base( \ |
| 14 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 14 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| 15 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 15 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
| @@ -111,3 +111,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 111 | ), | 111 | ), |
| 112 | 112 | ||
| 113 | */ | 113 | */ |
| 114 | // clang-format on | ||
diff --git a/keyboards/keebio/iris/keymaps/drashna/config.h b/keyboards/keebio/iris/keymaps/drashna/config.h index 1a937b4b7..ee8ac8aff 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 <http://www.gnu.org/licenses/>. | |||
| 19 | 19 | ||
| 20 | /* Use I2C or Serial, not both */ | 20 | /* Use I2C or Serial, not both */ |
| 21 | 21 | ||
| 22 | // #define USE_SERIAL | 22 | #define USE_SERIAL |
| 23 | #define USE_I2C | 23 | // #define USE_I2C |
| 24 | 24 | ||
| 25 | /* Select hand configuration */ | 25 | /* Select hand configuration */ |
| 26 | 26 | ||
| @@ -29,33 +29,38 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 29 | #define EE_HANDS | 29 | #define EE_HANDS |
| 30 | 30 | ||
| 31 | #ifdef RGBLIGHT_ENABLE | 31 | #ifdef RGBLIGHT_ENABLE |
| 32 | # undef RGBLED_NUM | 32 | # undef RGBLED_NUM |
| 33 | # define RGBLED_NUM 18 // Number of LEDs | 33 | # define RGBLED_NUM 18 // Number of LEDs |
| 34 | # define RGBLED_SPLIT { 9, 9 } | 34 | # undef RGBLED_SPLIT |
| 35 | # define RGBLIGHT_HUE_STEP 12 | 35 | # define RGBLED_SPLIT { 9, 9 } |
| 36 | # define RGBLIGHT_SAT_STEP 12 | 36 | # define RGBLIGHT_HUE_STEP 8 |
| 37 | # define RGBLIGHT_VAL_STEP 12 | 37 | # define RGBLIGHT_SAT_STEP 8 |
| 38 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 38 | # define RGBLIGHT_VAL_STEP 8 |
| 39 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 39 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 40 | 40 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | |
| 41 | # define RGBLIGHT_LIMIT_VAL 225 | 41 | |
| 42 | #endif // RGBLIGHT_ENABLE | 42 | # define RGBLIGHT_LIMIT_VAL 225 |
| 43 | #endif // RGBLIGHT_ENABLE | ||
| 43 | 44 | ||
| 44 | #ifdef AUDIO_ENABLE | 45 | #ifdef AUDIO_ENABLE |
| 45 | # define C6_AUDIO | 46 | # define C6_AUDIO |
| 46 | # ifdef RGBLIGHT_ENABLE | 47 | # ifdef RGBLIGHT_ENABLE |
| 47 | # define NO_MUSIC_MODE | 48 | # define NO_MUSIC_MODE |
| 48 | # endif //RGBLIGHT_ENABLE | 49 | # endif // RGBLIGHT_ENABLE |
| 49 | #endif //AUDIO_ENABLE | 50 | #endif // AUDIO_ENABLE |
| 50 | 51 | ||
| 51 | #define QMK_ESC_OUTPUT F6 // usually COL | 52 | #ifndef KEYBOARD_keebio_iris_rev3 |
| 52 | #define QMK_ESC_INPUT D7 // usually ROW | 53 | # define QMK_ESC_OUTPUT F6 // usually COL |
| 53 | #define QMK_LED B0 | 54 | # define QMK_ESC_INPUT D7 // usually ROW |
| 54 | #define QMK_SPEAKER C6 | 55 | # define QMK_LED B0 |
| 56 | # define QMK_SPEAKER C6 | ||
| 57 | #endif | ||
| 55 | 58 | ||
| 56 | #undef PRODUCT | 59 | #undef PRODUCT |
| 57 | #ifdef KEYBOARD_keebio_iris_rev2 | 60 | #ifdef KEYBOARD_keebio_iris_rev2 |
| 58 | # define PRODUCT Drashna Hacked Iris Rev.2 | 61 | # define PRODUCT Drashna Hacked Iris Rev .2 |
| 62 | #elif defined(KEYBOARD_keebio_iris_rev3) | ||
| 63 | # define PRODUCT Drashna Hacked Iris Rev .3 | ||
| 59 | #endif | 64 | #endif |
| 60 | 65 | ||
| 61 | #define SHFT_LED1 6 | 66 | #define SHFT_LED1 6 |
diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index 44ffb59f6..fe10cb275 100644 --- a/keyboards/keebio/iris/keymaps/drashna/keymap.c +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #include QMK_KEYBOARD_H | 2 | #include QMK_KEYBOARD_H |
| 3 | #include "drashna.h" | 3 | #include "drashna.h" |
| 4 | 4 | ||
| 5 | 5 | // clang-format off | |
| 6 | #define LAYOUT_iris_base( \ | 6 | #define LAYOUT_iris_base( \ |
| 7 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 7 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| 8 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 8 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
| @@ -110,7 +110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 110 | ) | 110 | ) |
| 111 | 111 | ||
| 112 | }; | 112 | }; |
| 113 | 113 | // clang-format on | |
| 114 | 114 | ||
| 115 | void matrix_init_keymap(void) { | 115 | void matrix_init_keymap(void) { |
| 116 | #ifndef CONVERT_TO_PROTON_C | 116 | #ifndef CONVERT_TO_PROTON_C |
| @@ -122,13 +122,12 @@ void matrix_init_keymap(void) { | |||
| 122 | #endif | 122 | #endif |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | |||
| 126 | void keyboard_post_init_keymap(void) { | 125 | void keyboard_post_init_keymap(void) { |
| 127 | #if BACKLIGHT_ENABLE | 126 | #if BACKLIGHT_ENABLE |
| 128 | backlight_enable(); | 127 | backlight_enable(); |
| 129 | backlight_level(5); | 128 | backlight_level(5); |
| 130 | #ifdef BACKLIGHT_BREATHING | 129 | # ifdef BACKLIGHT_BREATHING |
| 131 | breathing_enable(); | 130 | breathing_enable(); |
| 132 | #endif | 131 | # endif |
| 133 | #endif | 132 | #endif |
| 134 | } | 133 | } |
diff --git a/keyboards/keebio/iris/keymaps/drashna/rules.mk b/keyboards/keebio/iris/keymaps/drashna/rules.mk index a315e1a0b..17acd32be 100644 --- a/keyboards/keebio/iris/keymaps/drashna/rules.mk +++ b/keyboards/keebio/iris/keymaps/drashna/rules.mk | |||
| @@ -14,6 +14,6 @@ SPACE_CADET_ENABLE = no | |||
| 14 | INDICATOR_LIGHTS = no | 14 | INDICATOR_LIGHTS = no |
| 15 | MACROS_ENABLED = no | 15 | MACROS_ENABLED = no |
| 16 | RGBLIGHT_TWINKLE = no | 16 | RGBLIGHT_TWINKLE = no |
| 17 | RGBLIGHT_STARTUP_ANIMATION = yes | 17 | RGBLIGHT_STARTUP_ANIMATION = no |
| 18 | 18 | ||
| 19 | BOOTLOADER = qmk-dfu | 19 | BOOTLOADER = qmk-dfu |
diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index bde959f5e..56799ae2c 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c | |||
| @@ -30,7 +30,7 @@ uint8_t last_led; | |||
| 30 | uint8_t last_osm; | 30 | uint8_t last_osm; |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | 33 | // clang-format off | |
| 34 | #define LAYOUT_orthodox_base( \ | 34 | #define LAYOUT_orthodox_base( \ |
| 35 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 35 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| 36 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 36 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
| @@ -121,6 +121,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 121 | ) | 121 | ) |
| 122 | 122 | ||
| 123 | }; | 123 | }; |
| 124 | // clang-format on | ||
| 124 | 125 | ||
| 125 | void matrix_init_keymap(void) { | 126 | void matrix_init_keymap(void) { |
| 126 | #ifndef CONVERT_TO_PROTON_C | 127 | #ifndef CONVERT_TO_PROTON_C |
