diff options
| author | Drashna Jaelre <drashna@live.com> | 2019-05-06 22:34:09 -0700 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-06 22:34:09 -0700 |
| commit | f3d5b1091d364468cd9f5510aef9e723d8542279 (patch) | |
| tree | 762b8f562b1e96e42657f872fd4b04c8efaaa829 | |
| parent | 7a751f114114bf3b78d5d8fc8bedf2b42b665dba (diff) | |
| download | qmk_firmware-f3d5b1091d364468cd9f5510aef9e723d8542279.tar.gz qmk_firmware-f3d5b1091d364468cd9f5510aef9e723d8542279.zip | |
[Keymap] RGB Changes for Drashna Keyboards (#5803)
* Disable a bunch of reactive modes
* Enable rgb matrix for Corne Keyboard
* Convert CRKBD to rgb matrix
* Add Gergo keyboard layout
* Make Diablo 3 tap dance better
* Add basic support for Planck EZ
* Fix RGB Matrix stuff
* Fix keycodes for Planck EZ
* Update CRKBD OLED stuff
* Fix typo for sleep on ergodox glow
* Improve my gergo layout
* Scrolling OLED key logger!
* Change gergo layout
* Hnadle unicode keycodes if unicode is disabled
* Disable COMMAND/CONSOLE for gergo
* Fix right side control
* Re-enable LTO for all platforms
Since I got updated arm gcc binaries that no longer error out on lto
* Update formatting to match newer community standards
Poor 2 space
* Re-alight startup animation to use new HUE range
* Streamline gitlab ci scripts
* Disabled Space Cadet
* Add support for breathing table
* Enable new LTO Option
And clean up defines that will now be repeatitive
* Remove vscode settings
* Additional formatting cleanup of config.h files
38 files changed, 1421 insertions, 1451 deletions
diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index 6f2665f3a..0b035ba3c 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h | |||
| @@ -27,7 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 27 | // #define MASTER_RIGHT | 27 | // #define MASTER_RIGHT |
| 28 | #define EE_HANDS | 28 | #define EE_HANDS |
| 29 | 29 | ||
| 30 | // #define SSD1306OLED | 30 | #undef USE_I2C |
| 31 | #undef SSD1306OLED | ||
| 31 | 32 | ||
| 32 | #define USE_SERIAL_PD2 | 33 | #define USE_SERIAL_PD2 |
| 33 | 34 | ||
| @@ -35,17 +36,42 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 35 | // #define TAPPING_TERM 100 | 36 | // #define TAPPING_TERM 100 |
| 36 | 37 | ||
| 37 | #ifdef RGBLIGHT_ENABLE | 38 | #ifdef RGBLIGHT_ENABLE |
| 38 | #undef RGBLED_NUM | 39 | # undef RGBLED_NUM |
| 39 | #define RGBLED_NUM 27 | 40 | # define RGBLED_NUM 27 |
| 40 | 41 | ||
| 41 | #define RGBLIGHT_HUE_STEP 8 | 42 | # define RGBLIGHT_HUE_STEP 8 |
| 42 | #define RGBLIGHT_SAT_STEP 8 | 43 | # define RGBLIGHT_SAT_STEP 8 |
| 43 | #define RGBLIGHT_VAL_STEP 8 | 44 | # define RGBLIGHT_VAL_STEP 8 |
| 44 | #define RGBLIGHT_LIMIT_VAL 100 | 45 | # define RGBLIGHT_LIMIT_VAL 100 |
| 45 | #endif | 46 | #endif |
| 46 | 47 | ||
| 48 | #ifdef RGB_MATRIX_ENABLE | ||
| 49 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses | ||
| 50 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended | ||
| 51 | |||
| 52 | # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 53 | # define DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 54 | # define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 55 | # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 56 | # define DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 57 | # define DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 58 | # define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 59 | // #define DISABLE_RGB_MATRIX_RAINDROPS | ||
| 60 | // #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 61 | # define DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 62 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 63 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 64 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 65 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 66 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 67 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 68 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 69 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 70 | # define DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 71 | # define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 72 | |||
| 47 | #ifdef AUDIO_ENABLE | 73 | #ifdef AUDIO_ENABLE |
| 48 | #define B6_AUDIO | 74 | # define B6_AUDIO |
| 49 | // #define NO_MUSIC_MODE | 75 | // #define NO_MUSIC_MODE |
| 50 | #endif | 76 | #endif |
| 51 | 77 | ||
diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index aaace9483..3eea7af9f 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c | |||
| @@ -1,15 +1,5 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | #include "drashna.h" | 2 | #include "drashna.h" |
| 3 | #ifdef PROTOCOL_LUFA | ||
| 4 | #include "lufa.h" | ||
| 5 | #include "split_util.h" | ||
| 6 | #endif | ||
| 7 | #ifdef SSD1306OLED | ||
| 8 | #include "ssd1306.h" | ||
| 9 | #endif | ||
| 10 | #ifdef OLED_DRIVER_ENABLE | ||
| 11 | #include "oled_driver.h" | ||
| 12 | #endif | ||
| 13 | 3 | ||
| 14 | extern keymap_config_t keymap_config; | 4 | extern keymap_config_t keymap_config; |
| 15 | extern uint8_t is_master; | 5 | extern uint8_t is_master; |
| @@ -20,7 +10,7 @@ extern rgblight_config_t rgblight_config; | |||
| 20 | #endif | 10 | #endif |
| 21 | 11 | ||
| 22 | enum crkbd_keycodes { | 12 | enum crkbd_keycodes { |
| 23 | RGBRST = NEW_SAFE_RANGE | 13 | RGBRST = NEW_SAFE_RANGE |
| 24 | }; | 14 | }; |
| 25 | 15 | ||
| 26 | #define LAYOUT_crkbd_base( \ | 16 | #define LAYOUT_crkbd_base( \ |
| @@ -31,7 +21,7 @@ enum crkbd_keycodes { | |||
| 31 | LAYOUT_wrapper( \ | 21 | LAYOUT_wrapper( \ |
| 32 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ | 22 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ |
| 33 | KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ | 23 | KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ |
| 34 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ | 24 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ |
| 35 | LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ | 25 | LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ |
| 36 | ) | 26 | ) |
| 37 | #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) | 27 | #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) |
| @@ -115,35 +105,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 115 | }; | 105 | }; |
| 116 | 106 | ||
| 117 | void matrix_init_keymap(void) { | 107 | void matrix_init_keymap(void) { |
| 118 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | 108 | #ifndef CONVERT_TO_PROTON_C |
| 119 | #ifdef SSD1306OLED | ||
| 120 | iota_gfx_init(!has_usb()); // turns on the display | ||
| 121 | #endif | ||
| 122 | |||
| 123 | #ifndef CONVERT_TO_PROTON_C | ||
| 124 | setPinOutput(D5); | 109 | setPinOutput(D5); |
| 125 | writePinHigh(D5); | 110 | writePinHigh(D5); |
| 126 | 111 | ||
| 127 | setPinOutput(B0); | 112 | setPinOutput(B0); |
| 128 | writePinHigh(B0); | 113 | writePinHigh(B0); |
| 129 | #endif | 114 | #endif |
| 130 | } | 115 | } |
| 131 | 116 | ||
| 132 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
| 133 | #ifdef SSD1306OLED | ||
| 134 | 117 | ||
| 135 | // When add source files to SRC in rules.mk, you can use functions. | 118 | #ifdef OLED_DRIVER_ENABLE |
| 136 | const char *read_logo(void); | 119 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { |
| 137 | char layer_state_str[24]; | 120 | if (is_master) { |
| 138 | char modifier_state_str[24]; | 121 | return OLED_ROTATION_270; |
| 139 | char host_led_state_str[24]; | 122 | } else { |
| 140 | char keylog_str[24] = {}; | 123 | return rotation; |
| 141 | char keylogs_str[21] = {}; | 124 | } |
| 142 | int keylogs_str_idx = 0; | 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 | } | ||
| 143 | 135 | ||
| 144 | // const char *read_mode_icon(bool swap); | 136 | #define KEYLOG_LEN (int)(32 / OLED_FONT_WIDTH) |
| 145 | // void set_timelog(void); | 137 | char keylog_str[KEYLOG_LEN] = {}; |
| 146 | // const char *read_timelog(void); | 138 | uint8_t keylogs_str_idx = 0; |
| 139 | uint16_t log_timer = 0; | ||
| 147 | 140 | ||
| 148 | const char code_to_name[60] = { | 141 | const char code_to_name[60] = { |
| 149 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', | 142 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', |
| @@ -153,261 +146,124 @@ const char code_to_name[60] = { | |||
| 153 | 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', | 146 | 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', |
| 154 | '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; | 147 | '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; |
| 155 | 148 | ||
| 156 | void set_keylog(uint16_t keycode, keyrecord_t *record) { | 149 | void add_keylog(uint16_t keycode) { |
| 157 | char name = ' '; | 150 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || |
| 158 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } | 151 | (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } |
| 159 | if (keycode < 60) { | ||
| 160 | name = code_to_name[keycode]; | ||
| 161 | } | ||
| 162 | // update keylog | ||
| 163 | snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", | ||
| 164 | record->event.key.row, record->event.key.col, | ||
| 165 | keycode, name); | ||
| 166 | |||
| 167 | // update keylogs | ||
| 168 | if (keylogs_str_idx == sizeof(keylogs_str) - 1) { | ||
| 169 | keylogs_str_idx = 0; | ||
| 170 | for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { | ||
| 171 | keylogs_str[i] = ' '; | ||
| 172 | } | ||
| 173 | } | ||
| 174 | |||
| 175 | keylogs_str[keylogs_str_idx] = name; | ||
| 176 | keylogs_str_idx++; | ||
| 177 | } | ||
| 178 | 152 | ||
| 179 | const char *read_keylog(void) { | 153 | for (uint8_t i = KEYLOG_LEN - 1; i > 0; i--) { |
| 180 | return keylog_str; | 154 | keylog_str[i] = keylog_str[i - 1]; |
| 155 | } | ||
| 156 | if (keycode < 60) { | ||
| 157 | keylog_str[0] = code_to_name[keycode]; | ||
| 158 | } | ||
| 159 | log_timer = timer_read(); | ||
| 181 | } | 160 | } |
| 182 | 161 | ||
| 183 | const char *read_keylogs(void) { | 162 | void update_log(void) { |
| 184 | return keylogs_str; | 163 | if (timer_elapsed(log_timer) > 750) { |
| 164 | add_keylog(0); | ||
| 165 | } | ||
| 185 | } | 166 | } |
| 186 | 167 | ||
| 187 | 168 | ||
| 188 | const char* read_modifier_state(void) { | 169 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 189 | uint8_t modifiers = get_mods(); | 170 | if (record->event.pressed) { add_keylog(keycode); } |
| 190 | uint8_t one_shot = get_oneshot_mods(); | 171 | return true; |
| 191 | |||
| 192 | snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s", | ||
| 193 | (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL) ? "CTL" : " ", | ||
| 194 | (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI) ? "GUI" : " ", | ||
| 195 | (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT) ? "ALT" : " ", | ||
| 196 | (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? "SFT" : " " | ||
| 197 | ); | ||
| 198 | |||
| 199 | return modifier_state_str; | ||
| 200 | } | 172 | } |
| 201 | 173 | ||
| 202 | const char *read_host_led_state(void) { | 174 | void render_status(void) { |
| 203 | uint8_t leds = host_keyboard_leds(); | ||
| 204 | |||
| 205 | snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", | ||
| 206 | (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", | ||
| 207 | (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", | ||
| 208 | (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- " | ||
| 209 | ); | ||
| 210 | |||
| 211 | return host_led_state_str; | ||
| 212 | } | ||
| 213 | 175 | ||
| 214 | const char* read_layer_state(void) { | 176 | oled_write_P(PSTR("Layer"), false); |
| 215 | switch (biton32(layer_state)) { | 177 | switch (biton32(layer_state)) { |
| 216 | case _RAISE: | 178 | case 0: |
| 217 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise "); | 179 | oled_write_P(PSTR("Base "), false); |
| 218 | break; | 180 | break; |
| 219 | case _LOWER: | 181 | case _RAISE: |
| 220 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower "); | 182 | oled_write_P(PSTR("Raise"), false); |
| 221 | break; | 183 | break; |
| 222 | case _ADJUST: | 184 | case _LOWER: |
| 223 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust "); | 185 | oled_write_P(PSTR("Lower"), false); |
| 224 | break; | 186 | break; |
| 225 | default: | 187 | case _ADJUST: |
| 226 | switch (biton32(default_layer_state)) { | 188 | oled_write_P(PSTR("Adjst"), false); |
| 189 | break; | ||
| 190 | default: | ||
| 191 | oled_write_P(PSTR("Unkn "), false); | ||
| 192 | break; | ||
| 193 | } | ||
| 194 | oled_write_P(PSTR("Lyout"), false); | ||
| 195 | switch (biton32(default_layer_state)) { | ||
| 227 | case _QWERTY: | 196 | case _QWERTY: |
| 228 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Qwerty "); | 197 | oled_write_P(PSTR("QWRTY"), false); |
| 229 | break; | 198 | break; |
| 230 | case _COLEMAK: | 199 | case _COLEMAK: |
| 231 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); | 200 | oled_write_P(PSTR("COLMK"), false); |
| 232 | break; | 201 | break; |
| 233 | case _DVORAK: | 202 | case _DVORAK: |
| 234 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak "); | 203 | oled_write_P(PSTR("DVRAK"), false); |
| 235 | break; | 204 | break; |
| 236 | case _WORKMAN: | 205 | case _WORKMAN: |
| 237 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); | 206 | oled_write_P(PSTR("WRKMN"), false); |
| 238 | break; | 207 | break; |
| 239 | } | 208 | case _NORMAN: |
| 240 | break; | 209 | oled_write_P(PSTR("NORMN"), false); |
| 241 | } | 210 | break; |
| 242 | 211 | case _MALTRON: | |
| 243 | return layer_state_str; | 212 | oled_write_P(PSTR("MLTRN"), false); |
| 244 | } | 213 | break; |
| 245 | 214 | case _EUCALYN: | |
| 246 | void matrix_scan_keymap(void) { | 215 | oled_write_P(PSTR("ECLYN"), false); |
| 247 | iota_gfx_task(); | 216 | break; |
| 248 | } | 217 | case _CARPLAX: |
| 249 | 218 | oled_write_P(PSTR("CRPLX"), false); | |
| 250 | void matrix_render_user(struct CharacterMatrix *matrix) { | 219 | break; |
| 251 | if (is_master) { | 220 | } |
| 252 | //If you want to change the display of OLED, you need to change here | ||
| 253 | matrix_write_ln(matrix, read_layer_state()); | ||
| 254 | matrix_write_ln(matrix, read_modifier_state()); | ||
| 255 | // matrix_write_ln(matrix, read_keylog()); | ||
| 256 | matrix_write_ln(matrix, read_keylogs()); | ||
| 257 | // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); | ||
| 258 | // matrix_write(matrix, read_host_led_state()); | ||
| 259 | //matrix_write_ln(matrix, read_timelog()); | ||
| 260 | } else { | ||
| 261 | matrix_write(matrix, read_logo()); | ||
| 262 | } | ||
| 263 | } | ||
| 264 | |||
| 265 | void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { | ||
| 266 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
| 267 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
| 268 | dest->dirty = true; | ||
| 269 | } | ||
| 270 | } | ||
| 271 | |||
| 272 | void iota_gfx_task_user(void) { | ||
| 273 | struct CharacterMatrix matrix; | ||
| 274 | matrix_clear(&matrix); | ||
| 275 | matrix_render_user(&matrix); | ||
| 276 | matrix_update(&display, &matrix); | ||
| 277 | } | ||
| 278 | |||
| 279 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
| 280 | switch (keycode) { | ||
| 281 | case KC_A ... KC_SLASH: | ||
| 282 | case KC_F1 ... KC_F12: | ||
| 283 | case KC_INSERT ... KC_UP: | ||
| 284 | case KC_KP_SLASH ... KC_KP_DOT: | ||
| 285 | case KC_F13 ... KC_F24: | ||
| 286 | if (record->event.pressed) { set_keylog(keycode, record); } | ||
| 287 | break; | ||
| 288 | // set_timelog(); | ||
| 289 | } | ||
| 290 | return true; | ||
| 291 | } | ||
| 292 | 221 | ||
| 293 | #endif | 222 | uint8_t modifiers = get_mods(); |
| 223 | uint8_t one_shot = get_oneshot_mods(); | ||
| 294 | 224 | ||
| 225 | oled_write_P(PSTR("Mods:"), false); | ||
| 226 | oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false); | ||
| 227 | oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false); | ||
| 228 | oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false); | ||
| 229 | oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false); | ||
| 295 | 230 | ||
| 296 | #ifdef OLED_DRIVER_ENABLE | ||
| 297 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 298 | if (is_master) { | ||
| 299 | return OLED_ROTATION_270; | ||
| 300 | } else { | ||
| 301 | return rotation; | ||
| 302 | } | ||
| 303 | } | ||
| 304 | 231 | ||
| 305 | void render_crkbd_logo(void) { | 232 | oled_write_P(PSTR("BTMGK"), false); |
| 306 | static const char PROGMEM crkbd_logo[] = { | ||
| 307 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
| 308 | 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, | ||
| 309 | 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, | ||
| 310 | 0}; | ||
| 311 | oled_write_P(crkbd_logo, false); | ||
| 312 | } | ||
| 313 | 233 | ||
| 234 | if (keymap_config.swap_lalt_lgui) { | ||
| 235 | oled_write_P(PSTR(" Mac "), false); | ||
| 236 | } else { | ||
| 237 | oled_write_P(PSTR(" Win "), false); | ||
| 238 | } | ||
| 314 | 239 | ||
| 315 | void render_status(void) { | 240 | uint8_t led_usb_state = host_keyboard_leds(); |
| 241 | oled_write_P(PSTR("Lock:"), false); | ||
| 242 | oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR(" "), false); | ||
| 243 | oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR(" "), false); | ||
| 244 | oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR(" SCRL") : PSTR(" "), false); | ||
| 316 | 245 | ||
| 317 | oled_write_P(PSTR("Layer"), false); | 246 | oled_write(keylog_str, false); |
| 318 | switch (biton32(layer_state)) { | ||
| 319 | case 0: | ||
| 320 | oled_write_P(PSTR("Base "), false); | ||
| 321 | break; | ||
| 322 | case _RAISE: | ||
| 323 | oled_write_P(PSTR("Raise"), false); | ||
| 324 | break; | ||
| 325 | case _LOWER: | ||
| 326 | oled_write_P(PSTR("Lower"), false); | ||
| 327 | break; | ||
| 328 | case _ADJUST: | ||
| 329 | oled_write_P(PSTR("Adjst"), false); | ||
| 330 | break; | ||
| 331 | default: | ||
| 332 | oled_write_P(PSTR("Unkn "), false); | ||
| 333 | break; | ||
| 334 | } | ||
| 335 | oled_write_P(PSTR("Lyout"), false); | ||
| 336 | switch (biton32(default_layer_state)) { | ||
| 337 | case _QWERTY: | ||
| 338 | oled_write_P(PSTR("QWRTY"), false); | ||
| 339 | break; | ||
| 340 | case _COLEMAK: | ||
| 341 | oled_write_P(PSTR("COLMK"), false); | ||
| 342 | break; | ||
| 343 | case _DVORAK: | ||
| 344 | oled_write_P(PSTR("DVRAK"), false); | ||
| 345 | break; | ||
| 346 | case _WORKMAN: | ||
| 347 | oled_write_P(PSTR("WRKMN"), false); | ||
| 348 | break; | ||
| 349 | case _NORMAN: | ||
| 350 | oled_write_P(PSTR("NORMN"), false); | ||
| 351 | break; | ||
| 352 | case _MALTRON: | ||
| 353 | oled_write_P(PSTR("MLTRN"), false); | ||
| 354 | break; | ||
| 355 | case _EUCALYN: | ||
| 356 | oled_write_P(PSTR("ECLYN"), false); | ||
| 357 | break; | ||
| 358 | case _CARPLAX: | ||
| 359 | oled_write_P(PSTR("CRPLX"), false); | ||
| 360 | break; | ||
| 361 | } | ||
| 362 | |||
| 363 | uint8_t modifiers = get_mods(); | ||
| 364 | uint8_t one_shot = get_oneshot_mods(); | ||
| 365 | |||
| 366 | oled_write_P(PSTR("Mods:"), false); | ||
| 367 | oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false); | ||
| 368 | oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false); | ||
| 369 | oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false); | ||
| 370 | oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false); | ||
| 371 | |||
| 372 | |||
| 373 | oled_write_P(PSTR("BTMGK"), false); | ||
| 374 | static const char PROGMEM mode_logo[4][4] = { | ||
| 375 | {0x95,0x96,0x0a,0}, | ||
| 376 | {0xb5,0xb6,0x0a,0}, | ||
| 377 | {0x97,0x98,0x0a,0}, | ||
| 378 | {0xb7,0xb8,0x0a,0} }; | ||
| 379 | |||
| 380 | if (keymap_config.swap_lalt_lgui != false) { | ||
| 381 | oled_write_P(mode_logo[0], false); | ||
| 382 | oled_write_P(mode_logo[1], false); | ||
| 383 | } else { | ||
| 384 | oled_write_P(mode_logo[2], false); | ||
| 385 | oled_write_P(mode_logo[3], false); | ||
| 386 | } | ||
| 387 | |||
| 388 | uint8_t led_usb_state = host_keyboard_leds(); | ||
| 389 | oled_write_P(PSTR("Lock:"), false); | ||
| 390 | oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR(" "), false); | ||
| 391 | oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR(" "), false); | ||
| 392 | oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR(" SCRL") : PSTR(" "), false); | ||
| 393 | } | 247 | } |
| 394 | 248 | ||
| 395 | 249 | ||
| 396 | void oled_task_user(void) { | 250 | void oled_task_user(void) { |
| 397 | if (is_master) { | 251 | if (is_master) { |
| 398 | render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) | 252 | render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) |
| 399 | } else { | 253 | } else { |
| 400 | render_crkbd_logo(); | 254 | render_crkbd_logo(); |
| 401 | oled_scroll_left(); // Turns on scrolling | 255 | oled_scroll_left(); // Turns on scrolling |
| 402 | } | 256 | } |
| 403 | } | 257 | } |
| 258 | |||
| 259 | void matrix_scan_keymap(void) { update_log(); } | ||
| 404 | #endif | 260 | #endif |
| 405 | 261 | ||
| 406 | uint16_t get_tapping_term(uint16_t keycode) { | 262 | uint16_t get_tapping_term(uint16_t keycode) { |
| 407 | switch (keycode) { | 263 | switch (keycode) { |
| 408 | case ALT_T(KC_A): | 264 | case ALT_T(KC_A): |
| 409 | return TAPPING_TERM + 100; | 265 | return TAPPING_TERM + 100; |
| 410 | default: | 266 | default: |
| 411 | return TAPPING_TERM; | 267 | return TAPPING_TERM; |
| 412 | } | 268 | } |
| 413 | } | 269 | } |
diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index a9a705869..39b48f944 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk | |||
| @@ -14,9 +14,10 @@ MIDI_ENABLE = no # MIDI controls | |||
| 14 | AUDIO_ENABLE = no # Audio output on port C6 | 14 | AUDIO_ENABLE = no # Audio output on port C6 |
| 15 | UNICODE_ENABLE = no # Unicode | 15 | 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 = yes # 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 | 19 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 20 | RGB_MATRIX_ENABLE = WS2812 | ||
| 20 | 21 | ||
| 21 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 22 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 22 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 23 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| @@ -24,3 +25,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | |||
| 24 | BOOTLOADER = qmk-dfu | 25 | BOOTLOADER = qmk-dfu |
| 25 | 26 | ||
| 26 | OLED_DRIVER_ENABLE = yes | 27 | 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 a882ff72d..ffa23462e 100644 --- a/keyboards/gergo/keymaps/drashna/keymap.c +++ b/keyboards/gergo/keymaps/drashna/keymap.c | |||
| @@ -9,23 +9,17 @@ | |||
| 9 | #include QMK_KEYBOARD_H | 9 | #include QMK_KEYBOARD_H |
| 10 | #include "drashna.h" | 10 | #include "drashna.h" |
| 11 | 11 | ||
| 12 | // Blank template at the bottom | ||
| 13 | 12 | ||
| 14 | enum customKeycodes { | ||
| 15 | URL = 1 | ||
| 16 | }; | ||
| 17 | |||
| 18 | #define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__) | ||
| 19 | #define LAYOUT_gergo_base( \ | 13 | #define LAYOUT_gergo_base( \ |
| 20 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 14 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| 21 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 15 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
| 22 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ | 16 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ |
| 23 | ) \ | 17 | ) \ |
| 24 | LAYOUT_gergo_wrapper( \ | 18 | LAYOUT_gergo_wrapper( \ |
| 25 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ | 19 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ |
| 26 | KC_TAB, ALT_T(K11), K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ | 20 | KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 27 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ | 21 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ |
| 28 | _______, _______, KC_SPC, LT(_LOWER, KC_BSPC), LT(_RAISE, KC_DEL), KC_ENT, _______, _______ \ | 22 | KC_GRV, KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT, _______ \ |
| 29 | ) | 23 | ) |
| 30 | 24 | ||
| 31 | #define LAYOUT_gergo_base_wrapper(...) LAYOUT_gergo_base(__VA_ARGS__) | 25 | #define LAYOUT_gergo_base_wrapper(...) LAYOUT_gergo_base(__VA_ARGS__) |
diff --git a/keyboards/gergo/keymaps/drashna/rules.mk b/keyboards/gergo/keymaps/drashna/rules.mk index e69de29bb..ec81d11e9 100644 --- a/keyboards/gergo/keymaps/drashna/rules.mk +++ b/keyboards/gergo/keymaps/drashna/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | CONSOLE_ENABLE = no | ||
| 2 | COMMAND_ENABLE = no | ||
diff --git a/keyboards/keebio/iris/keymaps/drashna/config.h b/keyboards/keebio/iris/keymaps/drashna/config.h index 41933b0f3..1a937b4b7 100644 --- a/keyboards/keebio/iris/keymaps/drashna/config.h +++ b/keyboards/keebio/iris/keymaps/drashna/config.h | |||
| @@ -29,24 +29,23 @@ 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 | # define RGBLED_SPLIT { 9, 9 } |
| 35 | #define RGBLIGHT_HUE_STEP 12 | 35 | # define RGBLIGHT_HUE_STEP 12 |
| 36 | #define RGBLIGHT_SAT_STEP 12 | 36 | # define RGBLIGHT_SAT_STEP 12 |
| 37 | #define RGBLIGHT_VAL_STEP 12 | 37 | # define RGBLIGHT_VAL_STEP 12 |
| 38 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 38 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 39 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 39 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 |
| 40 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | 40 | |
| 41 | 41 | # define RGBLIGHT_LIMIT_VAL 225 | |
| 42 | #define RGBLIGHT_LIMIT_VAL 225 | ||
| 43 | #endif // RGBLIGHT_ENABLE | 42 | #endif // RGBLIGHT_ENABLE |
| 44 | 43 | ||
| 45 | #ifdef AUDIO_ENABLE | 44 | #ifdef AUDIO_ENABLE |
| 46 | #define C6_AUDIO | 45 | # define C6_AUDIO |
| 47 | #ifdef RGBLIGHT_ENABLE | 46 | # ifdef RGBLIGHT_ENABLE |
| 48 | #define NO_MUSIC_MODE | 47 | # define NO_MUSIC_MODE |
| 49 | #endif //RGBLIGHT_ENABLE | 48 | # endif //RGBLIGHT_ENABLE |
| 50 | #endif //AUDIO_ENABLE | 49 | #endif //AUDIO_ENABLE |
| 51 | 50 | ||
| 52 | #define QMK_ESC_OUTPUT F6 // usually COL | 51 | #define QMK_ESC_OUTPUT F6 // usually COL |
| @@ -56,7 +55,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 56 | 55 | ||
| 57 | #undef PRODUCT | 56 | #undef PRODUCT |
| 58 | #ifdef KEYBOARD_keebio_iris_rev2 | 57 | #ifdef KEYBOARD_keebio_iris_rev2 |
| 59 | #define PRODUCT Drashna Hacked Iris Rev.2 | 58 | # define PRODUCT Drashna Hacked Iris Rev.2 |
| 60 | #endif | 59 | #endif |
| 61 | 60 | ||
| 62 | #define SHFT_LED1 6 | 61 | #define SHFT_LED1 6 |
diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index b306b6928..95092cc52 100644 --- a/keyboards/keebio/iris/keymaps/drashna/keymap.c +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ | 12 | KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ |
| 13 | KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ | 13 | KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ |
| 14 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ | 14 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 15 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ | 15 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ |
| 16 | LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ | 16 | LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ |
| 17 | ) | 17 | ) |
| 18 | #define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) | 18 | #define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) |
| @@ -113,22 +113,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 113 | 113 | ||
| 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 |
| 117 | setPinOutput(D5); | 117 | setPinOutput(D5); |
| 118 | writePinHigh(D5); | 118 | writePinHigh(D5); |
| 119 | 119 | ||
| 120 | setPinOutput(B0); | 120 | setPinOutput(B0); |
| 121 | writePinHigh(B0); | 121 | writePinHigh(B0); |
| 122 | #endif | 122 | #endif |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | 125 | ||
| 126 | void keyboard_post_init_keymap(void) { | 126 | void keyboard_post_init_keymap(void) { |
| 127 | #if BACKLIGHT_ENABLE | 127 | #if BACKLIGHT_ENABLE |
| 128 | backlight_enable(); | 128 | backlight_enable(); |
| 129 | backlight_level(5); | 129 | backlight_level(5); |
| 130 | #ifdef BACKLIGHT_BREATHING | 130 | #ifdef BACKLIGHT_BREATHING |
| 131 | breathing_enable(); | 131 | breathing_enable(); |
| 132 | #endif | 132 | #endif |
| 133 | #endif | 133 | #endif |
| 134 | } | 134 | } |
diff --git a/keyboards/keebio/iris/keymaps/drashna/rules.mk b/keyboards/keebio/iris/keymaps/drashna/rules.mk index bac5f95f3..1311ab280 100644 --- a/keyboards/keebio/iris/keymaps/drashna/rules.mk +++ b/keyboards/keebio/iris/keymaps/drashna/rules.mk | |||
| @@ -9,6 +9,7 @@ AUDIO_ENABLE = no | |||
| 9 | NKRO_ENABLE = yes | 9 | NKRO_ENABLE = yes |
| 10 | BACKLIGHT_ENABLE = no | 10 | BACKLIGHT_ENABLE = no |
| 11 | SWAP_HANDS_ENABLE = no | 11 | SWAP_HANDS_ENABLE = no |
| 12 | SPACE_CADET_ENABLE = no | ||
| 12 | 13 | ||
| 13 | INDICATOR_LIGHTS = no | 14 | INDICATOR_LIGHTS = no |
| 14 | MACROS_ENABLED = no | 15 | MACROS_ENABLED = no |
diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/config.h b/keyboards/keebio/iris/keymaps/drashna_lp/config.h index 4e2bf729f..d59890b46 100644 --- a/keyboards/keebio/iris/keymaps/drashna_lp/config.h +++ b/keyboards/keebio/iris/keymaps/drashna_lp/config.h | |||
| @@ -21,15 +21,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | #include "../drashna/config.h" | 21 | #include "../drashna/config.h" |
| 22 | 22 | ||
| 23 | #ifdef RGBLIGHT_ENABLE | 23 | #ifdef RGBLIGHT_ENABLE |
| 24 | #undef RGBLED_NUM | 24 | # undef RGBLED_NUM |
| 25 | #define RGBLED_NUM 16 // Number of LEDs | 25 | # define RGBLED_NUM 16 // Number of LEDs |
| 26 | #undef RGBLED_SPLIT | 26 | # undef RGBLED_SPLIT |
| 27 | #define RGBLED_SPLIT { 8, 8 } | 27 | # define RGBLED_SPLIT { 8, 8 } |
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | #undef PRODUCT | 30 | #undef PRODUCT |
| 31 | #ifdef KEYBOARD_keebio_iris_rev2 | 31 | #ifdef KEYBOARD_keebio_iris_rev2 |
| 32 | #define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) | 32 | # define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | #undef SHFT_LED1 | 35 | #undef SHFT_LED1 |
diff --git a/keyboards/keebio/iris/keymaps/drashna_old/config.h b/keyboards/keebio/iris/keymaps/drashna_old/config.h index 1b462d8ca..5adf014e3 100644 --- a/keyboards/keebio/iris/keymaps/drashna_old/config.h +++ b/keyboards/keebio/iris/keymaps/drashna_old/config.h | |||
| @@ -21,15 +21,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | #include "../drashna/config.h" | 21 | #include "../drashna/config.h" |
| 22 | 22 | ||
| 23 | #ifdef RGBLIGHT_ENABLE | 23 | #ifdef RGBLIGHT_ENABLE |
| 24 | #undef RGBLED_NUM | 24 | # undef RGBLED_NUM |
| 25 | #define RGBLED_NUM 16 // Number of LEDs | 25 | # define RGBLED_NUM 16 // Number of LEDs |
| 26 | #undef RGBLED_SPLIT | 26 | # undef RGBLED_SPLIT |
| 27 | #define RGBLED_SPLIT { 8, 8 } | 27 | # define RGBLED_SPLIT { 8, 8 } |
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | #undef PRODUCT | 30 | #undef PRODUCT |
| 31 | #ifdef KEYBOARD_keebio_iris_rev2 | 31 | #ifdef KEYBOARD_keebio_iris_rev2 |
| 32 | #define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) | 32 | # define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | #undef SHFT_LED1 | 35 | #undef SHFT_LED1 |
diff --git a/keyboards/keebio/viterbi/keymaps/drashna/config.h b/keyboards/keebio/viterbi/keymaps/drashna/config.h index c0a50cc04..201c02e41 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/config.h +++ b/keyboards/keebio/viterbi/keymaps/drashna/config.h | |||
| @@ -21,35 +21,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | #define MATRIX_ROWS 5 | 21 | #define MATRIX_ROWS 5 |
| 22 | 22 | ||
| 23 | #ifdef RGBLIGHT_ENABLE | 23 | #ifdef RGBLIGHT_ENABLE |
| 24 | #undef RGBLED_NUM | 24 | # undef RGBLED_NUM |
| 25 | #define RGBLED_NUM 16 | 25 | # define RGBLED_NUM 16 |
| 26 | 26 | ||
| 27 | #define RGBLIGHT_HUE_STEP 8 | 27 | # define RGBLIGHT_HUE_STEP 8 |
| 28 | #define RGBLIGHT_SAT_STEP 8 | 28 | # define RGBLIGHT_SAT_STEP 8 |
| 29 | #define RGBLIGHT_VAL_STEP 8 | 29 | # define RGBLIGHT_VAL_STEP 8 |
| 30 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 30 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 31 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 31 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 |
| 32 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 33 | #endif // RGBLIGHT_ENABLE | 32 | #endif // RGBLIGHT_ENABLE |
| 34 | 33 | ||
| 35 | 34 | ||
| 36 | #undef LOCKING_SUPPORT_ENABLE | ||
| 37 | #undef LOCKING_RESYNC_ENABLE | ||
| 38 | |||
| 39 | 35 | ||
| 40 | /* disable action features */ | ||
| 41 | //#define NO_ACTION_LAYER | ||
| 42 | //#define NO_ACTION_TAPPING | ||
| 43 | //#define NO_ACTION_ONESHOT | ||
| 44 | //#define NO_ACTION_MACRO | ||
| 45 | //#define NO_ACTION_FUNCTION | ||
| 46 | 36 | ||
| 47 | #undef PRODUCT | 37 | #undef PRODUCT |
| 48 | #define PRODUCT Drashnas Viterbi Macro Pad | 38 | #define PRODUCT Drashnas Viterbi Macro Pad |
| 49 | 39 | ||
| 50 | #ifdef AUDIO_ENABLE | 40 | #ifdef AUDIO_ENABLE |
| 51 | #define C6_AUDIO | 41 | # define C6_AUDIO |
| 52 | #define NO_MUSIC_MODE | 42 | # define NO_MUSIC_MODE |
| 53 | #endif | 43 | #endif |
| 54 | 44 | ||
| 55 | #define LAYOUT_ortho_5x7( \ | 45 | #define LAYOUT_ortho_5x7( \ |
diff --git a/keyboards/keebio/viterbi/keymaps/drashna/rules.mk b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk index f28ecc533..f42e065d5 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna/rules.mk +++ b/keyboards/keebio/viterbi/keymaps/drashna/rules.mk | |||
| @@ -8,6 +8,7 @@ RGBLIGHT_ENABLE = yes | |||
| 8 | AUDIO_ENABLE = yes | 8 | AUDIO_ENABLE = yes |
| 9 | NKRO_ENABLE = yes | 9 | NKRO_ENABLE = yes |
| 10 | SPLIT_KEYBOARD = no | 10 | SPLIT_KEYBOARD = no |
| 11 | SPACE_CADET_ENABLE = no | ||
| 11 | 12 | ||
| 12 | NO_SECRETS = yes | 13 | NO_SECRETS = yes |
| 13 | MACROS_ENABLED = yes | 14 | MACROS_ENABLED = yes |
diff --git a/keyboards/keebio/viterbi/keymaps/drashna_old/config.h b/keyboards/keebio/viterbi/keymaps/drashna_old/config.h index b36a4edd4..5697f7f11 100644 --- a/keyboards/keebio/viterbi/keymaps/drashna_old/config.h +++ b/keyboards/keebio/viterbi/keymaps/drashna_old/config.h | |||
| @@ -20,6 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 20 | #include "../drashna/config.h" | 20 | #include "../drashna/config.h" |
| 21 | 21 | ||
| 22 | #ifdef RGBLIGHT_ENABLE | 22 | #ifdef RGBLIGHT_ENABLE |
| 23 | #undef RGBLED_NUM | 23 | # undef RGBLED_NUM |
| 24 | #define RGBLED_NUM 12 | 24 | # define RGBLED_NUM 12 |
| 25 | #endif | 25 | #endif |
diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 1f04d5298..4719c2269 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h | |||
| @@ -39,37 +39,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 39 | ) | 39 | ) |
| 40 | 40 | ||
| 41 | #ifdef RGBLIGHT_ENABLE | 41 | #ifdef RGBLIGHT_ENABLE |
| 42 | #define RGB_DI_PIN D3 | 42 | # define RGB_DI_PIN D3 |
| 43 | #define RGBLED_NUM 16 // Number of LEDs | 43 | # define RGBLED_NUM 16 // Number of LEDs |
| 44 | #define RGBLED_SPLIT { 8, 8 } | 44 | # define RGBLED_SPLIT { 8, 8 } |
| 45 | 45 | ||
| 46 | #define RGBLIGHT_HUE_STEP 12 | 46 | # define RGBLIGHT_HUE_STEP 12 |
| 47 | #define RGBLIGHT_SAT_STEP 12 | 47 | # define RGBLIGHT_SAT_STEP 12 |
| 48 | #define RGBLIGHT_VAL_STEP 12 | 48 | # define RGBLIGHT_VAL_STEP 12 |
| 49 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 49 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 50 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 50 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 |
| 51 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 52 | #endif // RGBLIGHT_ENABLE | 51 | #endif // RGBLIGHT_ENABLE |
| 53 | 52 | ||
| 54 | #ifdef AUDIO_ENABLE | 53 | #ifdef AUDIO_ENABLE |
| 55 | #define C6_AUDIO | 54 | # define C6_AUDIO |
| 56 | #ifdef RGBLIGHT_ENABLE | 55 | # ifdef RGBLIGHT_ENABLE |
| 57 | #define NO_MUSIC_MODE | 56 | # define NO_MUSIC_MODE |
| 58 | #endif | 57 | # endif |
| 59 | #endif //AUDIO_ENABLE | 58 | #endif //AUDIO_ENABLE |
| 60 | 59 | ||
| 61 | #undef PRODUCT | 60 | #undef PRODUCT |
| 62 | #ifdef KEYBOARD_orthodox_rev1 | 61 | #ifdef KEYBOARD_orthodox_rev1 |
| 63 | #define PRODUCT Drashna Hacked Orthodox Rev.1 | 62 | # define PRODUCT Drashna Hacked Orthodox Rev.1 |
| 64 | #elif KEYBOARD_orthodox_rev3 | 63 | #elif KEYBOARD_orthodox_rev3 |
| 65 | #define PRODUCT Drashna Hacked Orthodox Rev.3 | 64 | # define PRODUCT Drashna Hacked Orthodox Rev.3 |
| 66 | #endif | 65 | #endif |
| 67 | 66 | ||
| 68 | #define QMK_ESC_OUTPUT D7 // usually COL | 67 | #define QMK_ESC_OUTPUT D7 // usually COL |
| 69 | #ifdef KEYBOARD_orthodox_rev1 | 68 | #ifdef KEYBOARD_orthodox_rev1 |
| 70 | #define QMK_ESC_INPUT D4 // usually ROW | 69 | # define QMK_ESC_INPUT D4 // usually ROW |
| 71 | #else | 70 | #else |
| 72 | #define QMK_ESC_INPUT D2 // usually ROW | 71 | # define QMK_ESC_INPUT D2 // usually ROW |
| 73 | #endif | 72 | #endif |
| 74 | #define QMK_LED B0 | 73 | #define QMK_LED B0 |
| 75 | #define QMK_SPEAKER C6 | 74 | #define QMK_SPEAKER C6 |
diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index b1d406905..bde959f5e 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c | |||
| @@ -38,8 +38,8 @@ uint8_t last_osm; | |||
| 38 | ) \ | 38 | ) \ |
| 39 | LAYOUT_wrapper( \ | 39 | LAYOUT_wrapper( \ |
| 40 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ | 40 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ |
| 41 | KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ | 41 | KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 42 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \ | 42 | 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 \ |
| 43 | ) | 43 | ) |
| 44 | #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) | 44 | #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) |
| 45 | 45 | ||
| @@ -123,11 +123,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 123 | }; | 123 | }; |
| 124 | 124 | ||
| 125 | void matrix_init_keymap(void) { | 125 | void matrix_init_keymap(void) { |
| 126 | #ifndef CONVERT_TO_PROTON_C | 126 | #ifndef CONVERT_TO_PROTON_C |
| 127 | setPinOutput(D5); | 127 | setPinOutput(D5); |
| 128 | writePinHigh(D5); | 128 | writePinHigh(D5); |
| 129 | 129 | ||
| 130 | setPinOutput(B0); | 130 | setPinOutput(B0); |
| 131 | writePinHigh(B0); | 131 | writePinHigh(B0); |
| 132 | #endif | 132 | #endif |
| 133 | } | 133 | } |
diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index fdbfc94c9..a122b9e0f 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk | |||
| @@ -7,6 +7,7 @@ TAP_DANCE_ENABLE = no | |||
| 7 | RGBLIGHT_ENABLE = yes | 7 | RGBLIGHT_ENABLE = yes |
| 8 | AUDIO_ENABLE = no | 8 | AUDIO_ENABLE = no |
| 9 | NKRO_ENABLE = yes | 9 | NKRO_ENABLE = yes |
| 10 | SPACE_CADET_ENABLE = no | ||
| 10 | 11 | ||
| 11 | INDICATOR_LIGHTS = yes | 12 | INDICATOR_LIGHTS = yes |
| 12 | MACROS_ENABLED = no | 13 | MACROS_ENABLED = no |
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 7b2ad4fa1..7feaf6f25 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #ifdef RGBLIGHT_ENABLE | 3 | #ifdef RGBLIGHT_ENABLE |
| 4 | #undef RGBLIGHT_SAT_STEP | 4 | # undef RGBLIGHT_SAT_STEP |
| 5 | #define RGBLIGHT_SAT_STEP 12 | 5 | # define RGBLIGHT_SAT_STEP 12 |
| 6 | 6 | ||
| 7 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 | 7 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 |
| 8 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 | 8 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 |
| 9 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 10 | #endif // RGBLIGHT_ENABLE | 9 | #endif // RGBLIGHT_ENABLE |
| 11 | 10 | ||
| 12 | 11 | ||
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 26c2e3304..eeb21501b 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 20 | #ifdef UNICODEMAP_ENABLE | 20 | #ifdef UNICODEMAP_ENABLE |
| 21 | #include "drashna_unicode.h" | 21 | #include "drashna_unicode.h" |
| 22 | #endif // UNICODEMAP_ENABLE | 22 | #endif // UNICODEMAP_ENABLE |
| 23 | #ifndef UNICODE_ENABLE | ||
| 24 | # define UC(x) KC_NO | ||
| 25 | #endif | ||
| 23 | 26 | ||
| 24 | #ifdef RGB_MATRIX_ENABLE | 27 | #ifdef RGB_MATRIX_ENABLE |
| 25 | extern bool g_suspend_state; | 28 | extern bool g_suspend_state; |
| @@ -28,7 +31,7 @@ extern rgb_config_t rgb_matrix_config; | |||
| 28 | extern userspace_config_t userspace_config; | 31 | extern userspace_config_t userspace_config; |
| 29 | 32 | ||
| 30 | enum more_custom_keycodes { | 33 | enum more_custom_keycodes { |
| 31 | KC_SWAP_NUM = NEW_SAFE_RANGE | 34 | KC_SWAP_NUM = NEW_SAFE_RANGE |
| 32 | }; | 35 | }; |
| 33 | 36 | ||
| 34 | //define layer change stuff for underglow indicator | 37 | //define layer change stuff for underglow indicator |
| @@ -43,7 +46,7 @@ bool skip_leds = false; | |||
| 43 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ | 46 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ |
| 44 | KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ | 47 | KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ |
| 45 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ | 48 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 46 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ | 49 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ |
| 47 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ | 50 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ |
| 48 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ | 51 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ |
| 49 | KC_APP, KC_MENU, \ | 52 | KC_APP, KC_MENU, \ |
| @@ -305,87 +308,88 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 305 | 308 | ||
| 306 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 309 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 307 | 310 | ||
| 308 | switch (keycode) { | 311 | switch (keycode) { |
| 309 | case KC_1: | 312 | case KC_1: |
| 310 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { | 313 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { |
| 311 | if (record->event.pressed) { | 314 | if (record->event.pressed) { |
| 312 | register_code(KC_2); | 315 | register_code(KC_2); |
| 313 | } else { | 316 | } else { |
| 314 | unregister_code(KC_2); | 317 | unregister_code(KC_2); |
| 315 | } | 318 | } |
| 316 | return false; | 319 | return false; |
| 317 | } | 320 | } |
| 318 | break; | 321 | break; |
| 319 | case KC_2: | 322 | case KC_2: |
| 320 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { | 323 | if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) { |
| 321 | if (record->event.pressed) { | 324 | if (record->event.pressed) { |
| 322 | register_code(KC_1); | 325 | register_code(KC_1); |
| 323 | } else { | 326 | } else { |
| 324 | unregister_code(KC_1); | 327 | unregister_code(KC_1); |
| 325 | } | 328 | } |
| 326 | return false; | 329 | return false; |
| 327 | } | 330 | } |
| 328 | break; | 331 | break; |
| 329 | case KC_SWAP_NUM: | 332 | case KC_SWAP_NUM: |
| 330 | if (record->event.pressed) { | 333 | if (record->event.pressed) { |
| 331 | userspace_config.swapped_numbers ^= 1; | 334 | userspace_config.swapped_numbers ^= 1; |
| 332 | eeconfig_update_user(userspace_config.raw); | 335 | eeconfig_update_user(userspace_config.raw); |
| 333 | } | 336 | } |
| 334 | } | 337 | break; |
| 335 | //switch (keycode) { | 338 | } |
| 336 | // case KC_P00: | 339 | //switch (keycode) { |
| 337 | // if (!record->event.pressed) { | 340 | // case KC_P00: |
| 338 | // register_code(KC_KP_0); | 341 | // if (!record->event.pressed) { |
| 339 | // unregister_code(KC_KP_0); | 342 | // register_code(KC_KP_0); |
| 340 | // register_code(KC_KP_0); | 343 | // unregister_code(KC_KP_0); |
| 341 | // unregister_code(KC_KP_0); | 344 | // register_code(KC_KP_0); |
| 342 | // } | 345 | // unregister_code(KC_KP_0); |
| 343 | // return false; | 346 | // } |
| 344 | // break; | 347 | // return false; |
| 345 | //} | 348 | // break; |
| 346 | return true; | 349 | //} |
| 350 | return true; | ||
| 347 | } | 351 | } |
| 348 | 352 | ||
| 349 | void matrix_scan_keymap(void) { // runs frequently to update info | 353 | void matrix_scan_keymap(void) { // runs frequently to update info |
| 350 | uint8_t modifiers = get_mods(); | 354 | uint8_t modifiers = get_mods(); |
| 351 | uint8_t led_usb_state = host_keyboard_leds(); | 355 | uint8_t led_usb_state = host_keyboard_leds(); |
| 352 | uint8_t one_shot = get_oneshot_mods(); | 356 | uint8_t one_shot = get_oneshot_mods(); |
| 353 | 357 | ||
| 354 | if (!skip_leds) { | 358 | if (!skip_leds) { |
| 355 | ergodox_board_led_off(); | 359 | ergodox_board_led_off(); |
| 356 | ergodox_right_led_1_off(); | 360 | ergodox_right_led_1_off(); |
| 357 | ergodox_right_led_2_off(); | 361 | ergodox_right_led_2_off(); |
| 358 | ergodox_right_led_3_off(); | 362 | ergodox_right_led_3_off(); |
| 359 | 363 | ||
| 360 | // Since we're not using the LEDs here for layer indication anymore, | 364 | // Since we're not using the LEDs here for layer indication anymore, |
| 361 | // then lets use them for modifier indicators. Shame we don't have 4... | 365 | // then lets use them for modifier indicators. Shame we don't have 4... |
| 362 | // Also, no "else", since we want to know each, independently. | 366 | // Also, no "else", since we want to know each, independently. |
| 363 | if ( ( modifiers | one_shot ) & MOD_MASK_SHIFT || led_usb_state & (1<<USB_LED_CAPS_LOCK) ) { | 367 | if ( ( modifiers | one_shot ) & MOD_MASK_SHIFT || led_usb_state & (1<<USB_LED_CAPS_LOCK) ) { |
| 364 | ergodox_right_led_2_on(); | 368 | ergodox_right_led_2_on(); |
| 365 | ergodox_right_led_2_set( 50 ); | 369 | ergodox_right_led_2_set( 50 ); |
| 366 | } | 370 | } |
| 367 | if ( ( modifiers | one_shot ) & MOD_MASK_CTRL) { | 371 | if ( ( modifiers | one_shot ) & MOD_MASK_CTRL) { |
| 368 | ergodox_right_led_1_on(); | 372 | ergodox_right_led_1_on(); |
| 369 | ergodox_right_led_1_set( 10 ); | 373 | ergodox_right_led_1_set( 10 ); |
| 370 | } | 374 | } |
| 371 | if ( ( modifiers | one_shot ) & MOD_MASK_ALT) { | 375 | if ( ( modifiers | one_shot ) & MOD_MASK_ALT) { |
| 372 | ergodox_right_led_3_on(); | 376 | ergodox_right_led_3_on(); |
| 373 | ergodox_right_led_3_set( 10 ); | 377 | ergodox_right_led_3_set( 10 ); |
| 374 | } | 378 | } |
| 375 | 379 | ||
| 376 | } | 380 | } |
| 377 | 381 | ||
| 378 | }; | 382 | } |
| 379 | 383 | ||
| 380 | 384 | ||
| 381 | bool indicator_is_this_led_used_keyboard(uint8_t index) { | 385 | bool indicator_is_this_led_used_keyboard(uint8_t index) { |
| 382 | switch (index) { | 386 | switch (index) { |
| 383 | case 13 ... 14: | 387 | case 13 ... 14: |
| 384 | return true; | 388 | return true; |
| 385 | break; | 389 | break; |
| 386 | default: | 390 | default: |
| 387 | return false; | 391 | return false; |
| 388 | } | 392 | } |
| 389 | } | 393 | } |
| 390 | 394 | ||
| 391 | 395 | ||
| @@ -393,101 +397,81 @@ bool indicator_is_this_led_used_keyboard(uint8_t index) { | |||
| 393 | 397 | ||
| 394 | void suspend_power_down_keymap(void) { | 398 | void suspend_power_down_keymap(void) { |
| 395 | rgb_matrix_set_suspend_state(true); | 399 | rgb_matrix_set_suspend_state(true); |
| 396 | rgb_matrix_config.enable = false; | ||
| 397 | } | 400 | } |
| 398 | 401 | ||
| 399 | void suspend_wakeup_init_keymap(void) { | 402 | void suspend_wakeup_init_keymap(void) { |
| 400 | rgb_matrix_config.enable = true; | ||
| 401 | rgb_matrix_set_suspend_state(false); | 403 | rgb_matrix_set_suspend_state(false); |
| 402 | } | 404 | } |
| 403 | 405 | ||
| 404 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { | 406 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { |
| 405 | rgb_led led; | 407 | rgb_led led; |
| 406 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 408 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 407 | led = g_rgb_leds[i]; | 409 | led = g_rgb_leds[i]; |
| 408 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { | 410 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { |
| 409 | rgb_matrix_set_color( i, red, green, blue ); | 411 | rgb_matrix_set_color( i, red, green, blue ); |
| 412 | } | ||
| 410 | } | 413 | } |
| 411 | } | ||
| 412 | } | 414 | } |
| 413 | 415 | ||
| 414 | void rgb_matrix_indicators_user(void) { | 416 | void rgb_matrix_indicators_user(void) { |
| 415 | if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) { return; } | 417 | if ( userspace_config.rgb_layer_change && |
| 416 | 418 | #ifdef RGB_DISABLE_WHEN_USB_SUSPENDED | |
| 417 | switch (biton32(layer_state)) { | 419 | !g_suspend_state && |
| 418 | case _MODS: | ||
| 419 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 420 | case _GAMEPAD: | ||
| 421 | rgb_matrix_layer_helper(0xFF, 0x80, 0x00); | ||
| 422 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q | ||
| 423 | rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W | ||
| 424 | rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E | ||
| 425 | rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R | ||
| 426 | rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A | ||
| 427 | rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S | ||
| 428 | rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D | ||
| 429 | rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F | ||
| 430 | |||
| 431 | rgb_matrix_set_color(27, 0xFF, 0xFF, 0xFF); // 1 | ||
| 432 | rgb_matrix_set_color(26, 0x00, 0xFF, 0x00); // 2 | ||
| 433 | rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 | ||
| 434 | |||
| 435 | break; | ||
| 436 | case _DIABLO: | ||
| 437 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 438 | case _RAISE: | ||
| 439 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 440 | case _LOWER: | ||
| 441 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 442 | case _ADJUST: | ||
| 443 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 444 | default: | ||
| 445 | switch (biton32(default_layer_state)) { | ||
| 446 | case _QWERTY: | ||
| 447 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; | ||
| 448 | case _COLEMAK: | ||
| 449 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; | ||
| 450 | case _DVORAK: | ||
| 451 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 452 | case _WORKMAN: | ||
| 453 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; | ||
| 454 | case _NORMAN: | ||
| 455 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; | ||
| 456 | case _MALTRON: | ||
| 457 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 458 | case _EUCALYN: | ||
| 459 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; | ||
| 460 | case _CARPLAX: | ||
| 461 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; | ||
| 462 | } | ||
| 463 | } | ||
| 464 | #if 0 | ||
| 465 | if (this_mod & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MOD_MASK_SHIFT) { | ||
| 466 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | ||
| 467 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | ||
| 468 | } | ||
| 469 | if (this_mod & MOD_MASK_CTRL || this_osm & MOD_MASK_CTRL) { | ||
| 470 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | ||
| 471 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | ||
| 472 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | ||
| 473 | |||
| 474 | } | ||
| 475 | if (this_mod & MOD_MASK_GUI || this_osm & MOD_MASK_GUI) { | ||
| 476 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | ||
| 477 | } | ||
| 478 | if (this_mod & MOD_MASK_ALT || this_osm & MOD_MASK_ALT) { | ||
| 479 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | ||
| 480 | } | ||
| 481 | #endif | 420 | #endif |
| 482 | } | 421 | #if defined(RGBLIGHT_ENABLE) |
| 483 | 422 | (!rgblight_config.enable && rgb_matrix_config.enable) | |
| 484 | void matrix_init_keymap(void) { | 423 | #else |
| 485 | #if 0 | 424 | rgb_matrix_config.enable |
| 486 | #ifdef RGB_MATRIX_KEYPRESSES | ||
| 487 | rgblight_mode(RGB_MATRIX_MULTISPLASH); | ||
| 488 | #else | ||
| 489 | rgblight_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON); | ||
| 490 | #endif | ||
| 491 | #endif | 425 | #endif |
| 426 | ) { | ||
| 427 | switch (biton32(layer_state)) { | ||
| 428 | case _MODS: | ||
| 429 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 430 | case _GAMEPAD: | ||
| 431 | rgb_matrix_layer_helper(0xFF, 0x80, 0x00); | ||
| 432 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q | ||
| 433 | rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W | ||
| 434 | rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E | ||
| 435 | rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R | ||
| 436 | rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A | ||
| 437 | rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S | ||
| 438 | rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D | ||
| 439 | rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F | ||
| 440 | |||
| 441 | rgb_matrix_set_color(27, 0xFF, 0xFF, 0xFF); // 1 | ||
| 442 | rgb_matrix_set_color(26, 0x00, 0xFF, 0x00); // 2 | ||
| 443 | rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 | ||
| 444 | |||
| 445 | break; | ||
| 446 | case _DIABLO: | ||
| 447 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 448 | case _RAISE: | ||
| 449 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 450 | case _LOWER: | ||
| 451 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 452 | case _ADJUST: | ||
| 453 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 454 | default: | ||
| 455 | switch (biton32(default_layer_state)) { | ||
| 456 | case _QWERTY: | ||
| 457 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; | ||
| 458 | case _COLEMAK: | ||
| 459 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; | ||
| 460 | case _DVORAK: | ||
| 461 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 462 | case _WORKMAN: | ||
| 463 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; | ||
| 464 | case _NORMAN: | ||
| 465 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; | ||
| 466 | case _MALTRON: | ||
| 467 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 468 | case _EUCALYN: | ||
| 469 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; | ||
| 470 | case _CARPLAX: | ||
| 471 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; | ||
| 472 | } | ||
| 473 | } | ||
| 474 | } | ||
| 492 | } | 475 | } |
| 476 | |||
| 493 | #endif //RGB_MATRIX_INIT | 477 | #endif //RGB_MATRIX_INIT |
diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index ee231321e..f0628d9da 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk | |||
| @@ -1,19 +1,20 @@ | |||
| 1 | TAP_DANCE_ENABLE = yes | 1 | TAP_DANCE_ENABLE = yes |
| 2 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 2 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 3 | COMMAND_ENABLE = no # Commands for debug and configuration | 3 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 4 | SPACE_CADET_ENABLE = no | ||
| 4 | ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) | 5 | ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) |
| 5 | RGBLIGHT_ENABLE = yes | 6 | RGBLIGHT_ENABLE = yes |
| 6 | RGB_MATRIX_ENABLE = no | 7 | RGB_MATRIX_ENABLE = no |
| 7 | endif | 8 | endif |
| 8 | CONSOLE_ENABLE = no | 9 | CONSOLE_ENABLE = no |
| 9 | BOOTMAGIC_ENABLE = yes | 10 | BOOTMAGIC_ENABLE = yes |
| 10 | 11 | ||
| 11 | UNICODE_ENABLE = yes | 12 | UNICODE_ENABLE = yes |
| 12 | UNICDOEMAP_ENABLE = no | 13 | UNICDOEMAP_ENABLE = no |
| 13 | 14 | ||
| 14 | MACROS_ENABLED = no | 15 | MACROS_ENABLED = no |
| 15 | RGBLIGHT_TWINKLE = no | 16 | RGBLIGHT_TWINKLE = no |
| 16 | INDICATOR_LIGHTS = no | 17 | INDICATOR_LIGHTS = no |
| 17 | RGBLIGHT_STARTUP_ANIMATION = yes | 18 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 18 | 19 | ||
| 19 | DEBOUNCE_TYPE = eager_pk | 20 | DEBOUNCE_TYPE = eager_pk |
diff --git a/layouts/community/ergodox/drashna_glow/config.h b/layouts/community/ergodox/drashna_glow/config.h index e2d959426..5eb1c6d0f 100644 --- a/layouts/community/ergodox/drashna_glow/config.h +++ b/layouts/community/ergodox/drashna_glow/config.h | |||
| @@ -6,10 +6,21 @@ | |||
| 6 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow | 6 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow |
| 7 | 7 | ||
| 8 | #ifdef RGB_MATRIX_ENABLE | 8 | #ifdef RGB_MATRIX_ENABLE |
| 9 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | 9 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) |
| 10 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) | 10 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) |
| 11 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 11 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 12 | #define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended | 12 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended |
| 13 | // #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 | 13 | // #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 |
| 14 | // #define EECONFIG_RGB_MATRIX (uint32_t *)16 | 14 | // #define EECONFIG_RGB_MATRIX (uint32_t *)16 |
| 15 | |||
| 16 | # define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 17 | # define DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 18 | # define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 19 | # define DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 20 | # define DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 21 | # define DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 22 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 23 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 24 | # define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 25 | |||
| 15 | #endif | 26 | #endif |
diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h index e3a70694a..2fc5ab658 100644 --- a/layouts/community/numpad_5x6/drashna/config.h +++ b/layouts/community/numpad_5x6/drashna/config.h | |||
| @@ -3,18 +3,17 @@ | |||
| 3 | // #define B6_AUDIO | 3 | // #define B6_AUDIO |
| 4 | 4 | ||
| 5 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) | 5 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) |
| 6 | #define RGB_DI_PIN B1 | 6 | # define RGB_DI_PIN B1 |
| 7 | #define RGBLED_NUM 16 // Number of LEDs | 7 | # define RGBLED_NUM 16 // Number of LEDs |
| 8 | 8 | ||
| 9 | #define RGBLIGHT_HUE_STEP 12 | 9 | # define RGBLIGHT_HUE_STEP 12 |
| 10 | #define RGBLIGHT_SAT_STEP 12 | 10 | # define RGBLIGHT_SAT_STEP 12 |
| 11 | #define RGBLIGHT_VAL_STEP 12 | 11 | # define RGBLIGHT_VAL_STEP 12 |
| 12 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 12 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 13 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 13 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 |
| 14 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | ||
| 15 | #endif // RGBLIGHT_ENABLE | 14 | #endif // RGBLIGHT_ENABLE |
| 16 | 15 | ||
| 17 | #if defined(KEYBOARD_primekb_prime_m) | 16 | #if defined(KEYBOARD_primekb_prime_m) |
| 18 | #undef PRODUCT | 17 | # undef PRODUCT |
| 19 | #define PRODUCT Drashna Hacked Prime_M Macro Pad | 18 | # define PRODUCT Drashna Hacked Prime_M Macro Pad |
| 20 | #endif | 19 | #endif |
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index f8e12f33d..475afd213 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h | |||
| @@ -2,49 +2,52 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) | 4 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) |
| 5 | #define RGB_DI_PIN B3 | 5 | # define RGB_DI_PIN B3 |
| 6 | #define RGBLED_NUM 13 // Number of LEDs | 6 | # define RGBLED_NUM 13 // Number of LEDs |
| 7 | #define RGBLIGHT_ANIMATIONS | 7 | # define RGBLIGHT_ANIMATIONS |
| 8 | #define RGBLIGHT_HUE_STEP 12 | 8 | # define RGBLIGHT_HUE_STEP 12 |
| 9 | #define RGBLIGHT_SAT_STEP 12 | 9 | # define RGBLIGHT_SAT_STEP 12 |
| 10 | #define RGBLIGHT_VAL_STEP 12 | 10 | # define RGBLIGHT_VAL_STEP 12 |
| 11 | #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 | 11 | # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 |
| 12 | #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 | 12 | # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 |
| 13 | #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 | 13 | # ifdef RGB_MATRIX_ENABLE |
| 14 | # define RGBLIGHT_DISABLE_KEYCODES | ||
| 15 | # endif | ||
| 14 | #endif // RGBLIGHT_ENABLE | 16 | #endif // RGBLIGHT_ENABLE |
| 15 | 17 | ||
| 16 | #ifdef RGB_MATRIX_ENABLE | 18 | #ifdef RGB_MATRIX_ENABLE |
| 17 | #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | 19 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) |
| 18 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) | 20 | // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) |
| 19 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 21 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 20 | #define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended | ||
| 21 | // #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 | 22 | // #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 |
| 22 | #define EECONFIG_RGB_MATRIX (uint32_t *)15 | 23 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended |
| 24 | # ifndef KEYBOARD_planck_ez | ||
| 25 | # define EECONFIG_RGB_MATRIX (uint32_t *)15 | ||
| 26 | # endif | ||
| 23 | #endif | 27 | #endif |
| 24 | 28 | ||
| 25 | #if defined(KEYBOARD_lets_split_rev2) | 29 | #if defined(KEYBOARD_lets_split_rev2) |
| 26 | #define USE_SERIAL | 30 | # define USE_SERIAL |
| 27 | #undef USE_I2C | 31 | # undef USE_I2C |
| 28 | 32 | # define EE_HANDS | |
| 29 | #define EE_HANDS | ||
| 30 | #endif | 33 | #endif |
| 31 | 34 | ||
| 32 | #if !defined(KEYBOARD_planck_light) | 35 | #if !defined(KEYBOARD_planck_light) |
| 33 | #ifdef RGBLIGHT_ENABLE | 36 | # ifdef RGBLIGHT_ENABLE |
| 34 | #define NO_MUSIC_MODE | 37 | # define NO_MUSIC_MODE |
| 35 | #endif // RGBLIGHT_ENABLE | 38 | # endif // RGBLIGHT_ENABLE |
| 36 | #endif // KEYBOARD_planck_light | 39 | #endif // KEYBOARD_planck_light |
| 37 | 40 | ||
| 38 | 41 | ||
| 39 | #if defined(KEYBOARD_planck) | 42 | #if defined(KEYBOARD_planck) |
| 40 | #undef PRODUCT | 43 | # undef PRODUCT |
| 41 | #if defined(KEYBOARD_planck_light) | 44 | # if defined(KEYBOARD_planck_light) |
| 42 | #define PRODUCT Drashna Hacked RGB Beacon (Planck Light) | 45 | # define PRODUCT Drashna Hacked RGB Beacon (Planck Light) |
| 43 | #elif defined(KEYBOARD_planck_rev6) | 46 | # elif defined(KEYBOARD_planck_rev6) |
| 44 | #define PRODUCT Drashna Hacked Planck Rev6 | 47 | # define PRODUCT Drashna Hacked Planck Rev6 |
| 45 | #elif defined(KEYBOARD_planck_EZ) | 48 | # elif defined(KEYBOARD_planck_EZ) |
| 46 | #define PRODUCT Drashna Hacked Planck EZ | 49 | # define PRODUCT Drashna Hacked Planck EZ |
| 47 | #endif | 50 | # endif |
| 48 | #endif | 51 | #endif |
| 49 | 52 | ||
| 50 | /* | 53 | /* |
| @@ -58,7 +61,7 @@ | |||
| 58 | - MIDI notes can be sent when in Music mode is on | 61 | - MIDI notes can be sent when in Music mode is on |
| 59 | */ | 62 | */ |
| 60 | 63 | ||
| 61 | #define MIDI_BASIC | 64 | // #define MIDI_BASIC |
| 62 | 65 | ||
| 63 | /* enable advanced MIDI features: | 66 | /* enable advanced MIDI features: |
| 64 | - MIDI notes can be added to the keymap | 67 | - MIDI notes can be added to the keymap |
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index f82b4e7da..5eef2e023 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c | |||
| @@ -34,6 +34,18 @@ enum planck_keycodes { | |||
| 34 | #define BACKLIT OSM(MOD_LSFT) | 34 | #define BACKLIT OSM(MOD_LSFT) |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | #ifdef KEYBOARD_planck_ez | ||
| 38 | # define PLNK_1 BK_LWER | ||
| 39 | # define PLNK_2 SP_LWER | ||
| 40 | # define PLNK_3 KC_NO | ||
| 41 | # define PLNK_4 ET_RAIS | ||
| 42 | #else | ||
| 43 | # define PLNK_1 SP_LWER | ||
| 44 | # define PLNK_2 BK_LWER | ||
| 45 | # define PLNK_3 DL_RAIS | ||
| 46 | # define PLNK_4 ET_RAIS | ||
| 47 | #endif | ||
| 48 | |||
| 37 | #define LAYOUT_ortho_4x12_base( \ | 49 | #define LAYOUT_ortho_4x12_base( \ |
| 38 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 50 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| 39 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 51 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
| @@ -42,8 +54,8 @@ enum planck_keycodes { | |||
| 42 | LAYOUT_ortho_4x12_wrapper( \ | 54 | LAYOUT_ortho_4x12_wrapper( \ |
| 43 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ | 55 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ |
| 44 | KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ | 56 | KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 45 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_ENT, \ | 57 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ |
| 46 | BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | 58 | BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ |
| 47 | ) | 59 | ) |
| 48 | #define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) | 60 | #define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) |
| 49 | 61 | ||
| @@ -130,128 +142,132 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 130 | 142 | ||
| 131 | 143 | ||
| 132 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 144 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 133 | switch (keycode) { | 145 | switch (keycode) { |
| 134 | 146 | #ifdef BACKLIGHT_ENABLE | |
| 135 | #ifdef BACKLIGHT_ENABLE | 147 | case BACKLIT: |
| 136 | case BACKLIT: | 148 | if (record->event.pressed) { |
| 137 | if (record->event.pressed) { | 149 | register_code(KC_RSFT); |
| 138 | register_code(KC_RSFT); | 150 | #ifdef BACKLIGHT_ENABLE |
| 139 | #ifdef BACKLIGHT_ENABLE | 151 | backlight_step(); |
| 140 | backlight_step(); | 152 | #endif |
| 141 | #endif | 153 | } else { |
| 142 | } else { | 154 | unregister_code(KC_RSFT); |
| 143 | unregister_code(KC_RSFT); | 155 | } |
| 144 | } | 156 | return false; |
| 145 | return false; | 157 | break; |
| 146 | break; | ||
| 147 | #endif | 158 | #endif |
| 148 | } | 159 | } |
| 149 | return true; | 160 | return true; |
| 150 | } | 161 | } |
| 151 | 162 | ||
| 152 | bool music_mask_user(uint16_t keycode) { | 163 | bool music_mask_user(uint16_t keycode) { |
| 153 | switch (keycode) { | 164 | switch (keycode) { |
| 154 | case RAISE: | 165 | case RAISE: |
| 155 | case LOWER: | 166 | case LOWER: |
| 156 | case BK_LWER: | 167 | case BK_LWER: |
| 157 | case SP_LWER: | 168 | case SP_LWER: |
| 158 | case DL_RAIS: | 169 | case DL_RAIS: |
| 159 | case ET_RAIS: | 170 | case ET_RAIS: |
| 160 | return false; | 171 | return false; |
| 161 | default: | 172 | default: |
| 162 | return true; | 173 | return true; |
| 163 | } | 174 | } |
| 164 | } | 175 | } |
| 165 | 176 | ||
| 166 | #ifdef RGB_MATRIX_ENABLE | 177 | #ifdef RGB_MATRIX_ENABLE |
| 167 | 178 | ||
| 168 | void suspend_power_down_keymap(void) { | 179 | void suspend_power_down_keymap(void) { |
| 169 | rgb_matrix_set_suspend_state(true); | 180 | rgb_matrix_set_suspend_state(true); |
| 170 | rgb_matrix_config.enable = false; | ||
| 171 | } | 181 | } |
| 172 | 182 | ||
| 173 | void suspend_wakeup_init_keymap(void) { | 183 | void suspend_wakeup_init_keymap(void) { |
| 174 | rgb_matrix_config.enable = true; | ||
| 175 | rgb_matrix_set_suspend_state(false); | 184 | rgb_matrix_set_suspend_state(false); |
| 176 | } | 185 | } |
| 177 | 186 | ||
| 178 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { | 187 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { |
| 179 | rgb_led led; | 188 | rgb_led led; |
| 180 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 189 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 181 | led = g_rgb_leds[i]; | 190 | led = g_rgb_leds[i]; |
| 182 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { | 191 | if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { |
| 183 | rgb_matrix_set_color( i, red, green, blue ); | 192 | rgb_matrix_set_color( i, red, green, blue ); |
| 193 | } | ||
| 184 | } | 194 | } |
| 185 | } | ||
| 186 | } | 195 | } |
| 187 | 196 | ||
| 188 | void rgb_matrix_indicators_user(void) { | 197 | void rgb_matrix_indicators_user(void) { |
| 189 | uint8_t this_mod = get_mods(); | 198 | uint8_t this_mod = get_mods(); |
| 190 | uint8_t this_led = host_keyboard_leds(); | 199 | uint8_t this_led = host_keyboard_leds(); |
| 191 | uint8_t this_osm = get_oneshot_mods(); | 200 | uint8_t this_osm = get_oneshot_mods(); |
| 192 | 201 | bool is_ez; | |
| 193 | if (!g_suspend_state && userspace_config.rgb_layer_change && | 202 | #ifdef KEYBOARD_planck_ez |
| 194 | #if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) | 203 | is_ez = true; |
| 195 | (!rgblight_config.enable && rgb_matrix_config.enable) | 204 | #endif |
| 205 | |||
| 206 | if ( userspace_config.rgb_layer_change && | ||
| 207 | #ifdef RGB_DISABLE_WHEN_USB_SUSPENDED | ||
| 208 | !g_suspend_state && | ||
| 209 | #endif | ||
| 210 | #if defined(RGBLIGHT_ENABLE) | ||
| 211 | (!rgblight_config.enable && rgb_matrix_config.enable) | ||
| 196 | #else | 212 | #else |
| 197 | rgb_matrix_config.enable | 213 | rgb_matrix_config.enable |
| 198 | #endif | 214 | #endif |
| 199 | ) { | 215 | ) { |
| 200 | switch (biton32(layer_state)) { | 216 | switch (biton32(layer_state)) { |
| 201 | case _RAISE: | 217 | case _RAISE: |
| 202 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; | 218 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; |
| 203 | case _LOWER: | 219 | case _LOWER: |
| 204 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; | 220 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; |
| 205 | case _ADJUST: | 221 | case _ADJUST: |
| 206 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; | 222 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; |
| 207 | default: | 223 | default: |
| 208 | switch (biton32(default_layer_state)) { | 224 | switch (biton32(default_layer_state)) { |
| 209 | case _QWERTY: | 225 | case _QWERTY: |
| 210 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; | 226 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; |
| 211 | case _COLEMAK: | 227 | case _COLEMAK: |
| 212 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; | 228 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; |
| 213 | case _DVORAK: | 229 | case _DVORAK: |
| 214 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; | 230 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; |
| 215 | case _WORKMAN: | 231 | case _WORKMAN: |
| 216 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; | 232 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; |
| 217 | case _NORMAN: | 233 | case _NORMAN: |
| 218 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D, true); break; | 234 | rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; |
| 219 | case _MALTRON: | 235 | case _MALTRON: |
| 220 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, true); break; | 236 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; |
| 221 | case _EUCALYN: | 237 | case _EUCALYN: |
| 222 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF, true); break; | 238 | rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; |
| 223 | case _CARPLAX: | 239 | case _CARPLAX: |
| 224 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF, true); break; | 240 | rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; |
| 241 | } | ||
| 225 | } | 242 | } |
| 226 | } | 243 | } |
| 227 | } | 244 | |
| 228 | 245 | switch (biton32(default_layer_state)) { | |
| 229 | switch (biton32(default_layer_state)) { | 246 | case _QWERTY: |
| 230 | case _QWERTY: | 247 | rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); break; |
| 231 | rgb_matrix_set_color(42, 0x00, 0xFF, 0xFF); break; | 248 | case _COLEMAK: |
| 232 | case _COLEMAK: | 249 | rgb_matrix_set_color(is_ez ? 41 : 42, 0xFF, 0x00, 0xFF); break; |
| 233 | rgb_matrix_set_color(42, 0xFF, 0x00, 0xFF); break; | 250 | case _DVORAK: |
| 234 | case _DVORAK: | 251 | rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0x00); break; |
| 235 | rgb_matrix_set_color(42, 0x00, 0xFF, 0x00); break; | 252 | case _WORKMAN: |
| 236 | case _WORKMAN: | 253 | rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21); break; |
| 237 | rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break; | 254 | } |
| 238 | } | 255 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK)) { |
| 239 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK)) { | 256 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); |
| 240 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | 257 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); |
| 241 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | 258 | } |
| 242 | } | 259 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { |
| 243 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { | 260 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); |
| 244 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | 261 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); |
| 245 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | 262 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); |
| 246 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | 263 | |
| 247 | 264 | } | |
| 248 | } | 265 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { |
| 249 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { | 266 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); |
| 250 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | 267 | } |
| 251 | } | 268 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { |
| 252 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { | 269 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); |
| 253 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | 270 | } |
| 254 | } | ||
| 255 | } | 271 | } |
| 256 | 272 | ||
| 257 | void matrix_init_keymap(void) { | 273 | void matrix_init_keymap(void) { |
| @@ -260,57 +276,81 @@ void matrix_init_keymap(void) { | |||
| 260 | #else //RGB_MATRIX_INIT | 276 | #else //RGB_MATRIX_INIT |
| 261 | 277 | ||
| 262 | void matrix_init_keymap(void) { | 278 | void matrix_init_keymap(void) { |
| 263 | #if !defined(CONVERT_TO_PROTON_C) && !defined(KEYBOARD_planck) | 279 | #if !defined(CONVERT_TO_PROTON_C) && !defined(KEYBOARD_planck) |
| 264 | setPinOutput(D5); | 280 | setPinOutput(D5); |
| 265 | writePinHigh(D5); | 281 | writePinHigh(D5); |
| 266 | 282 | ||
| 267 | setPinOutput(B0); | 283 | setPinOutput(B0); |
| 268 | writePinHigh(B0); | 284 | writePinHigh(B0); |
| 269 | #endif | 285 | #endif |
| 270 | } | 286 | } |
| 271 | #endif //RGB_MATRIX_INIT | 287 | #endif //RGB_MATRIX_INIT |
| 272 | 288 | ||
| 273 | #ifdef ENCODER_ENABLE | 289 | #ifdef ENCODER_ENABLE |
| 274 | void encoder_update(bool clockwise) { | 290 | void encoder_update(bool clockwise) { |
| 275 | switch (biton32(layer_state)) { | 291 | switch (biton32(layer_state)) { |
| 276 | case _RAISE: | 292 | case _RAISE: |
| 277 | clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); | 293 | clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); |
| 278 | break; | 294 | break; |
| 279 | case _LOWER: | 295 | case _LOWER: |
| 280 | #ifdef RGB_MATRIX_ENABLE | 296 | #ifdef RGB_MATRIX_ENABLE |
| 281 | clockwise ? rgb_matrix_step() : rgblight_step_reverse(); | 297 | clockwise ? rgb_matrix_step() : rgblight_step_reverse(); |
| 282 | #else | 298 | #else |
| 283 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); | 299 | clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); |
| 284 | #endif | 300 | #endif |
| 285 | case _ADJUST: | 301 | break; |
| 286 | #ifdef AUDIO_CLICKY | 302 | case _ADJUST: |
| 287 | clockwise ? clicky_freq_up() : clicky_freq_down(); | 303 | #ifdef AUDIO_CLICKY |
| 288 | #endif | 304 | clockwise ? clicky_freq_up() : clicky_freq_down(); |
| 289 | break; | 305 | #endif |
| 290 | default: | 306 | break; |
| 291 | clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP); | 307 | default: |
| 292 | } | 308 | clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP); |
| 293 | #ifdef AUDIO_CLICKY | 309 | } |
| 310 | #ifdef AUDIO_CLICKY | ||
| 294 | clicky_play(); | 311 | clicky_play(); |
| 295 | #endif | 312 | #endif |
| 296 | } | 313 | } |
| 297 | #endif // ENCODER_ENABLE | 314 | #endif // ENCODER_ENABLE |
| 298 | 315 | ||
| 299 | #ifdef KEYBOARD_planck_rev6 | 316 | #ifdef KEYBOARD_planck_rev6 |
| 300 | void dip_update(uint8_t index, bool active) { | 317 | void dip_update(uint8_t index, bool active) { |
| 301 | switch (index) { | 318 | switch (index) { |
| 302 | case 0: | 319 | case 0: |
| 303 | if(active) { audio_on(); } else { audio_off(); } | 320 | if(active) { audio_on(); } else { audio_off(); } |
| 304 | break; | 321 | break; |
| 305 | case 1: | 322 | case 1: |
| 306 | if(active) { clicky_on(); } else { clicky_off(); } | 323 | if(active) { clicky_on(); } else { clicky_off(); } |
| 307 | break; | 324 | break; |
| 308 | case 2: | 325 | case 2: |
| 309 | keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; | 326 | keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; |
| 310 | break; | 327 | break; |
| 311 | case 3: | 328 | case 3: |
| 312 | userspace_config.nuke_switch = active; | 329 | userspace_config.nuke_switch = active; |
| 313 | break; | 330 | break; |
| 314 | } | 331 | } |
| 315 | } | 332 | } |
| 316 | #endif // KEYBOARD_planck_rev6 | 333 | #endif // KEYBOARD_planck_rev6 |
| 334 | |||
| 335 | #ifdef KEYBOARD_planck_ez | ||
| 336 | uint32_t layer_state_set_keymap(uint32_t state) { | ||
| 337 | |||
| 338 | palClearPad(GPIOB, 8); | ||
| 339 | palClearPad(GPIOB, 9); | ||
| 340 | switch (biton32(state)) { | ||
| 341 | case _LOWER: | ||
| 342 | palSetPad(GPIOB, 9); | ||
| 343 | break; | ||
| 344 | case _RAISE: | ||
| 345 | palSetPad(GPIOB, 8); | ||
| 346 | break; | ||
| 347 | case _ADJUST: | ||
| 348 | palSetPad(GPIOB, 9); | ||
| 349 | palSetPad(GPIOB, 8); | ||
| 350 | break; | ||
| 351 | default: | ||
| 352 | break; | ||
| 353 | } | ||
| 354 | return state; | ||
| 355 | } | ||
| 356 | #endif | ||
diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 89acba9eb..351201e2f 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk | |||
| @@ -5,16 +5,27 @@ CONSOLE_ENABLE = no # Console for debug(+400) | |||
| 5 | COMMAND_ENABLE = no # Commands for debug and configuration | 5 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 6 | TAP_DANCE_ENABLE = no | 6 | TAP_DANCE_ENABLE = no |
| 7 | AUDIO_ENABLE = yes | 7 | AUDIO_ENABLE = yes |
| 8 | SPACE_CADET_ENABLE = no | ||
| 9 | |||
| 8 | ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6 | 10 | ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6 |
| 9 | RGBLIGHT_ENABLE = yes | 11 | RGBLIGHT_ENABLE = yes |
| 10 | INDICATOR_LIGHTS = yes | 12 | INDICATOR_LIGHTS = yes |
| 11 | RGBLIGHT_TWINKLE = yes | 13 | RGBLIGHT_TWINKLE = yes |
| 12 | RGBLIGHT_STARTUP_ANIMATION = yes | 14 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 13 | endif | 15 | endif |
| 14 | ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light | 16 | ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light |
| 15 | RGB_MATRIX_ENABLE = yes | 17 | RGB_MATRIX_ENABLE = yes |
| 16 | RGBLIGHT_ENABLE = no | 18 | RGBLIGHT_ENABLE = no |
| 17 | RGBLIGHT_STARTUP_ANIMATION = no | 19 | RGBLIGHT_STARTUP_ANIMATION = no |
| 20 | endif | ||
| 21 | ifneq (,$(findstring planck/ez,$(KEYBOARD))) # Make sure it IS the Planck Light | ||
| 22 | RGBLIGHT_ENABLE = no | ||
| 23 | # SERIAL_LINK_ENABLE = yes | ||
| 24 | ENCODER_ENABLE = no | ||
| 25 | RGB_MATRIX_ENABLE = IS31FL3737 | ||
| 26 | INDICATOR_LIGHTS = yes | ||
| 27 | RGBLIGHT_TWINKLE = yes | ||
| 28 | RGBLIGHT_STARTUP_ANIMATION = yes | ||
| 18 | endif | 29 | endif |
| 19 | 30 | ||
| 20 | ifeq ($(strip $(PROTOCOL)), VUSB) | 31 | ifeq ($(strip $(PROTOCOL)), VUSB) |
diff --git a/layouts/community/ortho_5x12/drashna/config.h b/layouts/community/ortho_5x12/drashna/config.h index 480bf658c..123c284a2 100644 --- a/layouts/community/ortho_5x12/drashna/config.h +++ b/layouts/community/ortho_5x12/drashna/config.h | |||
| @@ -3,20 +3,19 @@ | |||
| 3 | 3 | ||
| 4 | /* ws2812 RGB LED */ | 4 | /* ws2812 RGB LED */ |
| 5 | #if defined(KEYBOARD_fractal) | 5 | #if defined(KEYBOARD_fractal) |
| 6 | #define RGB_DI_PIN D2 | 6 | # define RGB_DI_PIN D2 |
| 7 | #undef RGBLED_NUM | 7 | # undef RGBLED_NUM |
| 8 | #define RGBLIGHT_ANIMATIONS | 8 | # define RGBLIGHT_ANIMATIONS |
| 9 | #define RGBLED_NUM 29 // Number of LEDs | 9 | # define RGBLED_NUM 29 // Number of LEDs |
| 10 | #undef RGBLIGHT_HUE_STEP | 10 | # undef RGBLIGHT_HUE_STEP |
| 11 | #define RGBLIGHT_HUE_STEP 8 | 11 | # define RGBLIGHT_HUE_STEP 8 |
| 12 | #undef RGBLIGHT_SAT_STEP | 12 | # undef RGBLIGHT_SAT_STEP |
| 13 | #define RGBLIGHT_SAT_STEP 8 | 13 | # define RGBLIGHT_SAT_STEP 8 |
| 14 | #undef RGBLIGHT_VAL_STEP | 14 | # undef RGBLIGHT_VAL_STEP |
| 15 | #define RGBLIGHT_VAL_STEP 8 | 15 | # define RGBLIGHT_VAL_STEP 8 |
| 16 | #define RGBLIGHT_LIMIT_VAL 175 | 16 | # define RGBLIGHT_LIMIT_VAL 175 |
| 17 | #define RGBLIGHT_SLEEP | 17 | # define RGBLIGHT_SLEEP |
| 18 | |||
| 19 | #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 | ||
| 20 | #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 | ||
| 21 | 18 | ||
| 19 | # define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 | ||
| 20 | # define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 | ||
| 22 | #endif | 21 | #endif |
diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml index 92813a27d..679bdf435 100644 --- a/users/drashna/.gitlab-ci.yml +++ b/users/drashna/.gitlab-ci.yml | |||
| @@ -1,9 +1,7 @@ | |||
| 1 | stages: | 1 | stages: |
| 2 | - test | 2 | - test |
| 3 | - build | ||
| 4 | - deploy | ||
| 5 | 3 | ||
| 6 | Preliminary Test: | 4 | QMK Firmware: |
| 7 | stage: test | 5 | stage: test |
| 8 | variables: | 6 | variables: |
| 9 | GIT_SUBMODULE_STRATEGY: recursive | 7 | GIT_SUBMODULE_STRATEGY: recursive |
| @@ -18,36 +16,7 @@ Preliminary Test: | |||
| 18 | script: | 16 | script: |
| 19 | - make test:all | 17 | - make test:all |
| 20 | - make planck/rev6:default planck/rev5:default | 18 | - make planck/rev6:default planck/rev5:default |
| 21 | 19 | - make keebio/iris/rev2:drashna keebio/iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow keebio/viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna primekb/prime_m:drashna -j2 --output-sync | |
| 22 | QMK Firmware Defaults: | ||
| 23 | stage: deploy | ||
| 24 | variables: | ||
| 25 | GIT_SUBMODULE_STRATEGY: recursive | ||
| 26 | tags: | ||
| 27 | - linux | ||
| 28 | image: ubuntu:18.10 | ||
| 29 | before_script: | ||
| 30 | - apt-get update -qy | ||
| 31 | - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip | ||
| 32 | - avr-gcc --version | ||
| 33 | - uname -a | ||
| 34 | script: | ||
| 35 | - make test:all | ||
| 36 | - make all:default -j16 | ||
| 37 | |||
| 38 | Drashna Firmware: | ||
| 39 | stage: build | ||
| 40 | variables: | ||
| 41 | GIT_SUBMODULE_STRATEGY: recursive | ||
| 42 | tags: | ||
| 43 | - linux | ||
| 44 | image: ubuntu:18.10 | ||
| 45 | before_script: | ||
| 46 | - apt-get update -qy | ||
| 47 | - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip | ||
| 48 | - avr-gcc --version | ||
| 49 | script: | ||
| 50 | - make keebio/iris/rev2:drashna keebio/iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow keebio/viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna primekb/prime_m:drashna -j16 --output-sync | ||
| 51 | artifacts: | 20 | artifacts: |
| 52 | name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" | 21 | name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" |
| 53 | paths: | 22 | paths: |
diff --git a/users/drashna/config.h b/users/drashna/config.h index 1680eb4cb..a6d8e7526 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h | |||
| @@ -2,50 +2,43 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | #ifdef AUDIO_ENABLE | 4 | #ifdef AUDIO_ENABLE |
| 5 | #define AUDIO_CLICKY | 5 | # define AUDIO_CLICKY |
| 6 | #define STARTUP_SONG SONG(RICK_ROLL) | 6 | # define STARTUP_SONG SONG(RICK_ROLL) |
| 7 | #define GOODBYE_SONG SONG(SONIC_RING) | 7 | # define GOODBYE_SONG SONG(SONIC_RING) |
| 8 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ | 8 | # define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ |
| 9 | SONG(COLEMAK_SOUND), \ | 9 | SONG(COLEMAK_SOUND), \ |
| 10 | SONG(DVORAK_SOUND), \ | 10 | SONG(DVORAK_SOUND), \ |
| 11 | SONG(OVERWATCH_THEME) \ | 11 | SONG(OVERWATCH_THEME) \ |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f | 14 | # define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f |
| 15 | // #ifdef RGBLIGHT_ENABLE | 15 | |
| 16 | // #define NO_MUSIC_MODE | 16 | # define UNICODE_SONG_OSX SONG(RICK_ROLL) |
| 17 | // #endif //RGBLIGHT_ENABLE/ | 17 | # define UNICODE_SONG_LNX SONG(RICK_ROLL) |
| 18 | // #ifndef __arm__ | 18 | # define UNICODE_SONG_WIN SONG(RICK_ROLL) |
| 19 | // #undef NOTE_REST | 19 | # define UNICODE_SONG_BSD SONG(RICK_ROLL) |
| 20 | // #define NOTE_REST 1.00f | 20 | # define UNICODE_SONG_WINC SONG(RICK_ROLL) |
| 21 | // #endif // !__arm__ | ||
| 22 | |||
| 23 | #define UNICODE_SONG_OSX SONG(RICK_ROLL) | ||
| 24 | #define UNICODE_SONG_LNX SONG(RICK_ROLL) | ||
| 25 | #define UNICODE_SONG_WIN SONG(RICK_ROLL) | ||
| 26 | #define UNICODE_SONG_BSD SONG(RICK_ROLL) | ||
| 27 | #define UNICODE_SONG_WINC SONG(RICK_ROLL) | ||
| 28 | 21 | ||
| 29 | #endif // !AUDIO_ENABLE | 22 | #endif // !AUDIO_ENABLE |
| 30 | 23 | ||
| 31 | #ifdef RGBLIGHT_ENABLE | 24 | #ifdef RGBLIGHT_ENABLE |
| 32 | #define RGBLIGHT_SLEEP | 25 | # define RGBLIGHT_SLEEP |
| 33 | #undef RGBLIGHT_ANIMATIONS | 26 | # undef RGBLIGHT_ANIMATIONS |
| 34 | #define RGBLIGHT_EFFECT_BREATHING | 27 | # define RGBLIGHT_EFFECT_BREATHING |
| 35 | #define RGBLIGHT_EFFECT_SNAKE | 28 | # define RGBLIGHT_EFFECT_SNAKE |
| 36 | #define RGBLIGHT_EFFECT_KNIGHT | 29 | # define RGBLIGHT_EFFECT_KNIGHT |
| 37 | #endif // RGBLIGHT_ENABLE | 30 | #endif // RGBLIGHT_ENABLE |
| 38 | 31 | ||
| 39 | #ifndef ONESHOT_TAP_TOGGLE | 32 | #ifndef ONESHOT_TAP_TOGGLE |
| 40 | #define ONESHOT_TAP_TOGGLE 2 | 33 | # define ONESHOT_TAP_TOGGLE 2 |
| 41 | #endif // !ONESHOT_TAP_TOGGLE | 34 | #endif // !ONESHOT_TAP_TOGGLE |
| 42 | 35 | ||
| 43 | #ifndef ONESHOT_TIMEOUT | 36 | #ifndef ONESHOT_TIMEOUT |
| 44 | #define ONESHOT_TIMEOUT 3000 | 37 | # define ONESHOT_TIMEOUT 3000 |
| 45 | #endif// !ONESHOT_TIMEOUT | 38 | #endif// !ONESHOT_TIMEOUT |
| 46 | 39 | ||
| 47 | #ifndef QMK_KEYS_PER_SCAN | 40 | #ifndef QMK_KEYS_PER_SCAN |
| 48 | #define QMK_KEYS_PER_SCAN 4 | 41 | # define QMK_KEYS_PER_SCAN 4 |
| 49 | #endif // !QMK_KEYS_PER_SCAN | 42 | #endif // !QMK_KEYS_PER_SCAN |
| 50 | 43 | ||
| 51 | 44 | ||
| @@ -62,24 +55,27 @@ | |||
| 62 | #define FORCE_NKRO | 55 | #define FORCE_NKRO |
| 63 | 56 | ||
| 64 | #ifndef TAPPING_TOGGLE | 57 | #ifndef TAPPING_TOGGLE |
| 65 | #define TAPPING_TOGGLE 1 | 58 | # define TAPPING_TOGGLE 1 |
| 66 | #endif | 59 | #endif |
| 67 | 60 | ||
| 68 | #ifdef TAPPING_TERM | 61 | #ifdef TAPPING_TERM |
| 69 | #undef TAPPING_TERM | 62 | # undef TAPPING_TERM |
| 70 | #endif // TAPPING_TERM | 63 | #endif // TAPPING_TERM |
| 71 | #if defined(KEYBOARD_ergodox_ez) | 64 | #if defined(KEYBOARD_ergodox_ez) |
| 72 | #define TAPPING_TERM 185 | 65 | # define TAPPING_TERM 185 |
| 73 | #elif defined(KEYBOARD_crkbd) | 66 | #elif defined(KEYBOARD_crkbd) |
| 74 | #define TAPPING_TERM 200 | 67 | # define TAPPING_TERM 200 |
| 75 | #else | 68 | #else |
| 76 | #define TAPPING_TERM 175 | 69 | # define TAPPING_TERM 175 |
| 77 | #endif | 70 | #endif |
| 78 | 71 | ||
| 79 | 72 | ||
| 80 | // Disable action_get_macro and fn_actions, since we don't use these | ||
| 81 | // and it saves on space in the firmware. | ||
| 82 | #define NO_ACTION_MACRO | ||
| 83 | #define NO_ACTION_FUNCTION | ||
| 84 | |||
| 85 | #define TAP_CODE_DELAY 5 | 73 | #define TAP_CODE_DELAY 5 |
| 74 | |||
| 75 | /* Disable unused and unneeded features to reduce on firmware size */ | ||
| 76 | #ifdef LOCKING_SUPPORT_ENABLE | ||
| 77 | # undef LOCKING_SUPPORT_ENABLE | ||
| 78 | #endif | ||
| 79 | #ifdef LOCKING_RESYNC_ENABLE | ||
| 80 | # undef LOCKING_RESYNC_ENABLE | ||
| 81 | #endif | ||
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index ec249dd22..7c60a2e4a 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -19,78 +19,78 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 19 | 19 | ||
| 20 | userspace_config_t userspace_config; | 20 | userspace_config_t userspace_config; |
| 21 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) | 21 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) |
| 22 | #define DRASHNA_UNICODE_MODE UC_WIN | 22 | #define DRASHNA_UNICODE_MODE UC_WIN |
| 23 | #else | 23 | #else |
| 24 | // set to 2 for UC_WIN, set to 4 for UC_WINC | 24 | // set to 2 for UC_WIN, set to 4 for UC_WINC |
| 25 | #define DRASHNA_UNICODE_MODE 2 | 25 | #define DRASHNA_UNICODE_MODE 2 |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | // This block is for all of the gaming macros, as they were all doing | 29 | // This block is for all of the gaming macros, as they were all doing |
| 30 | // the same thing, but with differring text sent. | 30 | // the same thing, but with differring text sent. |
| 31 | bool send_game_macro(const char *str, keyrecord_t *record, bool override) { | 31 | bool send_game_macro(const char *str, keyrecord_t *record, bool override) { |
| 32 | if (!record->event.pressed || override) { | 32 | if (!record->event.pressed || override) { |
| 33 | uint16_t keycode; | 33 | uint16_t keycode; |
| 34 | if (userspace_config.is_overwatch) { | 34 | if (userspace_config.is_overwatch) { |
| 35 | keycode = KC_BSPC; | 35 | keycode = KC_BSPC; |
| 36 | } else { | 36 | } else { |
| 37 | keycode = KC_ENTER; | 37 | keycode = KC_ENTER; |
| 38 | } | ||
| 39 | clear_keyboard(); | ||
| 40 | tap_code(keycode); | ||
| 41 | wait_ms(TAP_CODE_DELAY); | ||
| 42 | send_string_with_delay(str, TAP_CODE_DELAY); | ||
| 43 | wait_ms(TAP_CODE_DELAY); | ||
| 44 | tap_code(KC_ENTER); | ||
| 38 | } | 45 | } |
| 39 | clear_keyboard(); | 46 | if (override) wait_ms(3000); |
| 40 | tap_code(keycode); | 47 | return false; |
| 41 | wait_ms(TAP_CODE_DELAY); | ||
| 42 | send_string_with_delay(str, TAP_CODE_DELAY); | ||
| 43 | wait_ms(TAP_CODE_DELAY); | ||
| 44 | tap_code(KC_ENTER); | ||
| 45 | } | ||
| 46 | if (override) wait_ms(3000); | ||
| 47 | return false; | ||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { | 50 | bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { |
| 51 | static uint16_t this_timer; | 51 | static uint16_t this_timer; |
| 52 | if(pressed) { | 52 | if(pressed) { |
| 53 | this_timer= timer_read(); | 53 | this_timer= timer_read(); |
| 54 | } else { | 54 | } else { |
| 55 | if (timer_elapsed(this_timer) < TAPPING_TERM){ | 55 | if (timer_elapsed(this_timer) < TAPPING_TERM){ |
| 56 | tap_code(code); | 56 | tap_code(code); |
| 57 | } else { | 57 | } else { |
| 58 | register_code(mod_code); | 58 | register_code(mod_code); |
| 59 | tap_code(code); | 59 | tap_code(code); |
| 60 | unregister_code(mod_code); | 60 | unregister_code(mod_code); |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | return false; | 63 | return false; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { | 66 | bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { |
| 67 | if(pressed) { | 67 | if(pressed) { |
| 68 | this_timer= timer_read(); | 68 | this_timer= timer_read(); |
| 69 | } else { | 69 | } else { |
| 70 | if (timer_elapsed(this_timer) < TAPPING_TERM){ | 70 | if (timer_elapsed(this_timer) < TAPPING_TERM){ |
| 71 | tap_code(code); | 71 | tap_code(code); |
| 72 | } else { | 72 | } else { |
| 73 | register_code(mod_code); | 73 | register_code(mod_code); |
| 74 | tap_code(code); | 74 | tap_code(code); |
| 75 | unregister_code(mod_code); | 75 | unregister_code(mod_code); |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | return false; | 78 | return false; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void bootmagic_lite(void) { | 81 | void bootmagic_lite(void) { |
| 82 | matrix_scan(); | 82 | matrix_scan(); |
| 83 | #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 | 83 | #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 |
| 84 | wait_ms(DEBOUNCING_DELAY * 2); | 84 | wait_ms(DEBOUNCING_DELAY * 2); |
| 85 | #elif defined(DEBOUNCE) && DEBOUNCE > 0 | 85 | #elif defined(DEBOUNCE) && DEBOUNCE > 0 |
| 86 | wait_ms(DEBOUNCE * 2); | 86 | wait_ms(DEBOUNCE * 2); |
| 87 | #else | 87 | #else |
| 88 | wait_ms(30); | 88 | wait_ms(30); |
| 89 | #endif | 89 | #endif |
| 90 | matrix_scan(); | 90 | matrix_scan(); |
| 91 | if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { | 91 | if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { |
| 92 | bootloader_jump(); | 92 | bootloader_jump(); |
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | // Add reconfigurable functions here, for keymap customization | 96 | // Add reconfigurable functions here, for keymap customization |
| @@ -103,21 +103,21 @@ void matrix_init_keymap(void) {} | |||
| 103 | // Call user matrix init, set default RGB colors and then | 103 | // Call user matrix init, set default RGB colors and then |
| 104 | // call the keymap's init function | 104 | // call the keymap's init function |
| 105 | void matrix_init_user(void) { | 105 | void matrix_init_user(void) { |
| 106 | userspace_config.raw = eeconfig_read_user(); | 106 | userspace_config.raw = eeconfig_read_user(); |
| 107 | 107 | ||
| 108 | #ifdef BOOTLOADER_CATERINA | 108 | #ifdef BOOTLOADER_CATERINA |
| 109 | DDRD &= ~(1<<5); | 109 | DDRD &= ~(1<<5); |
| 110 | PORTD &= ~(1<<5); | 110 | PORTD &= ~(1<<5); |
| 111 | 111 | ||
| 112 | DDRB &= ~(1<<0); | 112 | DDRB &= ~(1<<0); |
| 113 | PORTB &= ~(1<<0); | 113 | PORTB &= ~(1<<0); |
| 114 | #endif | 114 | #endif |
| 115 | 115 | ||
| 116 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) | 116 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) |
| 117 | set_unicode_input_mode(DRASHNA_UNICODE_MODE); | 117 | set_unicode_input_mode(DRASHNA_UNICODE_MODE); |
| 118 | get_unicode_input_mode(); | 118 | get_unicode_input_mode(); |
| 119 | #endif //UNICODE_ENABLE | 119 | #endif //UNICODE_ENABLE |
| 120 | matrix_init_keymap(); | 120 | matrix_init_keymap(); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | __attribute__((weak)) | 123 | __attribute__((weak)) |
| @@ -125,26 +125,26 @@ void keyboard_post_init_keymap(void){ } | |||
| 125 | 125 | ||
| 126 | void keyboard_post_init_user(void){ | 126 | void keyboard_post_init_user(void){ |
| 127 | #ifdef RGBLIGHT_ENABLE | 127 | #ifdef RGBLIGHT_ENABLE |
| 128 | keyboard_post_init_rgb(); | 128 | keyboard_post_init_rgb(); |
| 129 | #endif | 129 | #endif |
| 130 | keyboard_post_init_keymap(); | 130 | keyboard_post_init_keymap(); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | __attribute__ ((weak)) | 133 | __attribute__ ((weak)) |
| 134 | void shutdown_keymap(void) {} | 134 | void shutdown_keymap(void) {} |
| 135 | 135 | ||
| 136 | void shutdown_user (void) { | 136 | void shutdown_user (void) { |
| 137 | #ifdef RGBLIGHT_ENABLE | 137 | #ifdef RGBLIGHT_ENABLE |
| 138 | rgblight_enable_noeeprom(); | 138 | rgblight_enable_noeeprom(); |
| 139 | rgblight_mode_noeeprom(1); | 139 | rgblight_mode_noeeprom(1); |
| 140 | rgblight_setrgb_red(); | 140 | rgblight_setrgb_red(); |
| 141 | #endif // RGBLIGHT_ENABLE | 141 | #endif // RGBLIGHT_ENABLE |
| 142 | #ifdef RGB_MATRIX_ENABLE | 142 | #ifdef RGB_MATRIX_ENABLE |
| 143 | // uint16_t timer_start = timer_read(); | 143 | // uint16_t timer_start = timer_read(); |
| 144 | // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); | 144 | // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); |
| 145 | // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } | 145 | // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } |
| 146 | #endif //RGB_MATRIX_ENABLE | 146 | #endif //RGB_MATRIX_ENABLE |
| 147 | shutdown_keymap(); | 147 | shutdown_keymap(); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | __attribute__ ((weak)) | 150 | __attribute__ ((weak)) |
| @@ -158,7 +158,7 @@ __attribute__ ((weak)) | |||
| 158 | void suspend_wakeup_init_keymap(void) {} | 158 | void suspend_wakeup_init_keymap(void) {} |
| 159 | 159 | ||
| 160 | void suspend_wakeup_init_user(void) { | 160 | void suspend_wakeup_init_user(void) { |
| 161 | suspend_wakeup_init_keymap(); | 161 | suspend_wakeup_init_keymap(); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | 164 | ||
| @@ -168,54 +168,54 @@ void matrix_scan_keymap(void) {} | |||
| 168 | // No global matrix scan code, so just run keymap's matrix | 168 | // No global matrix scan code, so just run keymap's matrix |
| 169 | // scan function | 169 | // scan function |
| 170 | void matrix_scan_user(void) { | 170 | void matrix_scan_user(void) { |
| 171 | static bool has_ran_yet; | 171 | static bool has_ran_yet; |
| 172 | if (!has_ran_yet) { | 172 | if (!has_ran_yet) { |
| 173 | has_ran_yet = true; | 173 | has_ran_yet = true; |
| 174 | startup_user(); | 174 | startup_user(); |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. | 177 | #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. |
| 178 | run_diablo_macro_check(); | 178 | run_diablo_macro_check(); |
| 179 | #endif // TAP_DANCE_ENABLE | 179 | #endif // TAP_DANCE_ENABLE |
| 180 | 180 | ||
| 181 | #ifdef RGBLIGHT_ENABLE | 181 | #ifdef RGBLIGHT_ENABLE |
| 182 | matrix_scan_rgb(); | 182 | matrix_scan_rgb(); |
| 183 | #endif // RGBLIGHT_ENABLE | 183 | #endif // RGBLIGHT_ENABLE |
| 184 | 184 | ||
| 185 | matrix_scan_keymap(); | 185 | matrix_scan_keymap(); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | 188 | ||
| 189 | __attribute__ ((weak)) | 189 | __attribute__ ((weak)) |
| 190 | uint32_t layer_state_set_keymap (uint32_t state) { | 190 | uint32_t layer_state_set_keymap (uint32_t state) { |
| 191 | return state; | 191 | return state; |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | // on layer change, no matter where the change was initiated | 194 | // on layer change, no matter where the change was initiated |
| 195 | // Then runs keymap's layer change check | 195 | // Then runs keymap's layer change check |
| 196 | uint32_t layer_state_set_user(uint32_t state) { | 196 | uint32_t layer_state_set_user(uint32_t state) { |
| 197 | state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); | 197 | state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); |
| 198 | #ifdef RGBLIGHT_ENABLE | 198 | #ifdef RGBLIGHT_ENABLE |
| 199 | state = layer_state_set_rgb(state); | 199 | state = layer_state_set_rgb(state); |
| 200 | #endif // RGBLIGHT_ENABLE | 200 | #endif // RGBLIGHT_ENABLE |
| 201 | return layer_state_set_keymap (state); | 201 | return layer_state_set_keymap (state); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | 204 | ||
| 205 | __attribute__ ((weak)) | 205 | __attribute__ ((weak)) |
| 206 | uint32_t default_layer_state_set_keymap (uint32_t state) { | 206 | uint32_t default_layer_state_set_keymap (uint32_t state) { |
| 207 | return state; | 207 | return state; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | // Runs state check and changes underglow color and animation | 210 | // Runs state check and changes underglow color and animation |
| 211 | uint32_t default_layer_state_set_user(uint32_t state) { | 211 | uint32_t default_layer_state_set_user(uint32_t state) { |
| 212 | state = default_layer_state_set_keymap(state); | 212 | state = default_layer_state_set_keymap(state); |
| 213 | #if 0 | 213 | #if 0 |
| 214 | #ifdef RGBLIGHT_ENABLE | 214 | #ifdef RGBLIGHT_ENABLE |
| 215 | state = default_layer_state_set_rgb(state); | 215 | state = default_layer_state_set_rgb(state); |
| 216 | #endif // RGBLIGHT_ENABLE | 216 | #endif // RGBLIGHT_ENABLE |
| 217 | #endif | 217 | #endif |
| 218 | return state; | 218 | return state; |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | __attribute__ ((weak)) | 221 | __attribute__ ((weak)) |
| @@ -225,16 +225,16 @@ void led_set_keymap(uint8_t usb_led) {} | |||
| 225 | // So far, I only have keyboard specific code, | 225 | // So far, I only have keyboard specific code, |
| 226 | // So nothing goes here. | 226 | // So nothing goes here. |
| 227 | void led_set_user(uint8_t usb_led) { | 227 | void led_set_user(uint8_t usb_led) { |
| 228 | led_set_keymap(usb_led); | 228 | led_set_keymap(usb_led); |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | __attribute__ ((weak)) | 231 | __attribute__ ((weak)) |
| 232 | void eeconfig_init_keymap(void) {} | 232 | void eeconfig_init_keymap(void) {} |
| 233 | 233 | ||
| 234 | void eeconfig_init_user(void) { | 234 | void eeconfig_init_user(void) { |
| 235 | userspace_config.raw = 0; | 235 | userspace_config.raw = 0; |
| 236 | userspace_config.rgb_layer_change = true; | 236 | userspace_config.rgb_layer_change = true; |
| 237 | eeconfig_update_user(userspace_config.raw); | 237 | eeconfig_update_user(userspace_config.raw); |
| 238 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) | 238 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) |
| 239 | set_unicode_input_mode(DRASHNA_UNICODE_MODE); | 239 | set_unicode_input_mode(DRASHNA_UNICODE_MODE); |
| 240 | get_unicode_input_mode(); | 240 | get_unicode_input_mode(); |
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 6645626d9..5df67792a 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h | |||
| @@ -22,36 +22,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 22 | #include "wrappers.h" | 22 | #include "wrappers.h" |
| 23 | #include "process_records.h" | 23 | #include "process_records.h" |
| 24 | #ifdef TAP_DANCE_ENABLE | 24 | #ifdef TAP_DANCE_ENABLE |
| 25 | #include "tap_dances.h" | 25 | # include "tap_dances.h" |
| 26 | #endif // TAP_DANCE_ENABLE | 26 | #endif // TAP_DANCE_ENABLE |
| 27 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | 27 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| 28 | #include "rgb_stuff.h" | 28 | # include "rgb_stuff.h" |
| 29 | #endif | 29 | #endif |
| 30 | #if defined(AUDIO_ENABLE) && __GNUC__ > 7 | 30 | #if defined(AUDIO_ENABLE) && __GNUC__ > 7 |
| 31 | #if __has_include("drashna_song_list.h") | 31 | # if __has_include("drashna_song_list.h") |
| 32 | #include "drashna_song_list.h" | 32 | # include "drashna_song_list.h" |
| 33 | #endif | 33 | # endif |
| 34 | #endif | 34 | #endif |
| 35 | 35 | ||
| 36 | /* Define layer names */ | 36 | /* Define layer names */ |
| 37 | enum userspace_layers { | 37 | enum userspace_layers { |
| 38 | _QWERTY = 0, | 38 | _QWERTY = 0, |
| 39 | _NUMLOCK = 0, | 39 | _NUMLOCK = 0, |
| 40 | _COLEMAK, | 40 | _COLEMAK, |
| 41 | _DVORAK, | 41 | _DVORAK, |
| 42 | _WORKMAN, | 42 | _WORKMAN, |
| 43 | _NORMAN, | 43 | _NORMAN, |
| 44 | _MALTRON, | 44 | _MALTRON, |
| 45 | _EUCALYN, | 45 | _EUCALYN, |
| 46 | _CARPLAX, | 46 | _CARPLAX, |
| 47 | _MODS, /* layer 8 */ | 47 | _MODS, /* layer 8 */ |
| 48 | _GAMEPAD, | 48 | _GAMEPAD, |
| 49 | _DIABLO, | 49 | _DIABLO, |
| 50 | _MACROS, | 50 | _MACROS, |
| 51 | _MEDIA, | 51 | _MEDIA, |
| 52 | _LOWER, | 52 | _LOWER, |
| 53 | _RAISE, | 53 | _RAISE, |
| 54 | _ADJUST, | 54 | _ADJUST, |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| @@ -73,14 +73,14 @@ void led_set_keymap(uint8_t usb_led); | |||
| 73 | void eeconfig_init_keymap(void); | 73 | void eeconfig_init_keymap(void); |
| 74 | 74 | ||
| 75 | typedef union { | 75 | typedef union { |
| 76 | uint32_t raw; | 76 | uint32_t raw; |
| 77 | struct { | 77 | struct { |
| 78 | bool rgb_layer_change :1; | 78 | bool rgb_layer_change :1; |
| 79 | bool is_overwatch :1; | 79 | bool is_overwatch :1; |
| 80 | bool nuke_switch :1; | 80 | bool nuke_switch :1; |
| 81 | uint8_t unicode_mod :4; | 81 | uint8_t unicode_mod :4; |
| 82 | bool swapped_numbers :1; | 82 | bool swapped_numbers :1; |
| 83 | }; | 83 | }; |
| 84 | } userspace_config_t; | 84 | } userspace_config_t; |
| 85 | 85 | ||
| 86 | extern userspace_config_t userspace_config; | 86 | extern userspace_config_t userspace_config; |
| @@ -92,13 +92,13 @@ But since TD() doesn't work when tap dance is disabled | |||
| 92 | We use custom codes here, so we can substitute the right stuff | 92 | We use custom codes here, so we can substitute the right stuff |
| 93 | */ | 93 | */ |
| 94 | #ifdef TAP_DANCE_ENABLE | 94 | #ifdef TAP_DANCE_ENABLE |
| 95 | #define KC_D3_1 TD(TD_D3_1) | 95 | # define KC_D3_1 TD(TD_D3_1) |
| 96 | #define KC_D3_2 TD(TD_D3_2) | 96 | # define KC_D3_2 TD(TD_D3_2) |
| 97 | #define KC_D3_3 TD(TD_D3_3) | 97 | # define KC_D3_3 TD(TD_D3_3) |
| 98 | #define KC_D3_4 TD(TD_D3_4) | 98 | # define KC_D3_4 TD(TD_D3_4) |
| 99 | #else // TAP_DANCE_ENABLE | 99 | #else // TAP_DANCE_ENABLE |
| 100 | #define KC_D3_1 KC_1 | 100 | # define KC_D3_1 KC_1 |
| 101 | #define KC_D3_2 KC_2 | 101 | # define KC_D3_2 KC_2 |
| 102 | #define KC_D3_3 KC_3 | 102 | # define KC_D3_3 KC_3 |
| 103 | #define KC_D3_4 KC_4 | 103 | # define KC_D3_4 KC_4 |
| 104 | #endif // TAP_DANCE_ENABLE | 104 | #endif // TAP_DANCE_ENABLE |
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 2b6ccf510..a5487b585 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c | |||
| @@ -4,12 +4,12 @@ uint16_t copy_paste_timer; | |||
| 4 | 4 | ||
| 5 | __attribute__ ((weak)) | 5 | __attribute__ ((weak)) |
| 6 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 6 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 7 | return true; | 7 | return true; |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | __attribute__ ((weak)) | 10 | __attribute__ ((weak)) |
| 11 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | 11 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { |
| 12 | return true; | 12 | return true; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | // Defines actions tor my global custom keycodes. Defined in drashna.h file | 15 | // Defines actions tor my global custom keycodes. Defined in drashna.h file |
| @@ -18,140 +18,140 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 18 | 18 | ||
| 19 | // If console is enabled, it will print the matrix position and status of each key pressed | 19 | // If console is enabled, it will print the matrix position and status of each key pressed |
| 20 | #ifdef KEYLOGGER_ENABLE | 20 | #ifdef KEYLOGGER_ENABLE |
| 21 | #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) | 21 | # if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) |
| 22 | xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); | 22 | xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); |
| 23 | #else | 23 | # else |
| 24 | xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); | 24 | xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); |
| 25 | #endif | 25 | # endif |
| 26 | #endif //KEYLOGGER_ENABLE | 26 | #endif //KEYLOGGER_ENABLE |
| 27 | 27 | ||
| 28 | switch (keycode) { | 28 | switch (keycode) { |
| 29 | case KC_QWERTY ... KC_CARPLAX: | 29 | case KC_QWERTY ... KC_CARPLAX: |
| 30 | if (record->event.pressed) { | 30 | if (record->event.pressed) { |
| 31 | set_single_persistent_default_layer(keycode - KC_QWERTY); | 31 | set_single_persistent_default_layer(keycode - KC_QWERTY); |
| 32 | } | 32 | } |
| 33 | break; | 33 | break; |
| 34 | 34 | ||
| 35 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader | 35 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader |
| 36 | if (!record->event.pressed) { | 36 | if (!record->event.pressed) { |
| 37 | uint8_t temp_mod = get_mods(); | 37 | uint8_t temp_mod = get_mods(); |
| 38 | uint8_t temp_osm = get_oneshot_mods(); | 38 | uint8_t temp_osm = get_oneshot_mods(); |
| 39 | clear_mods(); clear_oneshot_mods(); | 39 | clear_mods(); clear_oneshot_mods(); |
| 40 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); | 40 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); |
| 41 | #ifndef MAKE_BOOTLOADER | 41 | #ifndef MAKE_BOOTLOADER |
| 42 | if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) | 42 | if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) |
| 43 | #endif | 43 | #endif |
| 44 | { | 44 | { |
| 45 | #if defined(__arm__) | 45 | #if defined(__arm__) |
| 46 | send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); | 46 | send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); |
| 47 | #elif defined(BOOTLOADER_DFU) | 47 | #elif defined(BOOTLOADER_DFU) |
| 48 | send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); | 48 | send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); |
| 49 | #elif defined(BOOTLOADER_HALFKAY) | 49 | #elif defined(BOOTLOADER_HALFKAY) |
| 50 | send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); | 50 | send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); |
| 51 | #elif defined(BOOTLOADER_CATERINA) | 51 | #elif defined(BOOTLOADER_CATERINA) |
| 52 | send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); | 52 | send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); |
| 53 | #endif // bootloader options | 53 | #endif // bootloader options |
| 54 | } | 54 | } |
| 55 | if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } | 55 | if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } |
| 56 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); | 56 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); |
| 57 | } | 57 | } |
| 58 | break; | 58 | break; |
| 59 | 59 | ||
| 60 | case VRSN: // Prints firmware version | 60 | case VRSN: // Prints firmware version |
| 61 | if (record->event.pressed) { | 61 | if (record->event.pressed) { |
| 62 | send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); | 62 | send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); |
| 63 | } | 63 | } |
| 64 | break; | 64 | break; |
| 65 | 65 | ||
| 66 | // These are a serious of gaming macros. | 66 | // These are a serious of gaming macros. |
| 67 | // Only enables for the viterbi, basically, | 67 | // Only enables for the viterbi, basically, |
| 68 | // to save on firmware space, since it's limited. | 68 | // to save on firmware space, since it's limited. |
| 69 | #ifdef MACROS_ENABLED | 69 | #ifdef MACROS_ENABLED |
| 70 | case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros | 70 | case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros |
| 71 | if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } | 71 | if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } |
| 72 | #ifdef RGBLIGHT_ENABLE | 72 | #ifdef RGBLIGHT_ENABLE |
| 73 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); | 73 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); |
| 74 | #endif //RGBLIGHT_ENABLE | 74 | #endif //RGBLIGHT_ENABLE |
| 75 | break; | 75 | break; |
| 76 | case KC_SALT: | 76 | case KC_SALT: |
| 77 | return send_game_macro("Salt, salt, salt...", record, false); | 77 | return send_game_macro("Salt, salt, salt...", record, false); |
| 78 | case KC_MORESALT: | 78 | case KC_MORESALT: |
| 79 | return send_game_macro("Please sir, can I have some more salt?!", record, false); | 79 | return send_game_macro("Please sir, can I have some more salt?!", record, false); |
| 80 | case KC_SALTHARD: | 80 | case KC_SALTHARD: |
| 81 | return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); | 81 | return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); |
| 82 | case KC_GOODGAME: | 82 | case KC_GOODGAME: |
| 83 | return send_game_macro("Good game, everyone!", record, false); | 83 | return send_game_macro("Good game, everyone!", record, false); |
| 84 | case KC_GLHF: | 84 | case KC_GLHF: |
| 85 | return send_game_macro("Good luck, have fun!!!", record, false); | 85 | return send_game_macro("Good luck, have fun!!!", record, false); |
| 86 | case KC_SYMM: | 86 | case KC_SYMM: |
| 87 | return send_game_macro("Left click to win!", record, false); | 87 | return send_game_macro("Left click to win!", record, false); |
| 88 | case KC_JUSTGAME: | 88 | case KC_JUSTGAME: |
| 89 | 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); | 89 | 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); |
| 90 | case KC_TORB: | 90 | case KC_TORB: |
| 91 | return send_game_macro("That was positively riveting!", record, false); | 91 | return send_game_macro("That was positively riveting!", record, false); |
| 92 | case KC_AIM: | 92 | case KC_AIM: |
| 93 | send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); | 93 | send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); |
| 94 | return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); | 94 | return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); |
| 95 | case KC_C9: | 95 | case KC_C9: |
| 96 | return send_game_macro("OMG!!! C9!!!", record, false); | 96 | return send_game_macro("OMG!!! C9!!!", record, false); |
| 97 | case KC_GGEZ: | 97 | case KC_GGEZ: |
| 98 | return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); | 98 | return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); |
| 99 | #endif // MACROS_ENABLED | 99 | #endif // MACROS_ENABLED |
| 100 | 100 | ||
| 101 | 101 | ||
| 102 | case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them | 102 | case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them |
| 103 | #ifdef TAP_DANCE_ENABLE | 103 | #ifdef TAP_DANCE_ENABLE |
| 104 | if (record->event.pressed) { | 104 | if (record->event.pressed) { |
| 105 | uint8_t dtime; | 105 | uint8_t dtime; |
| 106 | for (dtime = 0; dtime < 4; dtime++) { | 106 | for (dtime = 0; dtime < 4; dtime++) { |
| 107 | diablo_key_time[dtime] = diablo_times[0]; | 107 | diablo_timer[dtime].key_time = diablo_times[0]; |
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | #endif // TAP_DANCE_ENABLE | 110 | #endif // TAP_DANCE_ENABLE |
| 111 | break; | 111 | break; |
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | case KC_CCCV: // One key copy/paste | 114 | case KC_CCCV: // One key copy/paste |
| 115 | if(record->event.pressed){ | 115 | if(record->event.pressed){ |
| 116 | copy_paste_timer = timer_read(); | 116 | copy_paste_timer = timer_read(); |
| 117 | } else { | 117 | } else { |
| 118 | if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy | 118 | if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy |
| 119 | register_code(KC_LCTL); | 119 | register_code(KC_LCTL); |
| 120 | tap_code(KC_C); | 120 | tap_code(KC_C); |
| 121 | unregister_code(KC_LCTL); | 121 | unregister_code(KC_LCTL); |
| 122 | } else { // Tap, paste | 122 | } else { // Tap, paste |
| 123 | register_code(KC_LCTL); | 123 | register_code(KC_LCTL); |
| 124 | tap_code(KC_V); | 124 | tap_code(KC_V); |
| 125 | unregister_code(KC_LCTL); | 125 | unregister_code(KC_LCTL); |
| 126 | } | 126 | } |
| 127 | } | 127 | } |
| 128 | break; | 128 | break; |
| 129 | #ifdef UNICODE_ENABLE | 129 | #ifdef UNICODE_ENABLE |
| 130 | case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ | 130 | case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ |
| 131 | if (record->event.pressed) { | 131 | if (record->event.pressed) { |
| 132 | send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); | 132 | send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); |
| 133 | } | 133 | } |
| 134 | break; | 134 | break; |
| 135 | case UC_TABL: // ┬─┬ノ( º _ ºノ) | 135 | case UC_TABL: // ┬─┬ノ( º _ ºノ) |
| 136 | if (record->event.pressed) { | 136 | if (record->event.pressed) { |
| 137 | send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); | 137 | send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); |
| 138 | } | 138 | } |
| 139 | break; | 139 | break; |
| 140 | case UC_SHRG: // ¯\_(ツ)_/¯ | 140 | case UC_SHRG: // ¯\_(ツ)_/¯ |
| 141 | if (record->event.pressed) { | 141 | if (record->event.pressed) { |
| 142 | send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); | 142 | send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); |
| 143 | } | 143 | } |
| 144 | break; | 144 | break; |
| 145 | case UC_DISA: // ಠ_ಠ | 145 | case UC_DISA: // ಠ_ಠ |
| 146 | if (record->event.pressed) { | 146 | if (record->event.pressed) { |
| 147 | send_unicode_hex_string("0CA0 005F 0CA0"); | 147 | send_unicode_hex_string("0CA0 005F 0CA0"); |
| 148 | } | 148 | } |
| 149 | break; | 149 | break; |
| 150 | #endif | 150 | #endif |
| 151 | } | 151 | } |
| 152 | return process_record_keymap(keycode, record) && | 152 | return process_record_keymap(keycode, record) && |
| 153 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | 153 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| 154 | process_record_user_rgb(keycode, record) && | 154 | process_record_user_rgb(keycode, record) && |
| 155 | #endif // RGBLIGHT_ENABLE | 155 | #endif // RGBLIGHT_ENABLE |
| 156 | process_record_secrets(keycode, record); | 156 | process_record_secrets(keycode, record); |
| 157 | } | 157 | } |
diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index 5e3374d3f..35adec84c 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h | |||
| @@ -2,48 +2,48 @@ | |||
| 2 | #include "drashna.h" | 2 | #include "drashna.h" |
| 3 | 3 | ||
| 4 | #if defined(KEYMAP_SAFE_RANGE) | 4 | #if defined(KEYMAP_SAFE_RANGE) |
| 5 | #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE | 5 | # define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE |
| 6 | #else | 6 | #else |
| 7 | #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE | 7 | # define PLACEHOLDER_SAFE_RANGE SAFE_RANGE |
| 8 | #endif | 8 | #endif |
| 9 | 9 | ||
| 10 | enum userspace_custom_keycodes { | 10 | enum userspace_custom_keycodes { |
| 11 | VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info | 11 | VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info |
| 12 | KC_QWERTY, // Sets default layer to QWERTY | 12 | KC_QWERTY, // Sets default layer to QWERTY |
| 13 | KC_COLEMAK, // Sets default layer to COLEMAK | 13 | KC_COLEMAK, // Sets default layer to COLEMAK |
| 14 | KC_DVORAK, // Sets default layer to DVORAK | 14 | KC_DVORAK, // Sets default layer to DVORAK |
| 15 | KC_WORKMAN, // Sets default layer to WORKMAN | 15 | KC_WORKMAN, // Sets default layer to WORKMAN |
| 16 | KC_NORMAN, // Sets default layer to NORMAN | 16 | KC_NORMAN, // Sets default layer to NORMAN |
| 17 | KC_MALTRON, // Sets default layer to MALTRON | 17 | KC_MALTRON, // Sets default layer to MALTRON |
| 18 | KC_EUCALYN, // Sets default layer to EUCALYN | 18 | KC_EUCALYN, // Sets default layer to EUCALYN |
| 19 | KC_CARPLAX, // Sets default layer to CARPLAX | 19 | KC_CARPLAX, // Sets default layer to CARPLAX |
| 20 | KC_DIABLO_CLEAR, // Clears all Diablo Timers | 20 | KC_DIABLO_CLEAR, // Clears all Diablo Timers |
| 21 | KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) | 21 | KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) |
| 22 | KC_SALT, // See drashna.c for details | 22 | KC_SALT, // See drashna.c for details |
| 23 | KC_MORESALT, | 23 | KC_MORESALT, |
| 24 | KC_SALTHARD, | 24 | KC_SALTHARD, |
| 25 | KC_GOODGAME, | 25 | KC_GOODGAME, |
| 26 | KC_SYMM, | 26 | KC_SYMM, |
| 27 | KC_JUSTGAME, | 27 | KC_JUSTGAME, |
| 28 | KC_GLHF, | 28 | KC_GLHF, |
| 29 | KC_TORB, | 29 | KC_TORB, |
| 30 | KC_AIM, | 30 | KC_AIM, |
| 31 | KC_C9, | 31 | KC_C9, |
| 32 | KC_GGEZ, | 32 | KC_GGEZ, |
| 33 | KC_MAKE, // Run keyboard's customized make command | 33 | KC_MAKE, // Run keyboard's customized make command |
| 34 | KC_RGB_T, // Toggles RGB Layer Indication mode | 34 | KC_RGB_T, // Toggles RGB Layer Indication mode |
| 35 | KC_SECRET_1, // test1 | 35 | KC_SECRET_1, // test1 |
| 36 | KC_SECRET_2, // test2 | 36 | KC_SECRET_2, // test2 |
| 37 | KC_SECRET_3, // test3 | 37 | KC_SECRET_3, // test3 |
| 38 | KC_SECRET_4, // test4 | 38 | KC_SECRET_4, // test4 |
| 39 | KC_SECRET_5, // test5 | 39 | KC_SECRET_5, // test5 |
| 40 | KC_CCCV, // Hold to copy, tap to paste | 40 | KC_CCCV, // Hold to copy, tap to paste |
| 41 | KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! | 41 | KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! |
| 42 | UC_FLIP, // (ಠ痊ಠ)┻━┻ | 42 | UC_FLIP, // (ಠ痊ಠ)┻━┻ |
| 43 | UC_TABL, // ┬─┬ノ( º _ ºノ) | 43 | UC_TABL, // ┬─┬ノ( º _ ºノ) |
| 44 | UC_SHRG, // ¯\_(ツ)_/¯ | 44 | UC_SHRG, // ¯\_(ツ)_/¯ |
| 45 | UC_DISA, // ಠ_ಠ | 45 | UC_DISA, // ಠ_ಠ |
| 46 | NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes | 46 | NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); | 49 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); |
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index b5e145842..38e86ae0e 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c | |||
| @@ -11,80 +11,80 @@ extern rgb_config_t rgb_matrix_config; | |||
| 11 | 11 | ||
| 12 | #ifdef RGBLIGHT_ENABLE | 12 | #ifdef RGBLIGHT_ENABLE |
| 13 | void rgblight_sethsv_default_helper(uint8_t index) { | 13 | void rgblight_sethsv_default_helper(uint8_t index) { |
| 14 | rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); | 14 | rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); |
| 15 | } | 15 | } |
| 16 | #endif // RGBLIGHT_ENABLE | 16 | #endif // RGBLIGHT_ENABLE |
| 17 | 17 | ||
| 18 | #ifdef INDICATOR_LIGHTS | 18 | #ifdef INDICATOR_LIGHTS |
| 19 | void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | 19 | void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { |
| 20 | if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { | 20 | if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { |
| 21 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) ) { | 21 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) ) { |
| 22 | #ifdef SHFT_LED1 | 22 | #ifdef SHFT_LED1 |
| 23 | rgblight_sethsv_at(120, 255, 255, SHFT_LED1); | 23 | rgblight_sethsv_at(120, 255, 255, SHFT_LED1); |
| 24 | #endif // SHFT_LED1 | 24 | #endif // SHFT_LED1 |
| 25 | #ifdef SHFT_LED2 | 25 | #ifdef SHFT_LED2 |
| 26 | rgblight_sethsv_at(120, 255, 255, SHFT_LED2); | 26 | rgblight_sethsv_at(120, 255, 255, SHFT_LED2); |
| 27 | #endif // SHFT_LED2 | 27 | #endif // SHFT_LED2 |
| 28 | } else { | 28 | } else { |
| 29 | #ifdef SHFT_LED1 | 29 | #ifdef SHFT_LED1 |
| 30 | rgblight_sethsv_default_helper(SHFT_LED1); | 30 | rgblight_sethsv_default_helper(SHFT_LED1); |
| 31 | #endif // SHFT_LED1 | 31 | #endif // SHFT_LED1 |
| 32 | #ifdef SHFT_LED2 | 32 | #ifdef SHFT_LED2 |
| 33 | rgblight_sethsv_default_helper(SHFT_LED2); | 33 | rgblight_sethsv_default_helper(SHFT_LED2); |
| 34 | #endif // SHFT_LED2 | 34 | #endif // SHFT_LED2 |
| 35 | } | 35 | } |
| 36 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { | 36 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { |
| 37 | #ifdef CTRL_LED1 | 37 | #ifdef CTRL_LED1 |
| 38 | rgblight_sethsv_at(0, 255, 255, CTRL_LED1); | 38 | rgblight_sethsv_at(0, 255, 255, CTRL_LED1); |
| 39 | #endif // CTRL_LED1 | 39 | #endif // CTRL_LED1 |
| 40 | #ifdef CTRL_LED2 | 40 | #ifdef CTRL_LED2 |
| 41 | rgblight_sethsv_at(0, 255, 255, CTRL_LED2); | 41 | rgblight_sethsv_at(0, 255, 255, CTRL_LED2); |
| 42 | #endif // CTRL_LED2 | 42 | #endif // CTRL_LED2 |
| 43 | } else { | 43 | } else { |
| 44 | #ifdef CTRL_LED1 | 44 | #ifdef CTRL_LED1 |
| 45 | rgblight_sethsv_default_helper(CTRL_LED1); | 45 | rgblight_sethsv_default_helper(CTRL_LED1); |
| 46 | #endif // CTRL_LED1 | 46 | #endif // CTRL_LED1 |
| 47 | #ifdef CTRL_LED2 | 47 | #ifdef CTRL_LED2 |
| 48 | rgblight_sethsv_default_helper(CTRL_LED2); | 48 | rgblight_sethsv_default_helper(CTRL_LED2); |
| 49 | #endif // CTRL_LED2 | 49 | #endif // CTRL_LED2 |
| 50 | } | 50 | } |
| 51 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { | 51 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { |
| 52 | #ifdef GUI_LED1 | 52 | #ifdef GUI_LED1 |
| 53 | rgblight_sethsv_at(51, 255, 255, GUI_LED1); | 53 | rgblight_sethsv_at(51, 255, 255, GUI_LED1); |
| 54 | #endif // GUI_LED1 | 54 | #endif // GUI_LED1 |
| 55 | #ifdef GUI_LED2 | 55 | #ifdef GUI_LED2 |
| 56 | rgblight_sethsv_at(51, 255, 255, GUI_LED2); | 56 | rgblight_sethsv_at(51, 255, 255, GUI_LED2); |
| 57 | #endif // GUI_LED2 | 57 | #endif // GUI_LED2 |
| 58 | } else { | 58 | } else { |
| 59 | #ifdef GUI_LED1 | 59 | #ifdef GUI_LED1 |
| 60 | rgblight_sethsv_default_helper(GUI_LED1); | 60 | rgblight_sethsv_default_helper(GUI_LED1); |
| 61 | #endif // GUI_LED1 | 61 | #endif // GUI_LED1 |
| 62 | #ifdef GUI_LED2 | 62 | #ifdef GUI_LED2 |
| 63 | rgblight_sethsv_default_helper(GUI_LED2); | 63 | rgblight_sethsv_default_helper(GUI_LED2); |
| 64 | #endif // GUI_LED2 | 64 | #endif // GUI_LED2 |
| 65 | } | 65 | } |
| 66 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { | 66 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { |
| 67 | #ifdef ALT_LED1 | 67 | #ifdef ALT_LED1 |
| 68 | rgblight_sethsv_at(240, 255, 255, ALT_LED1); | 68 | rgblight_sethsv_at(240, 255, 255, ALT_LED1); |
| 69 | #endif // ALT_LED1 | 69 | #endif // ALT_LED1 |
| 70 | #ifdef GUI_LED2 | 70 | #ifdef GUI_LED2 |
| 71 | rgblight_sethsv_at(240, 255, 255, ALT_LED2); | 71 | rgblight_sethsv_at(240, 255, 255, ALT_LED2); |
| 72 | #endif // GUI_LED2 | 72 | #endif // GUI_LED2 |
| 73 | } else { | 73 | } else { |
| 74 | #ifdef GUI_LED1 | 74 | #ifdef GUI_LED1 |
| 75 | rgblight_sethsv_default_helper(ALT_LED1); | 75 | rgblight_sethsv_default_helper(ALT_LED1); |
| 76 | #endif // GUI_LED1 | 76 | #endif // GUI_LED1 |
| 77 | #ifdef GUI_LED2 | 77 | #ifdef GUI_LED2 |
| 78 | rgblight_sethsv_default_helper(ALT_LED2); | 78 | rgblight_sethsv_default_helper(ALT_LED2); |
| 79 | #endif // GUI_LED2 | 79 | #endif // GUI_LED2 |
| 80 | } | ||
| 80 | } | 81 | } |
| 81 | } | ||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | void matrix_scan_indicator(void) { | 84 | void matrix_scan_indicator(void) { |
| 85 | if (has_initialized) { | 85 | if (has_initialized) { |
| 86 | set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); | 86 | set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); |
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| 89 | #endif //INDICATOR_LIGHTS | 89 | #endif //INDICATOR_LIGHTS |
| 90 | 90 | ||
| @@ -95,69 +95,71 @@ __attribute__ ((weak)) | |||
| 95 | bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; } | 95 | bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; } |
| 96 | 96 | ||
| 97 | bool rgblight_twinkle_is_led_used(uint8_t index) { | 97 | bool rgblight_twinkle_is_led_used(uint8_t index) { |
| 98 | switch (index) { | 98 | switch (index) { |
| 99 | #ifdef INDICATOR_LIGHTS | 99 | #ifdef INDICATOR_LIGHTS |
| 100 | #ifdef SHFT_LED1 | 100 | #ifdef SHFT_LED1 |
| 101 | case SHFT_LED1: | 101 | case SHFT_LED1: |
| 102 | return true; | 102 | return true; |
| 103 | #endif //SHFT_LED1 | 103 | #endif //SHFT_LED1 |
| 104 | #ifdef SHFT_LED2 | 104 | #ifdef SHFT_LED2 |
| 105 | case SHFT_LED2: | 105 | case SHFT_LED2: |
| 106 | return true; | 106 | return true; |
| 107 | #endif //SHFT_LED2 | 107 | #endif //SHFT_LED2 |
| 108 | #ifdef CTRL_LED1 | 108 | #ifdef CTRL_LED1 |
| 109 | case CTRL_LED1: | 109 | case CTRL_LED1: |
| 110 | return true; | 110 | return true; |
| 111 | #endif //CTRL_LED1 | 111 | #endif //CTRL_LED1 |
| 112 | #ifdef CTRL_LED2 | 112 | #ifdef CTRL_LED2 |
| 113 | case CTRL_LED2: | 113 | case CTRL_LED2: |
| 114 | return true; | 114 | return true; |
| 115 | #endif //CTRL_LED2 | 115 | #endif //CTRL_LED2 |
| 116 | #ifdef GUI_LED1 | 116 | #ifdef GUI_LED1 |
| 117 | case GUI_LED1: | 117 | case GUI_LED1: |
| 118 | return true; | 118 | return true; |
| 119 | #endif //GUI_LED1 | 119 | #endif //GUI_LED1 |
| 120 | #ifdef GUI_LED2 | 120 | #ifdef GUI_LED2 |
| 121 | case GUI_LED2: | 121 | case GUI_LED2: |
| 122 | return true; | 122 | return true; |
| 123 | #endif //GUI_LED2 | 123 | #endif //GUI_LED2 |
| 124 | #ifdef ALT_LED1 | 124 | #ifdef ALT_LED1 |
| 125 | case ALT_LED1: | 125 | case ALT_LED1: |
| 126 | return true; | 126 | return true; |
| 127 | #endif //ALT_LED1 | 127 | #endif //ALT_LED1 |
| 128 | #ifdef ALT_LED2 | 128 | #ifdef ALT_LED2 |
| 129 | case ALT_LED2: | 129 | case ALT_LED2: |
| 130 | return true; | 130 | return true; |
| 131 | #endif //ALT_LED2 | 131 | #endif //ALT_LED2 |
| 132 | #endif //INDICATOR_LIGHTS | 132 | #endif //INDICATOR_LIGHTS |
| 133 | default: | 133 | default: |
| 134 | return rgblight_twinkle_is_led_used_keymap(index); | 134 | return rgblight_twinkle_is_led_used_keymap(index); |
| 135 | } | 135 | } |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive | 138 | void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive |
| 139 | bool litup = false; | 139 | bool litup = false; |
| 140 | for (uint8_t light_index = 0 ; light_index < RGBLED_NUM ; ++light_index ) { | 140 | for (uint8_t light_index = 0 ; light_index < RGBLED_NUM ; ++light_index ) { |
| 141 | if (lights[light_index].enabled && timer_elapsed(lights[light_index].timer) > 10) { | 141 | if (lights[light_index].enabled && timer_elapsed(lights[light_index].timer) > 10) { |
| 142 | rgblight_fadeout *light = &lights[light_index]; | 142 | rgblight_fadeout *light = &lights[light_index]; |
| 143 | litup = true; | 143 | litup = true; |
| 144 | 144 | ||
| 145 | if (light->life) { | 145 | if (light->life) { |
| 146 | light->life -= 1; | 146 | light->life -= 1; |
| 147 | if (biton32(layer_state) == 0) { | 147 | if (biton32(layer_state) == 0) { |
| 148 | sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); | 148 | sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); |
| 149 | } | ||
| 150 | light->timer = timer_read(); | ||
| 151 | } | ||
| 152 | else { | ||
| 153 | if (light->enabled && biton32(layer_state) == 0) { | ||
| 154 | rgblight_sethsv_default_helper(light_index); | ||
| 155 | } | ||
| 156 | litup = light->enabled = false; | ||
| 157 | } | ||
| 149 | } | 158 | } |
| 150 | light->timer = timer_read(); | ||
| 151 | } | ||
| 152 | else { | ||
| 153 | if (light->enabled && biton32(layer_state) == 0) { rgblight_sethsv_default_helper(light_index); } | ||
| 154 | litup = light->enabled = false; | ||
| 155 | } | ||
| 156 | } | 159 | } |
| 157 | } | 160 | if (litup && biton32(layer_state) == 0) { |
| 158 | if (litup && biton32(layer_state) == 0) { | 161 | rgblight_set(); |
| 159 | rgblight_set(); | 162 | } |
| 160 | } | ||
| 161 | } | 163 | } |
| 162 | 164 | ||
| 163 | void start_rgb_light(void) { | 165 | void start_rgb_light(void) { |
| @@ -203,42 +205,42 @@ void start_rgb_light(void) { | |||
| 203 | 205 | ||
| 204 | 206 | ||
| 205 | bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { | 207 | bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { |
| 206 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { | 208 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { |
| 207 | keycode = keycode & 0xFF; | 209 | keycode = keycode & 0xFF; |
| 208 | } | 210 | } |
| 209 | switch (keycode) { | 211 | switch (keycode) { |
| 210 | #ifdef RGBLIGHT_TWINKLE | 212 | #ifdef RGBLIGHT_TWINKLE |
| 211 | case KC_A ... KC_SLASH: | 213 | case KC_A ... KC_SLASH: |
| 212 | case KC_F1 ... KC_F12: | 214 | case KC_F1 ... KC_F12: |
| 213 | case KC_INSERT ... KC_UP: | 215 | case KC_INSERT ... KC_UP: |
| 214 | case KC_KP_SLASH ... KC_KP_DOT: | 216 | case KC_KP_SLASH ... KC_KP_DOT: |
| 215 | case KC_F13 ... KC_F24: | 217 | case KC_F13 ... KC_F24: |
| 216 | case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: | 218 | case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: |
| 217 | if (record->event.pressed) { start_rgb_light(); } | 219 | if (record->event.pressed) { start_rgb_light(); } |
| 218 | return true; break; | 220 | return true; break; |
| 219 | #endif // RGBLIGHT_TWINKLE | 221 | #endif // RGBLIGHT_TWINKLE |
| 220 | case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal | 222 | case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal |
| 221 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | 223 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| 222 | if (record->event.pressed) { | 224 | if (record->event.pressed) { |
| 223 | userspace_config.rgb_layer_change ^= 1; | 225 | userspace_config.rgb_layer_change ^= 1; |
| 224 | xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); | 226 | xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); |
| 225 | eeconfig_update_user(userspace_config.raw); | 227 | eeconfig_update_user(userspace_config.raw); |
| 226 | if (userspace_config.rgb_layer_change) { | 228 | if (userspace_config.rgb_layer_change) { |
| 227 | layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) | 229 | layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) |
| 228 | } | 230 | } |
| 229 | } | 231 | } |
| 230 | #endif // RGBLIGHT_ENABLE | 232 | #endif // RGBLIGHT_ENABLE |
| 231 | return false; break; | 233 | return false; break; |
| 232 | #ifdef RGBLIGHT_ENABLE | 234 | #ifdef RGBLIGHT_ENABLE |
| 233 | case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions | 235 | case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions |
| 234 | if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled | 236 | if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled |
| 235 | if (userspace_config.rgb_layer_change) { | 237 | if (userspace_config.rgb_layer_change) { |
| 236 | userspace_config.rgb_layer_change = false; | 238 | userspace_config.rgb_layer_change = false; |
| 237 | xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); | 239 | xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); |
| 238 | eeconfig_update_user(userspace_config.raw); | 240 | eeconfig_update_user(userspace_config.raw); |
| 239 | } | 241 | } |
| 240 | } | 242 | } |
| 241 | return true; break; | 243 | return true; break; |
| 242 | #endif // RGBLIGHT_ENABLE | 244 | #endif // RGBLIGHT_ENABLE |
| 243 | } | 245 | } |
| 244 | return true; | 246 | return true; |
| @@ -248,28 +250,28 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { | |||
| 248 | 250 | ||
| 249 | void keyboard_post_init_rgb(void) { | 251 | void keyboard_post_init_rgb(void) { |
| 250 | #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) | 252 | #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) |
| 251 | if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } | 253 | if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); } |
| 252 | if (rgblight_config.enable) { | 254 | if (rgblight_config.enable) { |
| 253 | layer_state_set_user(layer_state); | 255 | layer_state_set_user(layer_state); |
| 254 | uint16_t old_hue = rgblight_config.hue; | 256 | uint16_t old_hue = rgblight_config.hue; |
| 255 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | 257 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); |
| 256 | for (uint16_t i = 360; i > 0; i--) { | 258 | for (uint16_t i = 255; i > 0; i--) { |
| 257 | rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); | 259 | rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); |
| 258 | matrix_scan(); | 260 | matrix_scan(); |
| 259 | wait_ms(10); | 261 | wait_ms(10); |
| 262 | } | ||
| 260 | } | 263 | } |
| 261 | } | ||
| 262 | #endif | 264 | #endif |
| 263 | layer_state_set_user(layer_state); | 265 | layer_state_set_user(layer_state); |
| 264 | } | 266 | } |
| 265 | 267 | ||
| 266 | void matrix_scan_rgb(void) { | 268 | void matrix_scan_rgb(void) { |
| 267 | #ifdef RGBLIGHT_TWINKLE | 269 | #ifdef RGBLIGHT_TWINKLE |
| 268 | scan_rgblight_fadeout(); | 270 | scan_rgblight_fadeout(); |
| 269 | #endif // RGBLIGHT_ENABLE | 271 | #endif // RGBLIGHT_ENABLE |
| 270 | 272 | ||
| 271 | #ifdef INDICATOR_LIGHTS | 273 | #ifdef INDICATOR_LIGHTS |
| 272 | matrix_scan_indicator(); | 274 | matrix_scan_indicator(); |
| 273 | #endif | 275 | #endif |
| 274 | 276 | ||
| 275 | } | 277 | } |
| @@ -277,99 +279,60 @@ void matrix_scan_rgb(void) { | |||
| 277 | 279 | ||
| 278 | uint32_t layer_state_set_rgb(uint32_t state) { | 280 | uint32_t layer_state_set_rgb(uint32_t state) { |
| 279 | #ifdef RGBLIGHT_ENABLE | 281 | #ifdef RGBLIGHT_ENABLE |
| 280 | if (userspace_config.rgb_layer_change) { | 282 | if (userspace_config.rgb_layer_change) { |
| 281 | switch (biton32(state)) { | 283 | switch (biton32(state)) { |
| 282 | case _MACROS: | 284 | case _MACROS: |
| 283 | rgblight_sethsv_noeeprom_orange(); | 285 | rgblight_sethsv_noeeprom_orange(); |
| 284 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); | 286 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2) : rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 3); |
| 285 | break; | 287 | break; |
| 286 | case _MEDIA: | 288 | case _MEDIA: |
| 287 | rgblight_sethsv_noeeprom_chartreuse(); | 289 | rgblight_sethsv_noeeprom_chartreuse(); |
| 288 | rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); | 290 | rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); |
| 289 | break; | 291 | break; |
| 290 | case _GAMEPAD: | 292 | case _GAMEPAD: |
| 291 | rgblight_sethsv_noeeprom_orange(); | 293 | rgblight_sethsv_noeeprom_orange(); |
| 292 | rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); | 294 | rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); |
| 293 | break; | 295 | break; |
| 294 | case _DIABLO: | 296 | case _DIABLO: |
| 295 | rgblight_sethsv_noeeprom_red(); | 297 | rgblight_sethsv_noeeprom_red(); |
| 296 | rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); | 298 | rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); |
| 297 | break; | 299 | break; |
| 298 | case _RAISE: | 300 | case _RAISE: |
| 299 | rgblight_sethsv_noeeprom_yellow(); | 301 | rgblight_sethsv_noeeprom_yellow(); |
| 300 | rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); | 302 | rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); |
| 301 | break; | 303 | break; |
| 302 | case _LOWER: | 304 | case _LOWER: |
| 303 | rgblight_sethsv_noeeprom_green(); | 305 | rgblight_sethsv_noeeprom_green(); |
| 304 | rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); | 306 | rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); |
| 305 | break; | 307 | break; |
| 306 | case _ADJUST: | 308 | case _ADJUST: |
| 307 | rgblight_sethsv_noeeprom_red(); | 309 | rgblight_sethsv_noeeprom_red(); |
| 308 | rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); | 310 | rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); |
| 309 | break; | 311 | break; |
| 310 | default: // for any other layers, or the default layer | 312 | default: // for any other layers, or the default layer |
| 311 | switch (biton32(default_layer_state)) { | 313 | switch (biton32(default_layer_state)) { |
| 312 | case _COLEMAK: | 314 | case _COLEMAK: |
| 313 | rgblight_sethsv_noeeprom_magenta(); break; | 315 | rgblight_sethsv_noeeprom_magenta(); break; |
| 314 | case _DVORAK: | 316 | case _DVORAK: |
| 315 | rgblight_sethsv_noeeprom_springgreen(); break; | 317 | rgblight_sethsv_noeeprom_springgreen(); break; |
| 316 | case _WORKMAN: | 318 | case _WORKMAN: |
| 317 | rgblight_sethsv_noeeprom_goldenrod(); break; | 319 | rgblight_sethsv_noeeprom_goldenrod(); break; |
| 318 | case _NORMAN: | 320 | case _NORMAN: |
| 319 | rgblight_sethsv_noeeprom_coral(); break; | 321 | rgblight_sethsv_noeeprom_coral(); break; |
| 320 | case _MALTRON: | 322 | case _MALTRON: |
| 321 | rgblight_sethsv_noeeprom_yellow(); break; | 323 | rgblight_sethsv_noeeprom_yellow(); break; |
| 322 | case _EUCALYN: | 324 | case _EUCALYN: |
| 323 | rgblight_sethsv_noeeprom_pink(); break; | 325 | rgblight_sethsv_noeeprom_pink(); break; |
| 324 | case _CARPLAX: | 326 | case _CARPLAX: |
| 325 | rgblight_sethsv_noeeprom_blue(); break; | 327 | rgblight_sethsv_noeeprom_blue(); break; |
| 326 | default: | 328 | default: |
| 327 | rgblight_sethsv_noeeprom_cyan(); break; | 329 | rgblight_sethsv_noeeprom_cyan(); break; |
| 328 | } | 330 | } |
| 329 | 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 | 331 | 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 |
| 330 | break; | 332 | break; |
| 333 | } | ||
| 331 | } | 334 | } |
| 332 | // layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow | ||
| 333 | } | ||
| 334 | #endif // RGBLIGHT_ENABLE | 335 | #endif // RGBLIGHT_ENABLE |
| 335 | 336 | ||
| 336 | return state; | 337 | return state; |
| 337 | } | ||
| 338 | |||
| 339 | #if 0 | ||
| 340 | uint32_t default_layer_state_set_rgb(uint32_t state) { | ||
| 341 | #ifdef RGBLIGHT_ENABLE | ||
| 342 | if (userspace_config.rgb_layer_change) { | ||
| 343 | rgblight_config_t temp_rgblight_config = rgblight_config; | ||
| 344 | switch (biton32(state)) { | ||
| 345 | case _COLEMAK: | ||
| 346 | temp_rgblight_config.hue = 300; | ||
| 347 | temp_rgblight_config.val = 255; | ||
| 348 | temp_rgblight_config.sat = 255; | ||
| 349 | temp_rgblight_config.mode = 1; | ||
| 350 | break; | ||
| 351 | case _DVORAK: | ||
| 352 | temp_rgblight_config.hue = 150; | ||
| 353 | temp_rgblight_config.val = 255; | ||
| 354 | temp_rgblight_config.sat = 255; | ||
| 355 | temp_rgblight_config.mode = 1; | ||
| 356 | case _WORKMAN: | ||
| 357 | temp_rgblight_config.hue = 43; | ||
| 358 | temp_rgblight_config.val = 218; | ||
| 359 | temp_rgblight_config.sat = 218; | ||
| 360 | temp_rgblight_config.mode = 1; | ||
| 361 | default: | ||
| 362 | temp_rgblight_config.hue = 180; | ||
| 363 | temp_rgblight_config.val = 255; | ||
| 364 | temp_rgblight_config.sat = 255; | ||
| 365 | temp_rgblight_config.mode = 1; | ||
| 366 | } | ||
| 367 | if (temp_rgblight_config.raw != eeconfig_read_rgblight()) { | ||
| 368 | xprintf("rgblight set default layer hsv [EEPROM]: %u,%u,%u,%u\n", temp_rgblight_config.hue, temp_rgblight_config.sat, temp_rgblight_config.val, temp_rgblight_config.mode); | ||
| 369 | eeconfig_update_rgblight(temp_rgblight_config.raw); | ||
| 370 | } | ||
| 371 | } | ||
| 372 | #endif // RGBLIGHT_ENABLE | ||
| 373 | return state; | ||
| 374 | } | 338 | } |
| 375 | #endif | ||
diff --git a/users/drashna/rgblight_breathe_table.h b/users/drashna/rgblight_breathe_table.h new file mode 100644 index 000000000..05d347fcd --- /dev/null +++ b/users/drashna/rgblight_breathe_table.h | |||
| @@ -0,0 +1,116 @@ | |||
| 1 | #ifndef RGBLIGHT_EFFECT_BREATHE_TABLE | ||
| 2 | #define RGBLIGHT_EFFECT_BREATHE_TABLE | ||
| 3 | |||
| 4 | const uint8_t rgblight_effect_breathe_table[] PROGMEM = { | ||
| 5 | /* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */ | ||
| 6 | /* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */ | ||
| 7 | |||
| 8 | #if RGBLIGHT_BREATHE_TABLE_SIZE == 256 | ||
| 9 | 0x44, 0x45, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4e, | ||
| 10 | 0x4f, 0x51, 0x52, 0x54, 0x55, 0x57, 0x58, 0x5a, | ||
| 11 | 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x64, 0x65, 0x67, | ||
| 12 | 0x69, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x73, 0x75, | ||
| 13 | 0x77, 0x79, 0x7b, 0x7c, 0x7e, 0x80, 0x82, 0x84, | ||
| 14 | 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x91, 0x93, | ||
| 15 | 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9f, 0xa1, 0xa3, | ||
| 16 | 0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xae, 0xb0, 0xb2, | ||
| 17 | 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xbf, 0xc1, | ||
| 18 | 0xc3, 0xc5, 0xc7, 0xc9, 0xca, 0xcc, 0xce, 0xd0, | ||
| 19 | 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda, 0xdb, 0xdd, | ||
| 20 | 0xde, 0xe0, 0xe1, 0xe3, 0xe4, 0xe5, 0xe7, 0xe8, | ||
| 21 | 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, | ||
| 22 | 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf8, | ||
| 23 | 0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd, | ||
| 24 | 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, | ||
| 25 | 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, | ||
| 26 | 0xfd, 0xfc, 0xfc, 0xfc, 0xfb, 0xfa, 0xfa, 0xf9, | ||
| 27 | 0xf8, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, | ||
| 28 | 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xe9, | ||
| 29 | 0xe8, 0xe7, 0xe5, 0xe4, 0xe3, 0xe1, 0xe0, 0xde, | ||
| 30 | 0xdd, 0xdb, 0xda, 0xd8, 0xd6, 0xd5, 0xd3, 0xd1, | ||
| 31 | 0xd0, 0xce, 0xcc, 0xca, 0xc9, 0xc7, 0xc5, 0xc3, | ||
| 32 | 0xc1, 0xbf, 0xbe, 0xbc, 0xba, 0xb8, 0xb6, 0xb4, | ||
| 33 | 0xb2, 0xb0, 0xae, 0xac, 0xaa, 0xa9, 0xa7, 0xa5, | ||
| 34 | 0xa3, 0xa1, 0x9f, 0x9d, 0x9b, 0x99, 0x97, 0x95, | ||
| 35 | 0x93, 0x91, 0x8f, 0x8d, 0x8b, 0x8a, 0x88, 0x86, | ||
| 36 | 0x84, 0x82, 0x80, 0x7e, 0x7c, 0x7b, 0x79, 0x77, | ||
| 37 | 0x75, 0x73, 0x72, 0x70, 0x6e, 0x6c, 0x6a, 0x69, | ||
| 38 | 0x67, 0x65, 0x64, 0x62, 0x60, 0x5f, 0x5d, 0x5c, | ||
| 39 | 0x5a, 0x58, 0x57, 0x55, 0x54, 0x52, 0x51, 0x4f, | ||
| 40 | 0x4e, 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x45, 0x44 | ||
| 41 | #endif /* 256 bytes table */ | ||
| 42 | |||
| 43 | #if RGBLIGHT_BREATHE_TABLE_SIZE == 128 | ||
| 44 | 0x44, 0x47, 0x4a, 0x4c, | ||
| 45 | 0x4f, 0x52, 0x55, 0x58, | ||
| 46 | 0x5c, 0x5f, 0x62, 0x65, | ||
| 47 | 0x69, 0x6c, 0x70, 0x73, | ||
| 48 | 0x77, 0x7b, 0x7e, 0x82, | ||
| 49 | 0x86, 0x8a, 0x8d, 0x91, | ||
| 50 | 0x95, 0x99, 0x9d, 0xa1, | ||
| 51 | 0xa5, 0xa9, 0xac, 0xb0, | ||
| 52 | 0xb4, 0xb8, 0xbc, 0xbf, | ||
| 53 | 0xc3, 0xc7, 0xca, 0xce, | ||
| 54 | 0xd1, 0xd5, 0xd8, 0xdb, | ||
| 55 | 0xde, 0xe1, 0xe4, 0xe7, | ||
| 56 | 0xe9, 0xec, 0xee, 0xf0, | ||
| 57 | 0xf2, 0xf4, 0xf6, 0xf8, | ||
| 58 | 0xf9, 0xfa, 0xfc, 0xfc, | ||
| 59 | 0xfd, 0xfe, 0xfe, 0xfe, | ||
| 60 | 0xfe, 0xfe, 0xfe, 0xfe, | ||
| 61 | 0xfd, 0xfc, 0xfb, 0xfa, | ||
| 62 | 0xf8, 0xf7, 0xf5, 0xf3, | ||
| 63 | 0xf1, 0xef, 0xed, 0xeb, | ||
| 64 | 0xe8, 0xe5, 0xe3, 0xe0, | ||
| 65 | 0xdd, 0xda, 0xd6, 0xd3, | ||
| 66 | 0xd0, 0xcc, 0xc9, 0xc5, | ||
| 67 | 0xc1, 0xbe, 0xba, 0xb6, | ||
| 68 | 0xb2, 0xae, 0xaa, 0xa7, | ||
| 69 | 0xa3, 0x9f, 0x9b, 0x97, | ||
| 70 | 0x93, 0x8f, 0x8b, 0x88, | ||
| 71 | 0x84, 0x80, 0x7c, 0x79, | ||
| 72 | 0x75, 0x72, 0x6e, 0x6a, | ||
| 73 | 0x67, 0x64, 0x60, 0x5d, | ||
| 74 | 0x5a, 0x57, 0x54, 0x51, | ||
| 75 | 0x4e, 0x4b, 0x48, 0x45 | ||
| 76 | #endif /* 128 bytes table */ | ||
| 77 | |||
| 78 | #if RGBLIGHT_BREATHE_TABLE_SIZE == 64 | ||
| 79 | 0x44, 0x4a, | ||
| 80 | 0x4f, 0x55, | ||
| 81 | 0x5c, 0x62, | ||
| 82 | 0x69, 0x70, | ||
| 83 | 0x77, 0x7e, | ||
| 84 | 0x86, 0x8d, | ||
| 85 | 0x95, 0x9d, | ||
| 86 | 0xa5, 0xac, | ||
| 87 | 0xb4, 0xbc, | ||
| 88 | 0xc3, 0xca, | ||
| 89 | 0xd1, 0xd8, | ||
| 90 | 0xde, 0xe4, | ||
| 91 | 0xe9, 0xee, | ||
| 92 | 0xf2, 0xf6, | ||
| 93 | 0xf9, 0xfc, | ||
| 94 | 0xfd, 0xfe, | ||
| 95 | 0xfe, 0xfe, | ||
| 96 | 0xfd, 0xfb, | ||
| 97 | 0xf8, 0xf5, | ||
| 98 | 0xf1, 0xed, | ||
| 99 | 0xe8, 0xe3, | ||
| 100 | 0xdd, 0xd6, | ||
| 101 | 0xd0, 0xc9, | ||
| 102 | 0xc1, 0xba, | ||
| 103 | 0xb2, 0xaa, | ||
| 104 | 0xa3, 0x9b, | ||
| 105 | 0x93, 0x8b, | ||
| 106 | 0x84, 0x7c, | ||
| 107 | 0x75, 0x6e, | ||
| 108 | 0x67, 0x60, | ||
| 109 | 0x5a, 0x54, | ||
| 110 | 0x4e, 0x48 | ||
| 111 | #endif /* 64 bytes table */ | ||
| 112 | }; | ||
| 113 | |||
| 114 | static const int table_scale = 256/sizeof(rgblight_effect_breathe_table); | ||
| 115 | |||
| 116 | #endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */ | ||
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index bef25e259..085840f1c 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk | |||
| @@ -1,40 +1,40 @@ | |||
| 1 | SRC += drashna.c \ | 1 | SRC += drashna.c \ |
| 2 | process_records.c | 2 | process_records.c |
| 3 | 3 | ||
| 4 | LINK_TIME_OPTIMIZATION_ENABLE = yes | ||
| 5 | |||
| 4 | ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") | 6 | ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") |
| 5 | SRC += secrets.c | 7 | SRC += secrets.c |
| 6 | endif | 8 | endif |
| 7 | 9 | ||
| 8 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) | 10 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) |
| 9 | SRC += tap_dances.c | 11 | SRC += tap_dances.c |
| 10 | endif | 12 | endif |
| 11 | 13 | ||
| 12 | ifeq ($(PLATFORM),AVR) | 14 | |
| 13 | EXTRAFLAGS += -flto | ||
| 14 | endif | ||
| 15 | 15 | ||
| 16 | ifeq ($(strip $(NO_SECRETS)), yes) | 16 | ifeq ($(strip $(NO_SECRETS)), yes) |
| 17 | OPT_DEFS += -DNO_SECRETS | 17 | OPT_DEFS += -DNO_SECRETS |
| 18 | endif | 18 | endif |
| 19 | 19 | ||
| 20 | ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) | 20 | ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) |
| 21 | SRC += rgb_stuff.c | 21 | SRC += rgb_stuff.c |
| 22 | ifeq ($(strip $(INDICATOR_LIGHTS)), yes) | 22 | ifeq ($(strip $(INDICATOR_LIGHTS)), yes) |
| 23 | OPT_DEFS += -DINDICATOR_LIGHTS | 23 | OPT_DEFS += -DINDICATOR_LIGHTS |
| 24 | endif | 24 | endif |
| 25 | ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes) | 25 | ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes) |
| 26 | OPT_DEFS += -DRGBLIGHT_TWINKLE | 26 | OPT_DEFS += -DRGBLIGHT_TWINKLE |
| 27 | endif | 27 | endif |
| 28 | ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) | 28 | ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) |
| 29 | OPT_DEFS += -DRGBLIGHT_NOEEPROM | 29 | OPT_DEFS += -DRGBLIGHT_NOEEPROM |
| 30 | endif | 30 | endif |
| 31 | ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) | 31 | ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes) |
| 32 | OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION | 32 | OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION |
| 33 | endif | 33 | endif |
| 34 | endif | 34 | endif |
| 35 | 35 | ||
| 36 | ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) | 36 | ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) |
| 37 | SRC += rgb_stuff.c | 37 | SRC += rgb_stuff.c |
| 38 | endif | 38 | endif |
| 39 | 39 | ||
| 40 | 40 | ||
| @@ -43,9 +43,9 @@ ifeq ($(strip $(MACROS_ENABLED)), yes) | |||
| 43 | endif | 43 | endif |
| 44 | 44 | ||
| 45 | ifdef CONSOLE_ENABLE | 45 | ifdef CONSOLE_ENABLE |
| 46 | ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) | 46 | ifeq ($(strip $(KEYLOGGER_ENABLE)), yes) |
| 47 | OPT_DEFS += -DKEYLOGGER_ENABLE | 47 | OPT_DEFS += -DKEYLOGGER_ENABLE |
| 48 | endif | 48 | endif |
| 49 | endif | 49 | endif |
| 50 | 50 | ||
| 51 | ifeq ($(strip $(MAKE_BOOTLOADER)), yes) | 51 | ifeq ($(strip $(MAKE_BOOTLOADER)), yes) |
diff --git a/users/drashna/send_unicode.h b/users/drashna/send_unicode.h index 818b6e571..743abc58b 100644 --- a/users/drashna/send_unicode.h +++ b/users/drashna/send_unicode.h | |||
| @@ -7,65 +7,65 @@ void send_unicode_hex_string(const char* str); | |||
| 7 | /* use X(n) to call the */ | 7 | /* use X(n) to call the */ |
| 8 | #ifdef UNICODEMAP_ENABLE | 8 | #ifdef UNICODEMAP_ENABLE |
| 9 | enum unicode_name { | 9 | enum unicode_name { |
| 10 | THINK, // thinking face 🤔 | 10 | THINK, // thinking face 🤔 |
| 11 | GRIN, // grinning face 😊 | 11 | GRIN, // grinning face 😊 |
| 12 | SMRK, // smirk 😏 | 12 | SMRK, // smirk 😏 |
| 13 | WEARY, // good shit 😩 | 13 | WEARY, // good shit 😩 |
| 14 | UNAMU, // unamused 😒 | 14 | UNAMU, // unamused 😒 |
| 15 | 15 | ||
| 16 | SNEK, // snke 🐍 | 16 | SNEK, // snke 🐍 |
| 17 | PENGUIN, // 🐧 | 17 | PENGUIN, // 🐧 |
| 18 | DRAGON, // 🐉 | 18 | DRAGON, // 🐉 |
| 19 | MONKEY, // 🐒 | 19 | MONKEY, // 🐒 |
| 20 | CHICK, // 🐥 | 20 | CHICK, // 🐥 |
| 21 | BOAR, // 🐗 | 21 | BOAR, // 🐗 |
| 22 | 22 | ||
| 23 | OKOK, // 👌 | 23 | OKOK, // 👌 |
| 24 | EFFU, // 🖕 | 24 | EFFU, // 🖕 |
| 25 | INUP, // 👆 | 25 | INUP, // 👆 |
| 26 | THUP, // 👍 | 26 | THUP, // 👍 |
| 27 | THDN, // 👎 | 27 | THDN, // 👎 |
| 28 | 28 | ||
| 29 | BBB, // dat B 🅱 | 29 | BBB, // dat B 🅱 |
| 30 | POO, // poop 💩 | 30 | POO, // poop 💩 |
| 31 | HUNDR, // 100 💯 | 31 | HUNDR, // 100 💯 |
| 32 | EGGPL, // EGGPLANT 🍆 | 32 | EGGPL, // EGGPLANT 🍆 |
| 33 | WATER, // wet 💦 | 33 | WATER, // wet 💦 |
| 34 | TUMBLER, // 🥃 | 34 | TUMBLER, // 🥃 |
| 35 | 35 | ||
| 36 | LIT, // fire 🔥 | 36 | LIT, // fire 🔥 |
| 37 | BANG, // ‽ | 37 | BANG, // ‽ |
| 38 | IRONY, // ⸮ | 38 | IRONY, // ⸮ |
| 39 | DEGREE // ° | 39 | DEGREE // ° |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | const uint32_t PROGMEM unicode_map[] = { | 43 | const uint32_t PROGMEM unicode_map[] = { |
| 44 | [THINK] = 0x1F914, | 44 | [THINK] = 0x1F914, |
| 45 | [GRIN] = 0x1F600, | 45 | [GRIN] = 0x1F600, |
| 46 | [BBB] = 0x1F171, | 46 | [BBB] = 0x1F171, |
| 47 | [POO] = 0x1F4A9, | 47 | [POO] = 0x1F4A9, |
| 48 | [HUNDR] = 0x1F4AF, | 48 | [HUNDR] = 0x1F4AF, |
| 49 | [SMRK] = 0x1F60F, | 49 | [SMRK] = 0x1F60F, |
| 50 | [WEARY] = 0x1F629, | 50 | [WEARY] = 0x1F629, |
| 51 | [EGGPL] = 0x1F346, | 51 | [EGGPL] = 0x1F346, |
| 52 | [WATER] = 0x1F4A6, | 52 | [WATER] = 0x1F4A6, |
| 53 | [LIT] = 0x1F525, | 53 | [LIT] = 0x1F525, |
| 54 | [UNAMU] = 0x1F612, | 54 | [UNAMU] = 0x1F612, |
| 55 | [SNEK] = 0x1F40D, | 55 | [SNEK] = 0x1F40D, |
| 56 | [PENGUIN] = 0x1F427, | 56 | [PENGUIN] = 0x1F427, |
| 57 | [BOAR] = 0x1F417, | 57 | [BOAR] = 0x1F417, |
| 58 | [MONKEY] = 0x1F412, | 58 | [MONKEY] = 0x1F412, |
| 59 | [CHICK] = 0x1F425, | 59 | [CHICK] = 0x1F425, |
| 60 | [DRAGON] = 0x1F409, | 60 | [DRAGON] = 0x1F409, |
| 61 | [OKOK] = 0x1F44C, | 61 | [OKOK] = 0x1F44C, |
| 62 | [EFFU] = 0x1F595, | 62 | [EFFU] = 0x1F595, |
| 63 | [INUP] = 0x1F446, | 63 | [INUP] = 0x1F446, |
| 64 | [THDN] = 0x1F44E, | 64 | [THDN] = 0x1F44E, |
| 65 | [THUP] = 0x1F44D, | 65 | [THUP] = 0x1F44D, |
| 66 | [TUMBLER] = 0x1F943, | 66 | [TUMBLER] = 0x1F943, |
| 67 | [BANG] = 0x0203D, | 67 | [BANG] = 0x0203D, |
| 68 | [IRONY] = 0x02E2E, | 68 | [IRONY] = 0x02E2E, |
| 69 | [DEGREE] = 0x000B0 | 69 | [DEGREE] = 0x000B0 |
| 70 | }; | 70 | }; |
| 71 | #endif // UNICODEMAP_ENABLE | 71 | #endif // UNICODEMAP_ENABLE |
diff --git a/users/drashna/tap_dances.c b/users/drashna/tap_dances.c index cbb3cf54e..18ca96e18 100644 --- a/users/drashna/tap_dances.c +++ b/users/drashna/tap_dances.c | |||
| @@ -2,63 +2,64 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | //define diablo macro timer variables | 4 | //define diablo macro timer variables |
| 5 | uint16_t diablo_timer[4]; | 5 | diablo_timer_t diablo_timer[4]; |
| 6 | uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; | 6 | |
| 7 | uint8_t diablo_key_time[4]; | 7 | uint8_t diablo_times[] = { 0, 0, 1, 3, 5, 10, 30 }; |
| 8 | 8 | ||
| 9 | // has the correct number of seconds elapsed (as defined by diablo_times) | 9 | // has the correct number of seconds elapsed (as defined by diablo_times) |
| 10 | bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; | 10 | bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer].key_time) < (diablo_timer[dtimer].timer * 1000)) ? false : true; }; |
| 11 | 11 | ||
| 12 | // Cycle through the times for the macro, starting at 0, for disabled. | 12 | // Cycle through the times for the macro, starting at 0, for disabled. |
| 13 | // Max of six values, so don't exceed | 13 | // Max of six values, so don't exceed |
| 14 | void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { | 14 | void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { |
| 15 | if (state->count >= 7) { | 15 | int index = (int)user_data; |
| 16 | diablo_key_time[diablo_key] = diablo_times[0]; | 16 | if (state->count >= 7) { |
| 17 | reset_tap_dance(state); | 17 | diablo_timer[index].key_time = diablo_times[0]; |
| 18 | } else { | 18 | reset_tap_dance(state); |
| 19 | diablo_key_time[diablo_key] = diablo_times[state->count - 1]; | 19 | } else { |
| 20 | } | 20 | diablo_timer[index].key_time = diablo_times[state->count]; |
| 21 | } | ||
| 21 | } | 22 | } |
| 22 | 23 | ||
| 23 | // Would rather have one function for all of this, but no idea how to do that... | 24 | // One funtion to rule them all!! |
| 24 | void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); } | 25 | #define ACTION_TAP_DANCE_DIABLO(arg) { \ |
| 25 | void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); } | 26 | .fn = { NULL, (void *)diablo_tapdance_master, NULL }, \ |
| 26 | void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); } | 27 | .user_data = (void *)arg, \ |
| 27 | void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); } | 28 | } |
| 28 | 29 | ||
| 29 | //Tap Dance Definitions | 30 | //Tap Dance Definitions |
| 30 | qk_tap_dance_action_t tap_dance_actions[] = { | 31 | qk_tap_dance_action_t tap_dance_actions[] = { |
| 31 | // tap once to disable, and more to enable timed micros | 32 | // tap once to disable, and more to enable timed micros |
| 32 | [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), | 33 | [TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0), |
| 33 | [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), | 34 | [TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1), |
| 34 | [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), | 35 | [TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2), |
| 35 | [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), | 36 | [TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3), |
| 36 | }; | 37 | }; |
| 37 | 38 | ||
| 38 | // Sends the key press to system, but only if on the Diablo layer | 39 | // Sends the key press to system, but only if on the Diablo layer |
| 39 | void send_diablo_keystroke(uint8_t diablo_key) { | 40 | void send_diablo_keystroke(uint8_t diablo_key) { |
| 40 | if (IS_LAYER_ON(_DIABLO)) { | 41 | if (IS_LAYER_ON(_DIABLO)) { |
| 41 | switch (diablo_key) { | 42 | switch (diablo_key) { |
| 42 | case 0: | 43 | case 0: |
| 43 | tap_code(KC_1); break; | 44 | tap_code(KC_1); break; |
| 44 | case 1: | 45 | case 1: |
| 45 | tap_code(KC_2); break; | 46 | tap_code(KC_2); break; |
| 46 | case 2: | 47 | case 2: |
| 47 | tap_code(KC_3); break; | 48 | tap_code(KC_3); break; |
| 48 | case 3: | 49 | case 3: |
| 49 | tap_code(KC_4); break; | 50 | tap_code(KC_4); break; |
| 51 | } | ||
| 50 | } | 52 | } |
| 51 | } | ||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | // Checks each of the 4 timers/keys to see if enough time has elapsed | 55 | // Checks each of the 4 timers/keys to see if enough time has elapsed |
| 55 | // Runs the "send string" command if enough time has passed, and resets the timer. | 56 | // Runs the "send string" command if enough time has passed, and resets the timer. |
| 56 | void run_diablo_macro_check(void) { | 57 | void run_diablo_macro_check(void) { |
| 57 | uint8_t dtime; | 58 | uint8_t dtime; |
| 58 | for (dtime = 0; dtime < 4; dtime++) { | 59 | for (dtime = 0; dtime < 4; dtime++) { |
| 59 | if (check_dtimer(dtime) && diablo_key_time[dtime]) { | 60 | if (check_dtimer(dtime) && diablo_timer[dtime].key_time) { |
| 60 | diablo_timer[dtime] = timer_read(); | 61 | diablo_timer[dtime].timer = timer_read(); |
| 61 | send_diablo_keystroke(dtime); | 62 | send_diablo_keystroke(dtime); |
| 63 | } | ||
| 62 | } | 64 | } |
| 63 | } | ||
| 64 | } | 65 | } |
diff --git a/users/drashna/tap_dances.h b/users/drashna/tap_dances.h index 41d2bacb7..4a293b258 100644 --- a/users/drashna/tap_dances.h +++ b/users/drashna/tap_dances.h | |||
| @@ -2,18 +2,21 @@ | |||
| 2 | #include "drashna.h" | 2 | #include "drashna.h" |
| 3 | 3 | ||
| 4 | //define diablo macro timer variables | 4 | //define diablo macro timer variables |
| 5 | extern uint16_t diablo_timer[4]; | ||
| 6 | extern uint8_t diablo_times[]; | 5 | extern uint8_t diablo_times[]; |
| 7 | extern uint8_t diablo_key_time[4]; | 6 | typedef struct { |
| 7 | uint16_t timer; | ||
| 8 | uint8_t key_time; | ||
| 9 | } diablo_timer_t; | ||
| 8 | 10 | ||
| 11 | extern diablo_timer_t diablo_timer[4]; | ||
| 9 | 12 | ||
| 10 | void run_diablo_macro_check(void); | 13 | void run_diablo_macro_check(void); |
| 11 | 14 | ||
| 12 | #ifdef TAP_DANCE_ENABLE | 15 | #ifdef TAP_DANCE_ENABLE |
| 13 | enum { | 16 | enum { |
| 14 | TD_D3_1 = 0, | 17 | TD_D3_1 = 0, |
| 15 | TD_D3_2, | 18 | TD_D3_2, |
| 16 | TD_D3_3, | 19 | TD_D3_3, |
| 17 | TD_D3_4 | 20 | TD_D3_4 |
| 18 | }; | 21 | }; |
| 19 | #endif // TAP_DANCE_ENABLE | 22 | #endif // TAP_DANCE_ENABLE |
diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h index 3260c58ae..93f842f4b 100644 --- a/users/drashna/wrappers.h +++ b/users/drashna/wrappers.h | |||
| @@ -6,7 +6,7 @@ arguments, we need a wrapper in order for these definitions to be | |||
| 6 | expanded before being used as arguments to the LAYOUT_xxx macro. | 6 | expanded before being used as arguments to the LAYOUT_xxx macro. |
| 7 | */ | 7 | */ |
| 8 | #if (!defined(LAYOUT) && defined(KEYMAP)) | 8 | #if (!defined(LAYOUT) && defined(KEYMAP)) |
| 9 | #define LAYOUT KEYMAP | 9 | # define LAYOUT KEYMAP |
| 10 | #endif | 10 | #endif |
| 11 | 11 | ||
| 12 | #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) | 12 | #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) |
| @@ -15,6 +15,7 @@ expanded before being used as arguments to the LAYOUT_xxx macro. | |||
| 15 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) | 15 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) |
| 16 | #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) | 16 | #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) |
| 17 | #define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) | 17 | #define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) |
| 18 | #define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__) | ||
| 18 | 19 | ||
| 19 | /* | 20 | /* |
| 20 | Blocks for each of the four major keyboard layouts | 21 | Blocks for each of the four major keyboard layouts |
