From 493fbb3dc1423e0d42e57a6dc7ba38b880b37eb5 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 15 Mar 2019 08:57:44 -0700 Subject: [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 --- users/drashna/config.h | 8 ++++---- users/drashna/drashna.c | 6 +++--- users/drashna/drashna.h | 5 ----- users/drashna/process_records.c | 45 +++++++++++++++++++---------------------- users/drashna/rgb_stuff.c | 37 ++++++++++++++++----------------- users/drashna/rules.mk | 4 ++++ 6 files changed, 49 insertions(+), 56 deletions(-) (limited to 'users') 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 @@ // #ifdef RGBLIGHT_ENABLE // #define NO_MUSIC_MODE // #endif //RGBLIGHT_ENABLE/ - #ifndef __arm__ - #undef NOTE_REST - #define NOTE_REST 1.00f - #endif // !__arm__ + // #ifndef __arm__ + // #undef NOTE_REST + // #define NOTE_REST 1.00f + // #endif // !__arm__ #define UNICODE_SONG_OSX SONG(RICK_ROLL) #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) { rgblight_setrgb_red(); #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE - uint16_t timer_start = timer_read(); - rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); - while(timer_elapsed(timer_start) < 250) { wait_ms(1); } + // uint16_t timer_start = timer_read(); + // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); + // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } #endif //RGB_MATRIX_ENABLE shutdown_keymap(); } 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 { /* define modifiers here, since MOD_* doesn't seem to work for these */ -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - 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) { return true; } - // Defines actions tor my global custom keycodes. Defined in drashna.h file // Then runs the _keymap's record handier if not processed here bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -35,30 +34,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { - #if !defined(KEYBOARD_viterbi) - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - clear_mods(); clear_oneshot_mods(); - #endif + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); clear_oneshot_mods(); send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); - #if defined(KEYBOARD_viterbi) - send_string_with_delay_P(PSTR(":dfu" SS_TAP(X_ENTER)), MACRO_TIMER); - #else - if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { - #if defined(__arm__) - send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); - #endif // bootloader options - } - if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); - set_mods(temp_mod); - #endif +#ifndef MAKE_BOOTLOADER + if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) +#endif + { + #if defined(__arm__) + send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); + #endif // bootloader options + } + if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); + set_mods(temp_mod); + set_oneshot_mods(temp_osm); } break; 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 @@ #if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; +bool has_initialized; #elif defined(RGB_MATRIX_ENABLE) extern rgb_config_t rgb_matrix_config; #endif @@ -17,7 +18,7 @@ void rgblight_sethsv_default_helper(uint8_t index) { #ifdef INDICATOR_LIGHTS void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { - if (this_mod & MODS_SHIFT_MASK || this_led & (1< 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); + wait_ms(10); + } + layer_state_set_user(layer_state); #endif } 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 OPT_DEFS += -DKEYLOGGER_ENABLE endif endif + +ifeq ($(strip $(MAKE_BOOTLOADER)), yes) + OPT_DEFS += -DMAKE_BOOTLOADER +endif -- cgit v1.2.3-24-g4f1b