[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
This commit is contained in:
parent
e0a03bfa6c
commit
493fbb3dc1
22 changed files with 246 additions and 91 deletions
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) {
|
||||
if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) ) {
|
||||
#ifdef SHFT_LED1
|
||||
rgblight_sethsv_at(120, 255, 255, SHFT_LED1);
|
||||
#endif // SHFT_LED1
|
||||
|
@ -32,7 +33,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
|
|||
rgblight_sethsv_default_helper(SHFT_LED2);
|
||||
#endif // SHFT_LED2
|
||||
}
|
||||
if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) {
|
||||
if ( (this_mod | this_osm) & MOD_MASK_CTRL) {
|
||||
#ifdef CTRL_LED1
|
||||
rgblight_sethsv_at(0, 255, 255, CTRL_LED1);
|
||||
#endif // CTRL_LED1
|
||||
|
@ -47,7 +48,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
|
|||
rgblight_sethsv_default_helper(CTRL_LED2);
|
||||
#endif // CTRL_LED2
|
||||
}
|
||||
if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) {
|
||||
if ( (this_mod | this_osm) & MOD_MASK_GUI) {
|
||||
#ifdef GUI_LED1
|
||||
rgblight_sethsv_at(51, 255, 255, GUI_LED1);
|
||||
#endif // GUI_LED1
|
||||
|
@ -62,7 +63,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
|
|||
rgblight_sethsv_default_helper(GUI_LED2);
|
||||
#endif // GUI_LED2
|
||||
}
|
||||
if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) {
|
||||
if ( (this_mod | this_osm) & MOD_MASK_ALT) {
|
||||
#ifdef ALT_LED1
|
||||
rgblight_sethsv_at(240, 255, 255, ALT_LED1);
|
||||
#endif // ALT_LED1
|
||||
|
@ -81,7 +82,9 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
|
|||
}
|
||||
|
||||
void matrix_scan_indicator(void) {
|
||||
set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
|
||||
if (has_initialized) {
|
||||
set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
|
||||
}
|
||||
}
|
||||
#endif //INDICATOR_LIGHTS
|
||||
|
||||
|
@ -244,22 +247,16 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
|||
|
||||
|
||||
void keyboard_post_init_rgb(void) {
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
rgblight_enable_noeeprom();
|
||||
switch (biton32(eeconfig_read_default_layer())) {
|
||||
case _COLEMAK:
|
||||
rgblight_sethsv_noeeprom_magenta(); break;
|
||||
case _DVORAK:
|
||||
rgblight_sethsv_noeeprom_springgreen(); break;
|
||||
case _WORKMAN:
|
||||
rgblight_sethsv_noeeprom_goldenrod(); break;
|
||||
default:
|
||||
rgblight_sethsv_noeeprom_cyan(); break;
|
||||
}
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
}
|
||||
rgblight_enable_noeeprom();
|
||||
layer_state_set_user(layer_state);
|
||||
uint16_t old_hue = rgblight_config.hue;
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
for (uint16_t i = 360; i > 0; i--) {
|
||||
rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255);
|
||||
wait_ms(10);
|
||||
}
|
||||
layer_state_set_user(layer_state);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -42,3 +42,7 @@ ifdef CONSOLE_ENABLE
|
|||
OPT_DEFS += -DKEYLOGGER_ENABLE
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(MAKE_BOOTLOADER)), yes)
|
||||
OPT_DEFS += -DMAKE_BOOTLOADER
|
||||
endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue