diff options
| author | Drashna Jaelre <drashna@live.com> | 2019-03-15 08:57:44 -0700 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-03-15 08:57:44 -0700 |
| commit | 493fbb3dc1423e0d42e57a6dc7ba38b880b37eb5 (patch) | |
| tree | d351bb45b24f55eb355b5724f97b0942214fd781 /users/drashna | |
| parent | e0a03bfa6c148da2936b27a2285f1928c5574ac0 (diff) | |
| download | qmk_firmware-493fbb3dc1423e0d42e57a6dc7ba38b880b37eb5.tar.gz qmk_firmware-493fbb3dc1423e0d42e57a6dc7ba38b880b37eb5.zip | |
[Keymap] Update to drashna keymaps: Conform to QMK Standards Edition (#5377)
* Use correct functions for dip switch code
* Some planck cleanup
* Hopefully fix RGB Sleeping with RGB Matrix
* Add rgbmatrix extern
* Add numpad 5x6 layout
* RGB Tweaks
* Add RGB startup animation
* Minor RGB Fixes
* Turn off RBG on planck
* Enable separate storage of EEPROM
* Update Macro pad
* Add BJohnson Keymap and minor darshna tweaks
* Clean up rgb and other code for new numpad
* Remove clicky hachy thing
* Update my code to use built in MOD_MASK defines
* Fix up modifier calls
* Tweak to KC_MAKE
* Tweak to KC_MAKE
* Add Semi-colon to numpad
* Preprocess out rgb matrix stuff if not enabled
* Formatting of KC_MAKE
* Add stuff for matrix and light rgb coexistance
* Fix bad spelling
* Change where layer indication shows based on rgblight status
* Force set mods in KC_MAKE
* Optimize CRKBD
Diffstat (limited to 'users/drashna')
| -rw-r--r-- | users/drashna/config.h | 8 | ||||
| -rw-r--r-- | users/drashna/drashna.c | 6 | ||||
| -rw-r--r-- | users/drashna/drashna.h | 5 | ||||
| -rw-r--r-- | users/drashna/process_records.c | 45 | ||||
| -rw-r--r-- | users/drashna/rgb_stuff.c | 37 | ||||
| -rw-r--r-- | users/drashna/rules.mk | 4 |
6 files changed, 49 insertions, 56 deletions
diff --git a/users/drashna/config.h b/users/drashna/config.h index 2e125d1e4..2abd326da 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h | |||
| @@ -15,10 +15,10 @@ | |||
| 15 | // #ifdef RGBLIGHT_ENABLE | 15 | // #ifdef RGBLIGHT_ENABLE |
| 16 | // #define NO_MUSIC_MODE | 16 | // #define NO_MUSIC_MODE |
| 17 | // #endif //RGBLIGHT_ENABLE/ | 17 | // #endif //RGBLIGHT_ENABLE/ |
| 18 | #ifndef __arm__ | 18 | // #ifndef __arm__ |
| 19 | #undef NOTE_REST | 19 | // #undef NOTE_REST |
| 20 | #define NOTE_REST 1.00f | 20 | // #define NOTE_REST 1.00f |
| 21 | #endif // !__arm__ | 21 | // #endif // !__arm__ |
| 22 | 22 | ||
| 23 | #define UNICODE_SONG_OSX SONG(RICK_ROLL) | 23 | #define UNICODE_SONG_OSX SONG(RICK_ROLL) |
| 24 | #define UNICODE_SONG_LNX SONG(RICK_ROLL) | 24 | #define UNICODE_SONG_LNX SONG(RICK_ROLL) |
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 8019f2667..6968a4b92 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -144,9 +144,9 @@ void shutdown_user (void) { | |||
| 144 | rgblight_setrgb_red(); | 144 | rgblight_setrgb_red(); |
| 145 | #endif // RGBLIGHT_ENABLE | 145 | #endif // RGBLIGHT_ENABLE |
| 146 | #ifdef RGB_MATRIX_ENABLE | 146 | #ifdef RGB_MATRIX_ENABLE |
| 147 | uint16_t timer_start = timer_read(); | 147 | // uint16_t timer_start = timer_read(); |
| 148 | rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); | 148 | // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); |
| 149 | while(timer_elapsed(timer_start) < 250) { wait_ms(1); } | 149 | // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } |
| 150 | #endif //RGB_MATRIX_ENABLE | 150 | #endif //RGB_MATRIX_ENABLE |
| 151 | shutdown_keymap(); | 151 | shutdown_keymap(); |
| 152 | } | 152 | } |
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index ca55198e3..c19b18943 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h | |||
| @@ -53,11 +53,6 @@ enum userspace_layers { | |||
| 53 | /* | 53 | /* |
| 54 | define modifiers here, since MOD_* doesn't seem to work for these | 54 | define modifiers here, since MOD_* doesn't seem to work for these |
| 55 | */ | 55 | */ |
| 56 | #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | ||
| 57 | #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) | ||
| 58 | #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) | ||
| 59 | #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) | ||
| 60 | |||
| 61 | 56 | ||
| 62 | 57 | ||
| 63 | bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); | 58 | bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); |
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 73cad92f6..2d9025b37 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c | |||
| @@ -12,7 +12,6 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | |||
| 12 | return true; | 12 | return true; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | |||
| 16 | // 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 |
| 17 | // Then runs the _keymap's record handier if not processed here | 16 | // Then runs the _keymap's record handier if not processed here |
| 18 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 17 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| @@ -35,30 +34,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 35 | 34 | ||
| 36 | 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 |
| 37 | if (!record->event.pressed) { | 36 | if (!record->event.pressed) { |
| 38 | #if !defined(KEYBOARD_viterbi) | 37 | uint8_t temp_mod = get_mods(); |
| 39 | uint8_t temp_mod = get_mods(); | 38 | uint8_t temp_osm = get_oneshot_mods(); |
| 40 | uint8_t temp_osm = get_oneshot_mods(); | 39 | clear_mods(); clear_oneshot_mods(); |
| 41 | clear_mods(); clear_oneshot_mods(); | ||
| 42 | #endif | ||
| 43 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); | 40 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); |
| 44 | #if defined(KEYBOARD_viterbi) | 41 | #ifndef MAKE_BOOTLOADER |
| 45 | send_string_with_delay_P(PSTR(":dfu" SS_TAP(X_ENTER)), MACRO_TIMER); | 42 | if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) |
| 46 | #else | 43 | #endif |
| 47 | if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { | 44 | { |
| 48 | #if defined(__arm__) | 45 | #if defined(__arm__) |
| 49 | send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); | 46 | send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); |
| 50 | #elif defined(BOOTLOADER_DFU) | 47 | #elif defined(BOOTLOADER_DFU) |
| 51 | send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); | 48 | send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); |
| 52 | #elif defined(BOOTLOADER_HALFKAY) | 49 | #elif defined(BOOTLOADER_HALFKAY) |
| 53 | send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); | 50 | send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); |
| 54 | #elif defined(BOOTLOADER_CATERINA) | 51 | #elif defined(BOOTLOADER_CATERINA) |
| 55 | send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); | 52 | send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); |
| 56 | #endif // bootloader options | 53 | #endif // bootloader options |
| 57 | } | 54 | } |
| 58 | if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } | 55 | if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } |
| 59 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); | 56 | send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); |
| 60 | set_mods(temp_mod); | 57 | set_mods(temp_mod); |
| 61 | #endif | 58 | set_oneshot_mods(temp_osm); |
| 62 | } | 59 | } |
| 63 | break; | 60 | break; |
| 64 | 61 | ||
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 7eaa7e949..a98ad590c 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #if defined(RGBLIGHT_ENABLE) | 5 | #if defined(RGBLIGHT_ENABLE) |
| 6 | extern rgblight_config_t rgblight_config; | 6 | extern rgblight_config_t rgblight_config; |
| 7 | bool has_initialized; | ||
| 7 | #elif defined(RGB_MATRIX_ENABLE) | 8 | #elif defined(RGB_MATRIX_ENABLE) |
| 8 | extern rgb_config_t rgb_matrix_config; | 9 | extern rgb_config_t rgb_matrix_config; |
| 9 | #endif | 10 | #endif |
| @@ -17,7 +18,7 @@ void rgblight_sethsv_default_helper(uint8_t index) { | |||
| 17 | #ifdef INDICATOR_LIGHTS | 18 | #ifdef INDICATOR_LIGHTS |
| 18 | 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) { |
| 19 | if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { | 20 | if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { |
| 20 | if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { | 21 | if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) ) { |
| 21 | #ifdef SHFT_LED1 | 22 | #ifdef SHFT_LED1 |
| 22 | rgblight_sethsv_at(120, 255, 255, SHFT_LED1); | 23 | rgblight_sethsv_at(120, 255, 255, SHFT_LED1); |
| 23 | #endif // SHFT_LED1 | 24 | #endif // SHFT_LED1 |
| @@ -32,7 +33,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 32 | rgblight_sethsv_default_helper(SHFT_LED2); | 33 | rgblight_sethsv_default_helper(SHFT_LED2); |
| 33 | #endif // SHFT_LED2 | 34 | #endif // SHFT_LED2 |
| 34 | } | 35 | } |
| 35 | if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) { | 36 | if ( (this_mod | this_osm) & MOD_MASK_CTRL) { |
| 36 | #ifdef CTRL_LED1 | 37 | #ifdef CTRL_LED1 |
| 37 | rgblight_sethsv_at(0, 255, 255, CTRL_LED1); | 38 | rgblight_sethsv_at(0, 255, 255, CTRL_LED1); |
| 38 | #endif // CTRL_LED1 | 39 | #endif // CTRL_LED1 |
| @@ -47,7 +48,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 47 | rgblight_sethsv_default_helper(CTRL_LED2); | 48 | rgblight_sethsv_default_helper(CTRL_LED2); |
| 48 | #endif // CTRL_LED2 | 49 | #endif // CTRL_LED2 |
| 49 | } | 50 | } |
| 50 | if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) { | 51 | if ( (this_mod | this_osm) & MOD_MASK_GUI) { |
| 51 | #ifdef GUI_LED1 | 52 | #ifdef GUI_LED1 |
| 52 | rgblight_sethsv_at(51, 255, 255, GUI_LED1); | 53 | rgblight_sethsv_at(51, 255, 255, GUI_LED1); |
| 53 | #endif // GUI_LED1 | 54 | #endif // GUI_LED1 |
| @@ -62,7 +63,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 62 | rgblight_sethsv_default_helper(GUI_LED2); | 63 | rgblight_sethsv_default_helper(GUI_LED2); |
| 63 | #endif // GUI_LED2 | 64 | #endif // GUI_LED2 |
| 64 | } | 65 | } |
| 65 | if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) { | 66 | if ( (this_mod | this_osm) & MOD_MASK_ALT) { |
| 66 | #ifdef ALT_LED1 | 67 | #ifdef ALT_LED1 |
| 67 | rgblight_sethsv_at(240, 255, 255, ALT_LED1); | 68 | rgblight_sethsv_at(240, 255, 255, ALT_LED1); |
| 68 | #endif // ALT_LED1 | 69 | #endif // ALT_LED1 |
| @@ -81,7 +82,9 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { | |||
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | void matrix_scan_indicator(void) { | 84 | void matrix_scan_indicator(void) { |
| 84 | set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); | 85 | if (has_initialized) { |
| 86 | set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); | ||
| 87 | } | ||
| 85 | } | 88 | } |
| 86 | #endif //INDICATOR_LIGHTS | 89 | #endif //INDICATOR_LIGHTS |
| 87 | 90 | ||
| @@ -244,22 +247,16 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { | |||
| 244 | 247 | ||
| 245 | 248 | ||
| 246 | void keyboard_post_init_rgb(void) { | 249 | void keyboard_post_init_rgb(void) { |
| 247 | |||
| 248 | #ifdef RGBLIGHT_ENABLE | 250 | #ifdef RGBLIGHT_ENABLE |
| 249 | if (userspace_config.rgb_layer_change) { | 251 | rgblight_enable_noeeprom(); |
| 250 | rgblight_enable_noeeprom(); | 252 | layer_state_set_user(layer_state); |
| 251 | switch (biton32(eeconfig_read_default_layer())) { | 253 | uint16_t old_hue = rgblight_config.hue; |
| 252 | case _COLEMAK: | 254 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); |
| 253 | rgblight_sethsv_noeeprom_magenta(); break; | 255 | for (uint16_t i = 360; i > 0; i--) { |
| 254 | case _DVORAK: | 256 | rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); |
| 255 | rgblight_sethsv_noeeprom_springgreen(); break; | 257 | wait_ms(10); |
| 256 | case _WORKMAN: | 258 | } |
| 257 | rgblight_sethsv_noeeprom_goldenrod(); break; | 259 | layer_state_set_user(layer_state); |
| 258 | default: | ||
| 259 | rgblight_sethsv_noeeprom_cyan(); break; | ||
| 260 | } | ||
| 261 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 262 | } | ||
| 263 | #endif | 260 | #endif |
| 264 | } | 261 | } |
| 265 | 262 | ||
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 6d8612e71..5050704a5 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk | |||
| @@ -42,3 +42,7 @@ ifdef CONSOLE_ENABLE | |||
| 42 | OPT_DEFS += -DKEYLOGGER_ENABLE | 42 | OPT_DEFS += -DKEYLOGGER_ENABLE |
| 43 | endif | 43 | endif |
| 44 | endif | 44 | endif |
| 45 | |||
| 46 | ifeq ($(strip $(MAKE_BOOTLOADER)), yes) | ||
| 47 | OPT_DEFS += -DMAKE_BOOTLOADER | ||
| 48 | endif | ||
