From b2877470ced1deb9651ecb39f6a82f5ef380b399 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 16 Jul 2018 18:04:32 -0700 Subject: Update to drashna userspace and keymaps (#3172) * Use string with delay * Add skipped region to ergodox * Add send string config * Use default_layer_state instead of function * Fully generalize keyboards * old iris cleanup * Fix Drashna keymap compile issues By checking to see if secret.c exists before actually trying to add it * Remove unnecessary references * Add 4x12 ortho board * Update userspace readme for secrets * Make RGB more modular * Fix iris keymap, since we don't need the lower left (Function keys) * Fix includes * Add Blanks * Fix Ergodox lower layer * Add suspend commands * Add Maltron Layout * Add additional layouts * Finish adding gamepad to Iris * Tweaks to iris gamepag layer * make gaming layers more friendly * minor gaming layer tweak * Add Carplax * Add modded key timer function * Cleanup and macro documentation * Add QMK DFU info * Add 'old' keymap for 12 LED spare * Update Pro Micro documentation * Disable twinkling so it fits in firmware space * Switch to QMK DFU bootloader, since it's better anyhow * Write default layer state colors to EEPROM Since we are writing to EEPROM anyways, and this way, it sticks on reboot * Fix QMK DFU bootloader options * More updates for QMK DFU support * Use matrix scanning hack for startup_user until #3113 gets merged * Fix indicator light consistency issue * Add/readd ifdefs to indicators * Add/readd alt indicator * Remove RGB Twinkling from Viterbi macro pad * Fix default layer color detection * Fix rebase and detection issues * Cleanup code so it will compile if RGBLIGHT is disabled * Revert vsode settings * Use Pragma Once instead of boilerplate code --- users/drashna/config.h | 6 +- users/drashna/drashna.c | 96 +++++++++++++++++++++++++++--- users/drashna/drashna.h | 138 ++++++++++++++++++++++++++++++++++--------- users/drashna/readme.md | 94 +++++++++++++++++++---------- users/drashna/rgb_stuff.c | 147 ++++++++++++++++++++++++++++++++++++---------- users/drashna/rules.mk | 9 ++- 6 files changed, 388 insertions(+), 102 deletions(-) (limited to 'users') diff --git a/users/drashna/config.h b/users/drashna/config.h index 26c989d7f5..87050fbcc7 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -1,5 +1,4 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H +#pragma once #ifdef AUDIO_ENABLE @@ -71,5 +70,6 @@ #define DISABLE_LEADER -#endif // !USERSPACE_CONFIG_H +#define MACRO_TIMER 5 + diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 8efd99f805..f72902f0b0 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -38,7 +38,7 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { clear_keyboard(); tap(userspace_config.is_overwatch ? KC_BSPC : KC_ENTER); wait_ms(50); - send_string(str); + send_string_with_delay(str, MACRO_TIMER); wait_ms(50); tap(KC_ENTER); } @@ -48,6 +48,40 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; +bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { + static uint16_t this_timer; + if(pressed) { + this_timer= timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM){ + register_code(code); + unregister_code(code); + } else { + register_code(mod_code); + register_code(code); + unregister_code(code); + unregister_code(mod_code); + } + } + return false; +} + +bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { + if(pressed) { + this_timer= timer_read(); + } else { + if (timer_elapsed(this_timer) < TAPPING_TERM){ + register_code(code); + unregister_code(code); + } else { + register_code(mod_code); + register_code(code); + unregister_code(code); + unregister_code(mod_code); + } + } + return false; +} // Add reconfigurable functions here, for keymap customization // This allows for a global, userspace functions, and continued @@ -56,6 +90,15 @@ void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; __attribute__ ((weak)) void matrix_init_keymap(void) {} +__attribute__ ((weak)) +void startup_keymap(void) {} + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + __attribute__ ((weak)) void matrix_scan_keymap(void) {} @@ -69,11 +112,17 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } + __attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { return state; } +__attribute__ ((weak)) +uint32_t default_layer_state_set_keymap (uint32_t state) { + return state; +} + __attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} @@ -99,14 +148,38 @@ void matrix_init_user(void) { #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) set_unicode_input_mode(UC_WINC); #endif //UNICODE_ENABLE - matrix_init_rgb(); matrix_init_keymap(); } +void startup_user (void) { + #ifdef RGBLIGHT_ENABLE + matrix_init_rgb(); + #endif //RGBLIGHT_ENABLE + startup_keymap(); +} + +void suspend_power_down_user(void) +{ + suspend_power_down_keymap(); +} + +void suspend_wakeup_init_user(void) +{ + suspend_wakeup_init_keymap(); + #ifdef KEYBOARD_ergodox_ez + wait_ms(10); + #endif +} + // No global matrix scan code, so just run keymap's matrix // scan function void matrix_scan_user(void) { + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + startup_user(); + } #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. run_diablo_macro_check(); @@ -160,7 +233,7 @@ 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) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) ":dfu" #elif defined(BOOTLOADER_HALFKAY) @@ -168,7 +241,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #elif defined(BOOTLOADER_CATERINA) ":avrdude" #endif // bootloader options - SS_TAP(X_ENTER)); + SS_TAP(X_ENTER)), 10); } return false; break; @@ -197,7 +270,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case VRSN: // Prints firmware version if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE); + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); } return false; break; @@ -256,7 +329,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { diablo_key_time[dtime] = diablo_times[0]; } } -#endif // TAP_DANCE_ENABLE#endif +#endif // TAP_DANCE_ENABLE return false; break; @@ -314,7 +387,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif // UNICODE_ENABLE } - return process_record_keymap(keycode, record) && process_record_secrets(keycode, record) && process_record_user_rgb(keycode, record); + return process_record_keymap(keycode, record) && +#ifdef RGBLIGHT_ENABLE + process_record_user_rgb(keycode, record) && +#endif // RGBLIGHT_ENABLE + process_record_secrets(keycode, record); } @@ -331,6 +408,11 @@ uint32_t layer_state_set_user(uint32_t state) { } +uint32_t default_layer_state_set_kb(uint32_t state) { + return default_layer_state_set_keymap (state); +} + + // Any custom LED code goes here. // So far, I only have keyboard specific code, // So nothing goes here. diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index e035b86fbf..3efef57046 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -19,6 +19,7 @@ along with this program. If not, see . #define USERSPACE #include "quantum.h" + // Define layer names enum userspace_layers { _QWERTY = 0, @@ -53,8 +54,8 @@ void rgblight_sethsv_default_helper(uint8_t index); #endif // RGBLIGHT_ENABLE void tap(uint16_t keycode); -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); - +bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); +bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); #define EECONFIG_USERSPACE (uint8_t *)19 @@ -69,15 +70,15 @@ typedef union { } userspace_config_t; enum userspace_custom_keycodes { - EPRM = SAFE_RANGE, // can always be here - VRSN, - KC_QWERTY, - KC_COLEMAK, - KC_DVORAK, - KC_WORKMAN, - KC_DIABLO_CLEAR, - KC_OVERWATCH, - KC_SALT, + EPRM = SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) + VRSN, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + KC_COLEMAK, // Sets default layer to COLEMAK + KC_DVORAK, // Sets default layer to DVORAK + KC_WORKMAN, // Sets default layer to WORKMAN + KC_DIABLO_CLEAR, // Clears all Diablo Timers + KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) + KC_SALT, // See drashna.c for details KC_MORESALT, KC_SALTHARD, KC_GOODGAME, @@ -88,27 +89,28 @@ enum userspace_custom_keycodes { KC_AIM, KC_C9, KC_GGEZ, - KC_MAKE, - KC_RESET, - KC_RGB_T, - KC_SECRET_1, - KC_SECRET_2, - KC_SECRET_3, - KC_SECRET_4, - KC_SECRET_5, - KC_CCCV, - KC_NUKE, + KC_MAKE, // Run keyboard's customized make command + KC_RESET, // Resets keyboard, with red underglow + KC_RGB_T, // Toggles RGB Layer Indication mode + KC_SECRET_1, // test1 + KC_SECRET_2, // test2 + KC_SECRET_3, // test3 + KC_SECRET_4, // test4 + KC_SECRET_5, // test5 + KC_CCCV, // Hold to copy, tap to paste + KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! #ifdef UNICODE_ENABLE - UC_FLIP, + UC_FLIP, // Table flip (not working?) #endif //UNICODE_ENABLE - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes }; #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) #define ADJUST MO(_ADJUST) - +#define TG_MODS TG(_MODS) +#define TG_GAME TG(_GAMEPAD) #define KC_SEC1 KC_SECRET_1 #define KC_SEC2 KC_SECRET_2 @@ -184,7 +186,7 @@ enum { #define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) - +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) // Blocks for each of the four major keyboard layouts // Organized so we can quickly adapt and modify all of them @@ -237,7 +239,7 @@ enum { #define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN #define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) #define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K @@ -248,11 +250,89 @@ enum { #define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U #define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + +#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B +#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F +#define _________________MALTRON_L3________________ CTL_T(KC_SCLN), KC_SLSH, KC_J KC_G, KC_COMM + +#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L +#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, CTL_T(KC_x) + + +#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q +#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U +#define _________________EUCALYN_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_W + +#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P +#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, CTL_T(KC_SCLN) + + +#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W +#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QFMLWY_L3_____________ CTL_T(KC_Z), KC_V, KC_G, KC_C, KC_X + +#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J +#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, CTL_T(KC_SLSH) + + +#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWB_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_F, KC_J + +#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN +#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH) + + +#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWY_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_J + +#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN +#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH) + + #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 #define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 #define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 #define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ + + +#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ +#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ + +#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN +#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR +#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + + + +#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ +#define _________________RAISE_L2__________________ ___________________BLANK___________________ +#define _________________RAISE_L3__________________ ___________________BLANK___________________ + +#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ +#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC +#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + + + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT + + // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN), // this allows us to quickly modify the bottom row for all of the layouts // so we don't have to alter it 4 times and hope that we haven't missed @@ -261,7 +341,11 @@ enum { #define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ +#define ___________ORTHODOX_THUMP_TOP_____________ ALT_APP, OS_LGUI, KC_LALT, OS_RGUI +#define ___________________ORTHODOX_THUMB_BOTTOM____________________ LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE + + +#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ KC_HOME, KC_PGUP, \ LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) diff --git a/users/drashna/readme.md b/users/drashna/readme.md index 0aa73ece90..179960322a 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -75,11 +75,12 @@ For critics that think this is cheating, search "diablo 3 num lock auto cast". Secret Macros ------------- -With help from gitter and Colinta, this adds the ability to add hidden strings to be used for macros. +With help from gitter and Colinta, this adds the ability to add hidden macros from other users. -I have a number of long strings that I need to use that are semi-private. This uses the `__has_include` function to check for the file. If it exists, then it includes the custom text. Otherwise, it uses some default values. +First, I have several files that are hidden/excluded from Git/GitHub. These contain everything needed for the macros. To hide these files, open `.git/info/exclude` and add `secrets.c` and `secrets.h` to that file, below the comments. + +And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `.h` file to define the keycodes for the new macros. -If you would *also* like to take advantage of this feature, you'll first want to make sure your "secrets" file isn't included in the repo. Open `.git/info/exclude` and add `secrets.h` to that file, below the comments. ###### .git/info/exclude ``` @@ -89,10 +90,44 @@ If you would *also* like to take advantage of this feature, you'll first want to # exclude patterns (uncomment them if you want to use them): # *.[oa] # *~ +/users/drashna/secrets.c /users/drashna/secrets.h ``` -Then you can create this file and add your macro strings to it: +Then you can create these files: + +###### secrets.c + +```c +#include "drashna.h" // replace with your keymap's "h" file, or whatever file stores the keycodes + +#if (__has_include("secrets.h") && !defined(NO_SECRETS)) +#include "secrets.h" +#else +// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware +// And I'm not familiar enough to know which is better or why... +static const char * const secret[] = { + "test1", + "test2", + "test3", + "test4", + "test5" +}; +#endif + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo + if (!record->event.pressed) { + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER); + } + return false; + break; + } + return true; +} +``` ###### secrets.h ```c @@ -107,36 +142,33 @@ static const char * const secrets[] = { Replacing the strings with the codes that you need. +###### name.c + In the `.c` file, you will want to add this to the top: ```c - -#if (__has_include("secrets.h") && !defined(NO_SECRETS)) -#include "secrets.h" -#else -// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware -// And I'm not familiar enough to know which is better or why... -static const char * const secrets[] = { - "test1", - "test2", - "test3", - "test4", - "test5" -}; -#endif +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} ``` +This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. + -And then, in the `process_record_user` function, you'll want to add this block: +And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` ```c - case KC_SECRET_1 ... KC_SECRET_5: - if (!record->event.pressed) { - send_string_P(secret[keycode - KC_SECRET_1]); - } - return false; - break; + return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); +} ``` -And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `.h` file fo the new macros, as well. +###### rules.mk + +Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. To do so, add this block: +```c +ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c +endif +``` Additionally, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: ```c @@ -181,15 +213,15 @@ Pro Micro Hacking Well, you can get the QMK DFU bootloader working on the ProMicro. But you need to change fuses. -What worked to get into the firmware properly was: +What worked to get into the firmware properly was: ``` -Low: 0x5E High: 0x99 Extended: 0xF3 Lock: 0xFF +Low: 0x5E High: 0xD9 Extended: 0xC3 Lock: 0x3F ``` -But some of the columns and rows didn't work, like the pin mapping was wrong. Even when setting the bootloader settings. - - This is here for future reference. And the default fuse settings I believe were: +The reason that there was some issues before, is that JTAG was still enabled, and using some of the pins that the keyboard uses. Disabling JTAG (either by fuse, or modifying the matrix code for splits fixes the issue). + +And for reference, if you want to go back to caterina, the default fuse settings I believe were: ``` Low: 0xFF High: 0xD8 Extended: 0xC3 Lock: 0x3F diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index af7190cc3e..f2a9a47a90 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -1,5 +1,6 @@ #include "drashna.h" #include "rgb_stuff.h" +#include "eeprom.h" extern rgblight_config_t rgblight_config; extern userspace_config_t userspace_config; @@ -22,25 +23,64 @@ uint8_t current_osm; 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<