aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-07-16 18:04:32 -0700
committerJack Humbert <jack.humb@gmail.com>2018-07-16 21:04:32 -0400
commitb2877470ced1deb9651ecb39f6a82f5ef380b399 (patch)
treeba4c9e0a9c86526cf4bc002b732be0dce37acd5b
parente0c9cfad86a7c17863db08574472e866aa3d37b7 (diff)
downloadqmk_firmware-b2877470ced1deb9651ecb39f6a82f5ef380b399.tar.gz
qmk_firmware-b2877470ced1deb9651ecb39f6a82f5ef380b399.zip
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
-rw-r--r--keyboards/iris/keymaps/drashna/config.h14
-rw-r--r--keyboards/iris/keymaps/drashna/keymap.c50
-rw-r--r--keyboards/iris/keymaps/drashna/rules.mk2
-rw-r--r--keyboards/iris/keymaps/drashna_old/config.h8
-rw-r--r--keyboards/iris/keymaps/drashna_old/keymap.c90
-rw-r--r--keyboards/iris/keymaps/drashna_old/rules.mk4
-rw-r--r--keyboards/orthodox/keymaps/drashna/config.h14
-rw-r--r--keyboards/orthodox/keymaps/drashna/keymap.c56
-rw-r--r--keyboards/orthodox/keymaps/drashna/rules.mk2
-rw-r--r--keyboards/viterbi/keymaps/drashna/config.h11
-rw-r--r--keyboards/viterbi/keymaps/drashna/keymap.c13
-rw-r--r--keyboards/viterbi/keymaps/drashna/rules.mk3
-rw-r--r--keyboards/viterbi/keymaps/drashna_old/config.h86
-rw-r--r--keyboards/viterbi/keymaps/drashna_old/keymap.c1
-rw-r--r--keyboards/viterbi/keymaps/drashna_old/rules.mk28
-rw-r--r--layouts/community/ergodox/drashna/config.h7
-rw-r--r--layouts/community/ergodox/drashna/keymap.c43
-rw-r--r--layouts/community/ergodox/drashna/rules.mk5
-rw-r--r--layouts/community/ortho_4x12/drashna/config.h56
-rw-r--r--layouts/community/ortho_4x12/drashna/keymap.c177
-rw-r--r--layouts/community/ortho_4x12/drashna/readme.md2
-rw-r--r--layouts/community/ortho_4x12/drashna/rules.mk20
-rw-r--r--users/drashna/config.h6
-rw-r--r--users/drashna/drashna.c96
-rw-r--r--users/drashna/drashna.h138
-rw-r--r--users/drashna/readme.md94
-rw-r--r--users/drashna/rgb_stuff.c147
-rw-r--r--users/drashna/rules.mk9
28 files changed, 882 insertions, 300 deletions
diff --git a/keyboards/iris/keymaps/drashna/config.h b/keyboards/iris/keymaps/drashna/config.h
index d2c112923..47276845f 100644
--- a/keyboards/iris/keymaps/drashna/config.h
+++ b/keyboards/iris/keymaps/drashna/config.h
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef CONFIG_USER_H 18#pragma once
19#define CONFIG_USER_H
20
21#include "config_common.h"
22 19
23/* Use I2C or Serial, not both */ 20/* Use I2C or Serial, not both */
24 21
@@ -52,6 +49,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
52#endif //RGBLIGHT_ENABLE 49#endif //RGBLIGHT_ENABLE
53#endif //AUDIO_ENABLE 50#endif //AUDIO_ENABLE
54 51
52#define QMK_ESC_OUTPUT F6 // usually COL
53#define QMK_ESC_INPUT D7 // usually ROW
54#define QMK_LED B0
55#define QMK_SPEAKER C6
55 56
56#undef PRODUCT 57#undef PRODUCT
57#ifdef KEYBOARD_iris_rev2 58#ifdef KEYBOARD_iris_rev2
@@ -64,7 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
64#define CTRL_LED1 7 65#define CTRL_LED1 7
65#define CTRL_LED2 10 66#define CTRL_LED2 10
66 67
67#define GUI_LED1 8 68#define ALT_LED1 8
68#define GUI_LED2 9 69#define GUI_LED1 9
69 70
70#endif
diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c
index bc3cd38ad..70d13cac2 100644
--- a/keyboards/iris/keymaps/drashna/keymap.c
+++ b/keyboards/iris/keymaps/drashna/keymap.c
@@ -43,47 +43,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
43 _______, _______, _______, _______, _______, _______ 43 _______, _______, _______, _______, _______, _______
44 ), 44 ),
45 45
46 [_GAMEPAD] = LAYOUT_wrapper(
47 KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_P, _______, _______, _______, _______, _______, _______,
48 KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______,
49 KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______,
50 KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, TG_GAME, _______, _______, _______, _______, _______, _______, _______,
51 LOWER, KC_V, KC_SPC, _______, _______, _______
52 ),
53
46 54
47 [_LOWER] = LAYOUT_wrapper( 55 [_LOWER] = LAYOUT_wrapper(
48 _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, 56 _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______,
49 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, 57 KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______,
50 _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, 58 _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE,
51 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, 59 _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, _______,
52 _______, _______, _______, _______, _______, _______ 60 _______, _______, _______, _______, _______, _______
53 ), 61 ),
54 62
55 [_RAISE] = LAYOUT_wrapper( 63 [_RAISE] = LAYOUT_wrapper(
56 _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, 64 _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______,
57 KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, _______, 65 KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______,
58 _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, 66 _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
59 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, 67 _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, _______,
60 _______, _______, _______, _______, _______, _______ 68 _______, _______, _______, _______, _______, _______
61 ), 69 ),
62 70
63 [_ADJUST] = LAYOUT_wrapper( 71 [_ADJUST] = LAYOUT_wrapper(
64 KC_MAKE, _______, _______, _______, _______, _______, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RST, 72 KC_MAKE, _______, _______, _______, _______, _______, _________________ADJUST_R1_________________, KC_RST,
65 VRSN, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, KC_NUKE, _______, _______, _______, _______, EPRM, 73 VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EPRM,
66 _______, _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, TG(_MODS), 74 _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS,
67 _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, 75 _______, _________________ADJUST_L3_________________, TG_GAME, _______, _________________ADJUST_R3_________________, KC_MPLY,
68 _______, _______, _______, _______, _______, _______ 76 _______, _______, _______, _______, _______, _______
69 ) 77 )
70 78
71}; 79};
72 80
73 81
74bool indicator_is_this_led_used(uint8_t index) { 82void matrix_init_keymap(void) {
75 switch (index) { 83 DDRD &= ~(1<<5);
76#ifdef INDICATOR_LIGHTS 84 PORTD &= ~(1<<5);
77 case SHFT_LED1: 85
78 case SHFT_LED2: 86 DDRB &= ~(1<<0);
79 case CTRL_LED1: 87 PORTB &= ~(1<<0);
80 case CTRL_LED2:
81 case GUI_LED1:
82 case GUI_LED2:
83 return true;
84 break;
85#endif
86 default:
87 return false;
88 }
89} 88}
89
diff --git a/keyboards/iris/keymaps/drashna/rules.mk b/keyboards/iris/keymaps/drashna/rules.mk
index 1b2604239..ccc33c06f 100644
--- a/keyboards/iris/keymaps/drashna/rules.mk
+++ b/keyboards/iris/keymaps/drashna/rules.mk
@@ -13,3 +13,5 @@ SWAP_HANDS_ENABLE = no
13INDICATOR_LIGHTS = yes 13INDICATOR_LIGHTS = yes
14MACROS_ENABLED = no 14MACROS_ENABLED = no
15RGBLIGHT_TWINKLE = yes 15RGBLIGHT_TWINKLE = yes
16
17BOOTLOADER = qmk-dfu
diff --git a/keyboards/iris/keymaps/drashna_old/config.h b/keyboards/iris/keymaps/drashna_old/config.h
index 4eec67148..6152ca5b6 100644
--- a/keyboards/iris/keymaps/drashna_old/config.h
+++ b/keyboards/iris/keymaps/drashna_old/config.h
@@ -52,6 +52,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
52#endif //RGBLIGHT_ENABLE 52#endif //RGBLIGHT_ENABLE
53#endif //AUDIO_ENABLE 53#endif //AUDIO_ENABLE
54 54
55#define QMK_ESC_OUTPUT F6 // usually COL
56#define QMK_ESC_INPUT D7 // usually ROW
57#define QMK_LED B0
58#define QMK_SPEAKER C6
55 59
56#undef PRODUCT 60#undef PRODUCT
57#ifdef KEYBOARD_iris_rev2 61#ifdef KEYBOARD_iris_rev2
@@ -64,7 +68,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
64#define CTRL_LED1 6 68#define CTRL_LED1 6
65#define CTRL_LED2 9 69#define CTRL_LED2 9
66 70
67#define GUI_LED1 7 71#define ALT_LED1 7
68#define GUI_LED2 8 72#define GUI_LED1 8
69 73
70#endif 74#endif
diff --git a/keyboards/iris/keymaps/drashna_old/keymap.c b/keyboards/iris/keymaps/drashna_old/keymap.c
index bc3cd38ad..ff7bd09c0 100644
--- a/keyboards/iris/keymaps/drashna_old/keymap.c
+++ b/keyboards/iris/keymaps/drashna_old/keymap.c
@@ -1,89 +1 @@
1 // placeholder
2#include QMK_KEYBOARD_H
3#include "drashna.h"
4
5#define KC_ALAP ALT_T(KC_APP)
6#define KC_OSLG OSM(MOD_LGUI)
7const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
8
9 [_QWERTY] = LAYOUT_wrapper(
10 KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
11 KC_TAB , _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS,
12 KC_CCCV, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
13 KC_MLSF, _________________QWERTY_L3_________________, KC_ALAP, KC_OSLG, _________________QWERTY_R3_________________, KC_MRSF,
14 LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
15 ),
16 [_COLEMAK] = LAYOUT_wrapper(
17 KC_ESC , ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
18 KC_TAB , _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSLS,
19 KC_CCCV, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT,
20 KC_MLSF, _________________COLEMAK_L3________________, KC_ALAP, KC_OSLG, _________________COLEMAK_R3________________, KC_MRSF,
21 LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
22 ),
23 [_DVORAK] = LAYOUT_wrapper(
24 KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
25 KC_TAB , _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSLS,
26 KC_CCCV, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_QUOT,
27 KC_MLSF, _________________DVORAK_L3_________________, KC_ALAP, KC_OSLG, _________________DVORAK_R3_________________, KC_MRSF,
28 LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
29 ),
30 [_WORKMAN] = LAYOUT_wrapper(
31 KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
32 KC_TAB , _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSLS,
33 KC_CCCV, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
34 KC_MLSF, _________________WORKMAN_L3________________, KC_ALAP, KC_OSLG, _________________WORKMAN_R3________________, KC_MRSF,
35 LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
36 ),
37
38 [_MODS] = LAYOUT_wrapper(
39 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
40 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
41 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
42 KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,
43 _______, _______, _______, _______, _______, _______
44 ),
45
46
47 [_LOWER] = LAYOUT_wrapper(
48 _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______,
49 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
50 _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
51 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______,
52 _______, _______, _______, _______, _______, _______
53 ),
54
55 [_RAISE] = LAYOUT_wrapper(
56 _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______,
57 KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, _______,
58 _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
59 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______,
60 _______, _______, _______, _______, _______, _______
61 ),
62
63 [_ADJUST] = LAYOUT_wrapper(
64 KC_MAKE, _______, _______, _______, _______, _______, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RST,
65 VRSN, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, KC_NUKE, _______, _______, _______, _______, EPRM,
66 _______, _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, TG(_MODS),
67 _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY,
68 _______, _______, _______, _______, _______, _______
69 )
70
71};
72
73
74bool indicator_is_this_led_used(uint8_t index) {
75 switch (index) {
76#ifdef INDICATOR_LIGHTS
77 case SHFT_LED1:
78 case SHFT_LED2:
79 case CTRL_LED1:
80 case CTRL_LED2:
81 case GUI_LED1:
82 case GUI_LED2:
83 return true;
84 break;
85#endif
86 default:
87 return false;
88 }
89}
diff --git a/keyboards/iris/keymaps/drashna_old/rules.mk b/keyboards/iris/keymaps/drashna_old/rules.mk
index 1a6b63f16..f6ec9d1e5 100644
--- a/keyboards/iris/keymaps/drashna_old/rules.mk
+++ b/keyboards/iris/keymaps/drashna_old/rules.mk
@@ -15,3 +15,7 @@ SWAP_HANDS_ENABLE = no
15INDICATOR_LIGHTS = yes 15INDICATOR_LIGHTS = yes
16MACROS_ENABLED = no 16MACROS_ENABLED = no
17RGBLIGHT_TWINKLE = yes 17RGBLIGHT_TWINKLE = yes
18
19SRC += ../drashna/keymap.c
20
21BOOTLOADER = qmk-dfu
diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h
index 8c283e7ca..d8ff95fcb 100644
--- a/keyboards/orthodox/keymaps/drashna/config.h
+++ b/keyboards/orthodox/keymaps/drashna/config.h
@@ -19,10 +19,7 @@ You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>. 19along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/ 20*/
21 21
22#ifndef CONFIG_USER_H 22#pragma once
23#define CONFIG_USER_H
24
25#include QMK_KEYBOARD_CONFIG_H
26 23
27/* Use I2C or Serial, not both */ 24/* Use I2C or Serial, not both */
28 25
@@ -72,7 +69,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
72#endif 69#endif
73 70
74#define QMK_ESC_OUTPUT D7 // usually COL 71#define QMK_ESC_OUTPUT D7 // usually COL
72#ifdef KEYBOARD_orthodox_rev1
75#define QMK_ESC_INPUT D4 // usually ROW 73#define QMK_ESC_INPUT D4 // usually ROW
74#else
75#define QMK_ESC_INPUT D2 // usually ROW
76#endif
76#define QMK_LED B0 77#define QMK_LED B0
77#define QMK_SPEAKER C6 78#define QMK_SPEAKER C6
78 79
@@ -83,7 +84,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
83#define CTRL_LED1 6 84#define CTRL_LED1 6
84#define CTRL_LED2 9 85#define CTRL_LED2 9
85 86
86#define GUI_LED1 7 87#define GUI_LED1 8
87#define GUI_LED2 8 88#define ALT_LED1 7
88 89
89#endif
diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c
index c65e21cb0..67f732c12 100644
--- a/keyboards/orthodox/keymaps/drashna/keymap.c
+++ b/keyboards/orthodox/keymaps/drashna/keymap.c
@@ -45,25 +45,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
45 45
46[_QWERTY] = LAYOUT_wrapper(\ 46[_QWERTY] = LAYOUT_wrapper(\
47 KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, 47 KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
48 KC_TAB, _________________QWERTY_L2_________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________QWERTY_R2_________________, KC_QUOT, 48 KC_TAB, _________________QWERTY_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________QWERTY_R2_________________, KC_QUOT,
49 KC_MLSF, _________________QWERTY_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________QWERTY_R3_________________, KC_MRSF 49 KC_MLSF, _________________QWERTY_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________QWERTY_R3_________________, KC_MRSF
50), 50),
51 51
52[_COLEMAK] = LAYOUT_wrapper(\ 52[_COLEMAK] = LAYOUT_wrapper(\
53 KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, 53 KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC,
54 KC_TAB, _________________COLEMAK_L2________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________COLEMAK_R2________________, KC_QUOT, 54 KC_TAB, _________________COLEMAK_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________COLEMAK_R2________________, KC_QUOT,
55 KC_MLSF, _________________COLEMAK_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________COLEMAK_R3________________, KC_MRSF 55 KC_MLSF, _________________COLEMAK_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________COLEMAK_R3________________, KC_MRSF
56), 56),
57 57
58[_DVORAK] = LAYOUT_wrapper(\ 58[_DVORAK] = LAYOUT_wrapper(\
59 KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, 59 KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC,
60 KC_TAB, _________________DVORAK_L2_________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________DVORAK_R2_________________, KC_MINS, 60 KC_TAB, _________________DVORAK_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________DVORAK_R2_________________, KC_MINS,
61 KC_MLSF, _________________DVORAK_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________DVORAK_R3_________________, KC_MRSF 61 KC_MLSF, _________________DVORAK_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________DVORAK_R3_________________, KC_MRSF
62), 62),
63[_WORKMAN] = LAYOUT_wrapper(\ 63[_WORKMAN] = LAYOUT_wrapper(\
64 KC_ESC, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC, 64 KC_ESC, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC,
65 KC_TAB, _________________WORKMAN_L2________________, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, _________________WORKMAN_R2________________, KC_MINS, 65 KC_TAB, _________________WORKMAN_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________WORKMAN_R2________________, KC_MINS,
66 KC_MLSF, _________________WORKMAN_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________WORKMAN_R3________________, KC_MRSF 66 KC_MLSF, _________________WORKMAN_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________WORKMAN_R3________________, KC_MRSF
67), 67),
68[_MODS] = LAYOUT_wrapper(\ 68[_MODS] = LAYOUT_wrapper(\
69 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 69 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
@@ -72,40 +72,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
72), 72),
73 73
74[_LOWER] = LAYOUT_wrapper(\ 74[_LOWER] = LAYOUT_wrapper(\
75 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, 75 KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC,
76 KC_F11, _________________FUNC_LEFT_________________, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, 76 KC_F11, _________________LOWER_L2__________________, _______, _______, _______, _______, _________________LOWER_R2__________________, KC_PIPE,
77 KC_F12, _________________FUNC_RIGHT________________, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______ 77 KC_F12, _________________LOWER_L3__________________, _______, _______, _______, _______, _______, _______, _________________LOWER_R3__________________, _______
78), 78),
79 79
80[_RAISE] = LAYOUT_wrapper(\ 80[_RAISE] = LAYOUT_wrapper(\
81 KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_BSPC, 81 KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC,
82 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, 82 _______, _________________RAISE_L2__________________, _______, _______, _______, _______, _________________RAISE_R2__________________, KC_BSLS,
83 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______ 83 _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________, _______
84), 84),
85 85
86[_ADJUST] = LAYOUT_wrapper(\ 86[_ADJUST] = LAYOUT_wrapper(\
87 KC_MAKE, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RESET, 87 KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
88 VRSN, _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, KC_NUKE, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, EPRM, 88 VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EPRM,
89 TG(_MODS),RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, _______, _______, _______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY 89 TG_MODS, _________________ADJUST_L3_________________, _______, _______, _______, _______, _______, _______, _________________ADJUST_R3_________________, KC_MPLY
90) 90)
91
92
93}; 91};
94 92
93void matrix_init_keymap(void) {
94 DDRD &= ~(1<<5);
95 PORTD &= ~(1<<5);
95 96
96bool indicator_is_this_led_used(uint8_t index) { 97 DDRB &= ~(1<<0);
97 switch (index) { 98 PORTB &= ~(1<<0);
98#ifdef INDICATOR_LIGHTS
99 case SHFT_LED1:
100 case SHFT_LED2:
101 case CTRL_LED1:
102 case CTRL_LED2:
103 case GUI_LED1:
104 case GUI_LED2:
105 return true;
106 break;
107#endif
108 default:
109 return false;
110 }
111} 99}
diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk
index e7ed88d84..f870c3a7d 100644
--- a/keyboards/orthodox/keymaps/drashna/rules.mk
+++ b/keyboards/orthodox/keymaps/drashna/rules.mk
@@ -11,3 +11,5 @@ NKRO_ENABLE = yes
11INDICATOR_LIGHTS = yes 11INDICATOR_LIGHTS = yes
12MACROS_ENABLED = no 12MACROS_ENABLED = no
13RGBLIGHT_TWINKLE = yes 13RGBLIGHT_TWINKLE = yes
14
15BOOTLOADER = qmk-dfu
diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h
index e25761203..5bc5598ee 100644
--- a/keyboards/viterbi/keymaps/drashna/config.h
+++ b/keyboards/viterbi/keymaps/drashna/config.h
@@ -15,11 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef CONFIG_USER_H 18#pragma once
19#define CONFIG_USER_H
20
21#include QMK_KEYBOARD_CONFIG_H
22
23 19
24#ifdef RGBLIGHT_ENABLE 20#ifdef RGBLIGHT_ENABLE
25#undef RGBLED_NUM 21#undef RGBLED_NUM
@@ -78,4 +74,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
78 L40, L41, L42, L43, L44, L45, L46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO \ 74 L40, L41, L42, L43, L44, L45, L46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO \
79 ) 75 )
80 76
81#endif 77#define QMK_ESC_OUTPUT F5 // usually COL
78#define QMK_ESC_INPUT D4 // usually ROW
79#define QMK_LED B0
80#define QMK_SPEAKER C6
diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c
index 11ffe6ebd..68ca593db 100644
--- a/keyboards/viterbi/keymaps/drashna/keymap.c
+++ b/keyboards/viterbi/keymaps/drashna/keymap.c
@@ -76,10 +76,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
76 //switch (keycode) { 76 //switch (keycode) {
77 //case KC_P00: 77 //case KC_P00:
78 // if (!record->event.pressed) { 78 // if (!record->event.pressed) {
79 // register_code(KC_KP_0); 79 // tap(KC_KP_0);
80 // unregister_code(KC_KP_0); 80 // tap(KC_KP_0);
81 // register_code(KC_KP_0);
82 // unregister_code(KC_KP_0);
83 // } 81 // }
84 // return false; 82 // return false;
85 // break; 83 // break;
@@ -89,5 +87,12 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
89 87
90 88
91 89
90void matrix_init_keymap(void) {
91 DDRD &= ~(1<<5);
92 PORTD &= ~(1<<5);
93
94 DDRB &= ~(1<<0);
95 PORTB &= ~(1<<0);
96}
92 97
93 98
diff --git a/keyboards/viterbi/keymaps/drashna/rules.mk b/keyboards/viterbi/keymaps/drashna/rules.mk
index a7b18e071..ec3befc0b 100644
--- a/keyboards/viterbi/keymaps/drashna/rules.mk
+++ b/keyboards/viterbi/keymaps/drashna/rules.mk
@@ -11,7 +11,7 @@ NKRO_ENABLE = yes
11NO_SECRETS = yes 11NO_SECRETS = yes
12MACROS_ENABLED = yes 12MACROS_ENABLED = yes
13INDICATOR_LIGHTS = no 13INDICATOR_LIGHTS = no
14RGBLIGHT_TWINKLE = yes 14RGBLIGHT_TWINKLE = no
15 15
16LAYOUTS = ortho_5x7 16LAYOUTS = ortho_5x7
17 17
@@ -22,3 +22,4 @@ LAYOUTS = ortho_5x7
22# SRC := $(filter-out split_util.c,$(SRC)) 22# SRC := $(filter-out split_util.c,$(SRC))
23# SRC += quantum/matrix.c 23# SRC += quantum/matrix.c
24 24
25BOOTLOADER = qmk-dfu
diff --git a/keyboards/viterbi/keymaps/drashna_old/config.h b/keyboards/viterbi/keymaps/drashna_old/config.h
new file mode 100644
index 000000000..ddf9d1a40
--- /dev/null
+++ b/keyboards/viterbi/keymaps/drashna_old/config.h
@@ -0,0 +1,86 @@
1/*
2Copyright 2017 Danny Nguyen <danny@hexwire.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_USER_H
19#define CONFIG_USER_H
20
21#include QMK_KEYBOARD_CONFIG_H
22
23
24#ifdef RGBLIGHT_ENABLE
25#undef RGBLED_NUM
26#define RGBLIGHT_ANIMATIONS
27#define RGBLED_NUM 12
28#define RGBLIGHT_HUE_STEP 8
29#define RGBLIGHT_SAT_STEP 8
30#define RGBLIGHT_VAL_STEP 8
31#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
32#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
33#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
34#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 300
35#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1
36#endif // RGBLIGHT_ENABLE
37
38
39#undef LOCKING_SUPPORT_ENABLE
40#undef LOCKING_RESYNC_ENABLE
41
42#ifndef NO_DEBUG
43#define NO_DEBUG
44#endif // !NO_DEBUG
45#ifndef NO_PRINT
46#define NO_PRINT
47#endif // !NO_PRINT
48
49/* disable action features */
50//#define NO_ACTION_LAYER
51//#define NO_ACTION_TAPPING
52//#define NO_ACTION_ONESHOT
53//#define NO_ACTION_MACRO
54//#define NO_ACTION_FUNCTION
55
56#undef PRODUCT
57#define PRODUCT Drashnas Viterbi Macro Pad
58
59#define USE_I2C
60
61#ifdef AUDIO_ENABLE
62#define C6_AUDIO
63#define NO_MUSIC_MODE
64#endif
65
66#define LAYOUT_ortho_5x7( \
67 L00, L01, L02, L03, L04, L05, L06, \
68 L10, L11, L12, L13, L14, L15, L16, \
69 L20, L21, L22, L23, L24, L25, L26, \
70 L30, L31, L32, L33, L34, L35, L36, \
71 L40, L41, L42, L43, L44, L45, L46 \
72 ) \
73 LAYOUT( \
74 L00, L01, L02, L03, L04, L05, L06, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
75 L10, L11, L12, L13, L14, L15, L16, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
76 L20, L21, L22, L23, L24, L25, L26, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
77 L30, L31, L32, L33, L34, L35, L36, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
78 L40, L41, L42, L43, L44, L45, L46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO \
79 )
80
81#endif
82
83#define QMK_ESC_OUTPUT F5 // usually COL
84#define QMK_ESC_INPUT D4 // usually ROW
85#define QMK_LED B0
86#define QMK_SPEAKER C6
diff --git a/keyboards/viterbi/keymaps/drashna_old/keymap.c b/keyboards/viterbi/keymaps/drashna_old/keymap.c
new file mode 100644
index 000000000..2d361da9a
--- /dev/null
+++ b/keyboards/viterbi/keymaps/drashna_old/keymap.c
@@ -0,0 +1 @@
//placeholder \ No newline at end of file
diff --git a/keyboards/viterbi/keymaps/drashna_old/rules.mk b/keyboards/viterbi/keymaps/drashna_old/rules.mk
new file mode 100644
index 000000000..14ac6a6b3
--- /dev/null
+++ b/keyboards/viterbi/keymaps/drashna_old/rules.mk
@@ -0,0 +1,28 @@
1BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400)
5COMMAND_ENABLE = no # Commands for debug and configuration
6TAP_DANCE_ENABLE = no
7RGBLIGHT_ENABLE = yes
8AUDIO_ENABLE = yes
9NKRO_ENABLE = yes
10
11NO_SECRETS = yes
12MACROS_ENABLED = yes
13INDICATOR_LIGHTS = no
14RGBLIGHT_TWINKLE = no
15
16LAYOUTS = ortho_5x7
17
18# SRC := $(filter-out serial.c matrix.c i2c.c split_util.c,$(SRC))
19# SRC := $(filter-out serial.c,$(SRC))
20# SRC := $(filter-out matrix.c,$(SRC))
21# SRC := $(filter-out i2c.c,$(SRC))
22# SRC := $(filter-out split_util.c,$(SRC))
23# SRC += quantum/matrix.c
24
25USER_NAME := drashna
26SRC += ../drashna/keymap.c
27
28BOOTLOADER = qmk-dfu
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h
index 27124dbe2..9e2bd74f3 100644
--- a/layouts/community/ergodox/drashna/config.h
+++ b/layouts/community/ergodox/drashna/config.h
@@ -1,10 +1,9 @@
1#ifndef CONFIG_USER_H 1#pragma once
2#define CONFIG_USER_H
3 2
4#include QMK_KEYBOARD_CONFIG_H 3#include QMK_KEYBOARD_CONFIG_H
5 4
6#ifdef RGBLIGHT_ENABLE 5#ifdef RGBLIGHT_ENABLE
7#undef RGBLIGHT_SAT_STEP 6#undef RGBLIGHT_SAT_STEP
8#define RGBLIGHT_SAT_STEP 12 7#define RGBLIGHT_SAT_STEP 12
9#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 8#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7
10#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 9#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7
@@ -14,5 +13,3 @@
14 13
15#undef PRODUCT 14#undef PRODUCT
16#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine 15#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine
17
18#endif
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c
index 1506db03a..27d20d928 100644
--- a/layouts/community/ergodox/drashna/keymap.c
+++ b/layouts/community/ergodox/drashna/keymap.c
@@ -196,11 +196,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
196 * `--------------------' `--------------------' 196 * `--------------------' `--------------------'
197 */ 197 */
198 [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( 198 [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper(
199 KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, HYPR(KC_D), HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, 199 KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
200 KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 200 KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
201 KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, 201 KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO,
202 KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, 202 KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO,
203 KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, 203 KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO,
204 KC_O, KC_P, KC_HYPR, MAGIC_TOGGLE_NKRO, 204 KC_O, KC_P, KC_HYPR, MAGIC_TOGGLE_NKRO,
205 KC_LGUI, KC_NO, 205 KC_LGUI, KC_NO,
206 KC_V, KC_SPC, KC_H, KC_PGDN, KC_DEL, KC_ENTER 206 KC_V, KC_SPC, KC_H, KC_PGDN, KC_DEL, KC_ENTER
@@ -239,32 +239,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
239 ), 239 ),
240 240
241 [_LOWER] = LAYOUT_ergodox_pretty_wrapper( 241 [_LOWER] = LAYOUT_ergodox_pretty_wrapper(
242 _______, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, 242 KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11,
243 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, 243 KC_TILD, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, _______,
244 _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, 244 _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE,
245 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 245 _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, KC_PSCR,
246 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 246 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS,
247 _______, _______, _______, _______, 247 _______, _______, _______, _______,
248 _______, _______, 248 _______, _______,
249 _______, _______, _______, _______, _______, _______ 249 _______, _______, _______, _______, _______, _______
250 ), 250 ),
251 251
252 [_RAISE] = LAYOUT_ergodox_pretty_wrapper( 252 [_RAISE] = LAYOUT_ergodox_pretty_wrapper(
253 _______, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11, 253 KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11,
254 KC_GRV, ________________NUMBER_LEFT________________, _______, _______, ________________NUMBER_RIGHT_______________, _______, 254 KC_GRV, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, _______,
255 _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, 255 _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
256 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 256 _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, KC_PSCR,
257 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLCK, 257 _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_SLCK,
258 _______, _______, _______, _______, 258 _______, _______, _______, _______,
259 _______, _______, 259 _______, _______,
260 _______, _______, _______, _______, _______, _______ 260 _______, _______, _______, _______, _______, _______
261 ), 261 ),
262 262
263 [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( 263 [_ADJUST] = LAYOUT_ergodox_pretty_wrapper(
264 KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RST, 264 KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST,
265 VRSN, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, EPRM, 265 VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EPRM,
266 RGB_SMOD,RGB_HUI, CK_TOGG, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, TG(_MODS), 266 _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS),
267 _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T,_______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, 267 _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY,
268 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 268 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
269 _______, _______, _______, _______, 269 _______, _______, _______, _______,
270 _______, _______, 270 _______, _______,
@@ -324,3 +324,14 @@ void matrix_scan_keymap(void) { // runs frequently to update info
324 324
325}; 325};
326 326
327
328bool indicator_is_this_led_used_keyboard(uint8_t index) {
329 switch (index) {
330 case 13 ... 14:
331 return true;
332 break;
333 default:
334 return false;
335 }
336}
337
diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk
index aea07134b..f5d63c56f 100644
--- a/layouts/community/ergodox/drashna/rules.mk
+++ b/layouts/community/ergodox/drashna/rules.mk
@@ -1,8 +1,9 @@
1TAP_DANCE_ENABLE = yes 1TAP_DANCE_ENABLE = yes
2SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 2SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
3COMMAND_ENABLE = yes # Commands for debug and configuration 3COMMAND_ENABLE = yes # Commands for debug and configuration
4ifdef KEYBOARD_ergodox_ez 4ifeq ("$(KEYBOARD)","ergodox_ez")
5 RGBLIGHT_ENABLE = yes 5 RGBLIGHT_ENABLE = yes
6 RGB_MATRIX_ENABLE = no
6endif 7endif
7CONSOLE_ENABLE = no 8CONSOLE_ENABLE = no
8BOOTMAGIC_ENABLE = yes 9BOOTMAGIC_ENABLE = yes
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h
new file mode 100644
index 000000000..0bb6a4f50
--- /dev/null
+++ b/layouts/community/ortho_4x12/drashna/config.h
@@ -0,0 +1,56 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4
5#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
6#define RGB_DI_PIN D3
7#define RGBLED_NUM 16 // Number of LEDs
8#define RGBLIGHT_ANIMATIONS
9#define RGBLIGHT_HUE_STEP 12
10#define RGBLIGHT_SAT_STEP 12
11#define RGBLIGHT_VAL_STEP 12
12#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
13#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
14#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
15#endif // RGBLIGHT_ENABLE
16
17
18#if defined(KEYBOARD_lets_split_rev2)
19#define USE_SERIAL
20#undef USE_I2C
21
22#define EE_HANDS
23#endif
24
25#if defined(KEYBOARD_planck_rev5)
26#ifdef RGBLIGHT_ENABLE
27#define NO_MUSIC_MODE
28#endif // RGBLIGHT_ENABLE
29#endif // KEYBOARD_planck_rev5
30
31
32/*
33 * MIDI options
34 */
35
36/* Prevent use of disabled MIDI features in the keymap */
37//#define MIDI_ENABLE_STRICT 1
38
39/* enable basic MIDI features:
40 - MIDI notes can be sent when in Music mode is on
41*/
42
43#define MIDI_BASIC
44
45/* enable advanced MIDI features:
46 - MIDI notes can be added to the keymap
47 - Octave shift and transpose
48 - Virtual sustain, portamento, and modulation wheel
49 - etc.
50*/
51//#define MIDI_ADVANCED
52
53/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
54//#define MIDI_TONE_KEYCODE_OCTAVES 2
55
56#endif
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c
new file mode 100644
index 000000000..a5443939c
--- /dev/null
+++ b/layouts/community/ortho_4x12/drashna/keymap.c
@@ -0,0 +1,177 @@
1/* Copyright 2015-2017 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "drashna.h"
19
20
21enum planck_keycodes {
22 BACKLIT = NEW_SAFE_RANGE,
23};
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26
27/* Qwerty
28 * ,-----------------------------------------------------------------------------------.
29 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
30 * |------+------+------+------+------+-------------+------+------+------+------+------|
31 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
32 * |------+------+------+------+------+------|------+------+------+------+------+------|
33 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
34 * |------+------+------+------+------+------+------+------+------+------+------+------|
35 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
36 * `-----------------------------------------------------------------------------------'
37 */
38[_QWERTY] = LAYOUT_ortho_4x12_wrapper(
39 KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
40 KC_ESC, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
41 KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT,
42 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
43),
44
45/* Colemak
46 * ,-----------------------------------------------------------------------------------.
47 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
48 * |------+------+------+------+------+-------------+------+------+------+------+------|
49 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
50 * |------+------+------+------+------+------|------+------+------+------+------+------|
51 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
52 * |------+------+------+------+------+------+------+------+------+------+------+------|
53 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
54 * `-----------------------------------------------------------------------------------'
55 */
56[_COLEMAK] = LAYOUT_ortho_4x12_wrapper(
57 KC_TAB, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC,
58 KC_ESC, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT,
59 KC_LSFT, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, KC_ENT,
60 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
61),
62
63/* Dvorak
64 * ,-----------------------------------------------------------------------------------.
65 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
66 * |------+------+------+------+------+-------------+------+------+------+------+------|
67 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
68 * |------+------+------+------+------+------|------+------+------+------+------+------|
69 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
70 * |------+------+------+------+------+------+------+------+------+------+------+------|
71 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
72 * `-----------------------------------------------------------------------------------'
73 */
74[_DVORAK] = LAYOUT_ortho_4x12_wrapper(
75 KC_TAB, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC,
76 KC_ESC, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_SLSH,
77 KC_LSFT, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, KC_ENT,
78 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
79),
80
81
82[_WORKMAN] = LAYOUT_ortho_4x12_wrapper(
83 KC_TAB, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC,
84 KC_ESC, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
85 KC_LSFT, _________________WORKMAN_L3________________, _________________WORKMAN_R3________________, KC_ENT,
86 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
87),
88
89/* Lower
90 * ,-----------------------------------------------------------------------------------.
91 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
92 * |------+------+------+------+------+-------------+------+------+------+------+------|
93 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
94 * |------+------+------+------+------+------|------+------+------+------+------+------|
95 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
96 * |------+------+------+------+------+------+------+------+------+------+------+------|
97 * | | | | | | | | Next | Vol- | Vol+ | Play |
98 * `-----------------------------------------------------------------------------------'
99 */
100[_LOWER] = LAYOUT_ortho_4x12_wrapper(
101 KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC,
102 KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
103 _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
104 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
105),
106
107/* Raise
108 * ,-----------------------------------------------------------------------------------.
109 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
110 * |------+------+------+------+------+-------------+------+------+------+------+------|
111 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
112 * |------+------+------+------+------+------|------+------+------+------+------+------|
113 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
114 * |------+------+------+------+------+------+------+------+------+------+------+------|
115 * | | | | | | | | Next | Vol- | Vol+ | Play |
116 * `-----------------------------------------------------------------------------------'
117 */
118[_RAISE] = LAYOUT_ortho_4x12_wrapper(
119 KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC,
120 KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
121 _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
122 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
123),
124
125/* Adjust (Lower + Raise)
126 * ,-----------------------------------------------------------------------------------.
127 * | | Reset| | | | | | | | | | Del |
128 * |------+------+------+------+------+-------------+------+------+------+------+------|
129 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
130 * |------+------+------+------+------+------|------+------+------+------+------+------|
131 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
132 * |------+------+------+------+------+------+------+------+------+------+------+------|
133 * | | | | | | | | | | | |
134 * `-----------------------------------------------------------------------------------'
135 */
136[_ADJUST] = LAYOUT_ortho_4x12_wrapper(
137 _______, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_DEL,
138 _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______,
139 _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, _______,
140 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
141)
142
143
144};
145
146
147bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
148 switch (keycode) {
149
150#ifdef KEYBOARD_planck
151 case BACKLIT:
152 if (record->event.pressed) {
153 register_code(KC_RSFT);
154 #ifdef BACKLIGHT_ENABLE
155 backlight_step();
156 #endif
157 PORTE &= ~(1<<6);
158 } else {
159 unregister_code(KC_RSFT);
160 PORTE |= (1<<6);
161 }
162 return false;
163 break;
164#endif
165 }
166 return true;
167}
168
169bool music_mask_user(uint16_t keycode) {
170 switch (keycode) {
171 case RAISE:
172 case LOWER:
173 return false;
174 default:
175 return true;
176 }
177}
diff --git a/layouts/community/ortho_4x12/drashna/readme.md b/layouts/community/ortho_4x12/drashna/readme.md
new file mode 100644
index 000000000..de9680b49
--- /dev/null
+++ b/layouts/community/ortho_4x12/drashna/readme.md
@@ -0,0 +1,2 @@
1# The Default Planck Layout
2
diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk
new file mode 100644
index 000000000..ebd8b26b0
--- /dev/null
+++ b/layouts/community/ortho_4x12/drashna/rules.mk
@@ -0,0 +1,20 @@
1BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400)
5COMMAND_ENABLE = no # Commands for debug and configuration
6TAP_DANCE_ENABLE = no
7RGBLIGHT_ENABLE = yes
8AUDIO_ENABLE = yes
9
10
11ifeq ($(strip $(PROTOCOL)), VUSB)
12NKRO_ENABLE = no
13else
14NKRO_ENABLE = yes
15endif
16
17
18INDICATOR_LIGHTS = yes
19MACROS_ENABLED = no
20RGBLIGHT_TWINKLE = yes
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 26c989d7f..87050fbcc 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -1,5 +1,4 @@
1#ifndef USERSPACE_CONFIG_H 1#pragma once
2#define USERSPACE_CONFIG_H
3 2
4 3
5#ifdef AUDIO_ENABLE 4#ifdef AUDIO_ENABLE
@@ -71,5 +70,6 @@
71 70
72#define DISABLE_LEADER 71#define DISABLE_LEADER
73 72
74#endif // !USERSPACE_CONFIG_H 73#define MACRO_TIMER 5
74
75 75
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 8efd99f80..f72902f0b 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) {
38 clear_keyboard(); 38 clear_keyboard();
39 tap(userspace_config.is_overwatch ? KC_BSPC : KC_ENTER); 39 tap(userspace_config.is_overwatch ? KC_BSPC : KC_ENTER);
40 wait_ms(50); 40 wait_ms(50);
41 send_string(str); 41 send_string_with_delay(str, MACRO_TIMER);
42 wait_ms(50); 42 wait_ms(50);
43 tap(KC_ENTER); 43 tap(KC_ENTER);
44 } 44 }
@@ -48,6 +48,40 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) {
48 48
49void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; 49void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
50 50
51bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) {
52 static uint16_t this_timer;
53 if(pressed) {
54 this_timer= timer_read();
55 } else {
56 if (timer_elapsed(this_timer) < TAPPING_TERM){
57 register_code(code);
58 unregister_code(code);
59 } else {
60 register_code(mod_code);
61 register_code(code);
62 unregister_code(code);
63 unregister_code(mod_code);
64 }
65 }
66 return false;
67}
68
69bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) {
70 if(pressed) {
71 this_timer= timer_read();
72 } else {
73 if (timer_elapsed(this_timer) < TAPPING_TERM){
74 register_code(code);
75 unregister_code(code);
76 } else {
77 register_code(mod_code);
78 register_code(code);
79 unregister_code(code);
80 unregister_code(mod_code);
81 }
82 }
83 return false;
84}
51 85
52// Add reconfigurable functions here, for keymap customization 86// Add reconfigurable functions here, for keymap customization
53// This allows for a global, userspace functions, and continued 87// This allows for a global, userspace functions, and continued
@@ -57,6 +91,15 @@ __attribute__ ((weak))
57void matrix_init_keymap(void) {} 91void matrix_init_keymap(void) {}
58 92
59__attribute__ ((weak)) 93__attribute__ ((weak))
94void startup_keymap(void) {}
95
96__attribute__ ((weak))
97void suspend_power_down_keymap(void) {}
98
99__attribute__ ((weak))
100void suspend_wakeup_init_keymap(void) {}
101
102__attribute__ ((weak))
60void matrix_scan_keymap(void) {} 103void matrix_scan_keymap(void) {}
61 104
62__attribute__ ((weak)) 105__attribute__ ((weak))
@@ -69,12 +112,18 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
69 return true; 112 return true;
70} 113}
71 114
115
72__attribute__ ((weak)) 116__attribute__ ((weak))
73uint32_t layer_state_set_keymap (uint32_t state) { 117uint32_t layer_state_set_keymap (uint32_t state) {
74 return state; 118 return state;
75} 119}
76 120
77__attribute__ ((weak)) 121__attribute__ ((weak))
122uint32_t default_layer_state_set_keymap (uint32_t state) {
123 return state;
124}
125
126__attribute__ ((weak))
78void led_set_keymap(uint8_t usb_led) {} 127void led_set_keymap(uint8_t usb_led) {}
79 128
80 129
@@ -99,14 +148,38 @@ void matrix_init_user(void) {
99#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 148#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
100 set_unicode_input_mode(UC_WINC); 149 set_unicode_input_mode(UC_WINC);
101#endif //UNICODE_ENABLE 150#endif //UNICODE_ENABLE
102 matrix_init_rgb();
103 matrix_init_keymap(); 151 matrix_init_keymap();
104} 152}
105 153
154void startup_user (void) {
155 #ifdef RGBLIGHT_ENABLE
156 matrix_init_rgb();
157 #endif //RGBLIGHT_ENABLE
158 startup_keymap();
159}
160
161void suspend_power_down_user(void)
162{
163 suspend_power_down_keymap();
164}
165
166void suspend_wakeup_init_user(void)
167{
168 suspend_wakeup_init_keymap();
169 #ifdef KEYBOARD_ergodox_ez
170 wait_ms(10);
171 #endif
172}
173
106 174
107// No global matrix scan code, so just run keymap's matrix 175// No global matrix scan code, so just run keymap's matrix
108// scan function 176// scan function
109void matrix_scan_user(void) { 177void matrix_scan_user(void) {
178 static bool has_ran_yet;
179 if (!has_ran_yet) {
180 has_ran_yet = true;
181 startup_user();
182 }
110 183
111#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. 184#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
112 run_diablo_macro_check(); 185 run_diablo_macro_check();
@@ -160,7 +233,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
160 233
161 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader 234 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
162 if (!record->event.pressed) { 235 if (!record->event.pressed) {
163 SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP 236 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP
164#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) 237#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
165 ":dfu" 238 ":dfu"
166#elif defined(BOOTLOADER_HALFKAY) 239#elif defined(BOOTLOADER_HALFKAY)
@@ -168,7 +241,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
168#elif defined(BOOTLOADER_CATERINA) 241#elif defined(BOOTLOADER_CATERINA)
169 ":avrdude" 242 ":avrdude"
170#endif // bootloader options 243#endif // bootloader options
171 SS_TAP(X_ENTER)); 244 SS_TAP(X_ENTER)), 10);
172 } 245 }
173 return false; 246 return false;
174 break; 247 break;
@@ -197,7 +270,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
197 break; 270 break;
198 case VRSN: // Prints firmware version 271 case VRSN: // Prints firmware version
199 if (record->event.pressed) { 272 if (record->event.pressed) {
200 SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE); 273 send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER);
201 } 274 }
202 return false; 275 return false;
203 break; 276 break;
@@ -256,7 +329,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
256 diablo_key_time[dtime] = diablo_times[0]; 329 diablo_key_time[dtime] = diablo_times[0];
257 } 330 }
258 } 331 }
259#endif // TAP_DANCE_ENABLE#endif 332#endif // TAP_DANCE_ENABLE
260 return false; break; 333 return false; break;
261 334
262 335
@@ -314,7 +387,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
314#endif // UNICODE_ENABLE 387#endif // UNICODE_ENABLE
315 388
316 } 389 }
317 return process_record_keymap(keycode, record) && process_record_secrets(keycode, record) && process_record_user_rgb(keycode, record); 390 return process_record_keymap(keycode, record) &&
391#ifdef RGBLIGHT_ENABLE
392 process_record_user_rgb(keycode, record) &&
393#endif // RGBLIGHT_ENABLE
394 process_record_secrets(keycode, record);
318} 395}
319 396
320 397
@@ -331,6 +408,11 @@ uint32_t layer_state_set_user(uint32_t state) {
331} 408}
332 409
333 410
411uint32_t default_layer_state_set_kb(uint32_t state) {
412 return default_layer_state_set_keymap (state);
413}
414
415
334// Any custom LED code goes here. 416// Any custom LED code goes here.
335// So far, I only have keyboard specific code, 417// So far, I only have keyboard specific code,
336// So nothing goes here. 418// So nothing goes here.
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h
index e035b86fb..3efef5704 100644
--- a/users/drashna/drashna.h
+++ b/users/drashna/drashna.h
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19#define USERSPACE 19#define USERSPACE
20#include "quantum.h" 20#include "quantum.h"
21 21
22
22// Define layer names 23// Define layer names
23enum userspace_layers { 24enum userspace_layers {
24 _QWERTY = 0, 25 _QWERTY = 0,
@@ -53,8 +54,8 @@ void rgblight_sethsv_default_helper(uint8_t index);
53#endif // RGBLIGHT_ENABLE 54#endif // RGBLIGHT_ENABLE
54 55
55void tap(uint16_t keycode); 56void tap(uint16_t keycode);
56bool process_record_secrets(uint16_t keycode, keyrecord_t *record); 57bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed);
57 58bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
58 59
59#define EECONFIG_USERSPACE (uint8_t *)19 60#define EECONFIG_USERSPACE (uint8_t *)19
60 61
@@ -69,15 +70,15 @@ typedef union {
69} userspace_config_t; 70} userspace_config_t;
70 71
71enum userspace_custom_keycodes { 72enum userspace_custom_keycodes {
72 EPRM = SAFE_RANGE, // can always be here 73 EPRM = SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init)
73 VRSN, 74 VRSN, // Prints QMK Firmware and board info
74 KC_QWERTY, 75 KC_QWERTY, // Sets default layer to QWERTY
75 KC_COLEMAK, 76 KC_COLEMAK, // Sets default layer to COLEMAK
76 KC_DVORAK, 77 KC_DVORAK, // Sets default layer to DVORAK
77 KC_WORKMAN, 78 KC_WORKMAN, // Sets default layer to WORKMAN
78 KC_DIABLO_CLEAR, 79 KC_DIABLO_CLEAR, // Clears all Diablo Timers
79 KC_OVERWATCH, 80 KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat)
80 KC_SALT, 81 KC_SALT, // See drashna.c for details
81 KC_MORESALT, 82 KC_MORESALT,
82 KC_SALTHARD, 83 KC_SALTHARD,
83 KC_GOODGAME, 84 KC_GOODGAME,
@@ -88,27 +89,28 @@ enum userspace_custom_keycodes {
88 KC_AIM, 89 KC_AIM,
89 KC_C9, 90 KC_C9,
90 KC_GGEZ, 91 KC_GGEZ,
91 KC_MAKE, 92 KC_MAKE, // Run keyboard's customized make command
92 KC_RESET, 93 KC_RESET, // Resets keyboard, with red underglow
93 KC_RGB_T, 94 KC_RGB_T, // Toggles RGB Layer Indication mode
94 KC_SECRET_1, 95 KC_SECRET_1, // test1
95 KC_SECRET_2, 96 KC_SECRET_2, // test2
96 KC_SECRET_3, 97 KC_SECRET_3, // test3
97 KC_SECRET_4, 98 KC_SECRET_4, // test4
98 KC_SECRET_5, 99 KC_SECRET_5, // test5
99 KC_CCCV, 100 KC_CCCV, // Hold to copy, tap to paste
100 KC_NUKE, 101 KC_NUKE, // NUCLEAR LAUNCH DETECTED!!!
101 102
102#ifdef UNICODE_ENABLE 103#ifdef UNICODE_ENABLE
103 UC_FLIP, 104 UC_FLIP, // Table flip (not working?)
104#endif //UNICODE_ENABLE 105#endif //UNICODE_ENABLE
105 NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes 106 NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
106}; 107};
107 108
108#define LOWER MO(_LOWER) 109#define LOWER MO(_LOWER)
109#define RAISE MO(_RAISE) 110#define RAISE MO(_RAISE)
110#define ADJUST MO(_ADJUST) 111#define ADJUST MO(_ADJUST)
111 112#define TG_MODS TG(_MODS)
113#define TG_GAME TG(_GAMEPAD)
112 114
113#define KC_SEC1 KC_SECRET_1 115#define KC_SEC1 KC_SECRET_1
114#define KC_SEC2 KC_SECRET_2 116#define KC_SEC2 KC_SECRET_2
@@ -184,7 +186,7 @@ enum {
184#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) 186#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
185#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) 187#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__)
186#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) 188#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
187 189#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__)
188 190
189// Blocks for each of the four major keyboard layouts 191// Blocks for each of the four major keyboard layouts
190// Organized so we can quickly adapt and modify all of them 192// Organized so we can quickly adapt and modify all of them
@@ -237,7 +239,7 @@ enum {
237 239
238#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN 240#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN
239#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I 241#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I
240#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) 242#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
241 243
242 244
243#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K 245#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K
@@ -248,11 +250,89 @@ enum {
248#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U 250#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U
249#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) 251#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
250 252
253
254#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B
255#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F
256#define _________________MALTRON_L3________________ CTL_T(KC_SCLN), KC_SLSH, KC_J KC_G, KC_COMM
257
258#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L
259#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R
260#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, CTL_T(KC_x)
261
262
263#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q
264#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U
265#define _________________EUCALYN_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_W
266
267#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P
268#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N
269#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, CTL_T(KC_SCLN)
270
271
272#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W
273#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
274#define _____________CARPLAX_QFMLWY_L3_____________ CTL_T(KC_Z), KC_V, KC_G, KC_C, KC_X
275
276#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J
277#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN
278#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, CTL_T(KC_SLSH)
279
280
281#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W
282#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
283#define _____________CARPLAX_QGMLWB_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_F, KC_J
284
285#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN
286#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H
287#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH)
288
289
290#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W
291#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
292#define _____________CARPLAX_QGMLWY_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_J
293
294#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN
295#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H
296#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH)
297
298
251#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 299#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5
252#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 300#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0
253#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 301#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
254#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 302#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
255 303
304#define ___________________BLANK___________________ _______, _______, _______, _______, _______
305
306
307#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
308#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________
309#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________
310
311#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN
312#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR
313#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
314
315
316
317#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________
318#define _________________RAISE_L2__________________ ___________________BLANK___________________
319#define _________________RAISE_L3__________________ ___________________BLANK___________________
320
321#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________
322#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC
323#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END
324
325
326
327#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
328#define _________________ADJUST_L2_________________ _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM
329#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T
330
331#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5
332#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN
333#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT
334
335
256// Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN), 336// Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
257// this allows us to quickly modify the bottom row for all of the layouts 337// this allows us to quickly modify the bottom row for all of the layouts
258// so we don't have to alter it 4 times and hope that we haven't missed 338// so we don't have to alter it 4 times and hope that we haven't missed
@@ -261,7 +341,11 @@ enum {
261#define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT 341#define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
262 342
263 343
264#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ 344#define ___________ORTHODOX_THUMP_TOP_____________ ALT_APP, OS_LGUI, KC_LALT, OS_RGUI
345#define ___________________ORTHODOX_THUMB_BOTTOM____________________ LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE
346
347
348#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \
265 KC_HOME, KC_PGUP, \ 349 KC_HOME, KC_PGUP, \
266 LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) 350 LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER)
267 351
diff --git a/users/drashna/readme.md b/users/drashna/readme.md
index 0aa73ece9..179960322 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".
75Secret Macros 75Secret Macros
76------------- 76-------------
77 77
78With help from gitter and Colinta, this adds the ability to add hidden strings to be used for macros. 78With help from gitter and Colinta, this adds the ability to add hidden macros from other users.
79 79
80I 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. 80First, 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.
81
82And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `<name>.h` file to define the keycodes for the new macros.
81 83
82If 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.
83 84
84###### .git/info/exclude 85###### .git/info/exclude
85``` 86```
@@ -89,10 +90,44 @@ If you would *also* like to take advantage of this feature, you'll first want to
89# exclude patterns (uncomment them if you want to use them): 90# exclude patterns (uncomment them if you want to use them):
90# *.[oa] 91# *.[oa]
91# *~ 92# *~
93/users/drashna/secrets.c
92/users/drashna/secrets.h 94/users/drashna/secrets.h
93``` 95```
94 96
95Then you can create this file and add your macro strings to it: 97Then you can create these files:
98
99###### secrets.c
100
101```c
102#include "drashna.h" // replace with your keymap's "h" file, or whatever file stores the keycodes
103
104#if (__has_include("secrets.h") && !defined(NO_SECRETS))
105#include "secrets.h"
106#else
107// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware
108// And I'm not familiar enough to know which is better or why...
109static const char * const secret[] = {
110 "test1",
111 "test2",
112 "test3",
113 "test4",
114 "test5"
115};
116#endif
117
118bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
119 switch (keycode) {
120 case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo
121 if (!record->event.pressed) {
122 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
123 send_string_with_delay(secret[keycode - KC_SECRET_1], MACRO_TIMER);
124 }
125 return false;
126 break;
127 }
128 return true;
129}
130```
96 131
97###### secrets.h 132###### secrets.h
98```c 133```c
@@ -107,36 +142,33 @@ static const char * const secrets[] = {
107 142
108Replacing the strings with the codes that you need. 143Replacing the strings with the codes that you need.
109 144
145###### name.c
146
110In the `<name>.c` file, you will want to add this to the top: 147In the `<name>.c` file, you will want to add this to the top:
111 148
112```c 149```c
113 150__attribute__ ((weak))
114#if (__has_include("secrets.h") && !defined(NO_SECRETS)) 151bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
115#include "secrets.h" 152 return true;
116#else 153}
117// `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware
118// And I'm not familiar enough to know which is better or why...
119static const char * const secrets[] = {
120 "test1",
121 "test2",
122 "test3",
123 "test4",
124 "test5"
125};
126#endif
127``` 154```
155This 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.
156
128 157
129And then, in the `process_record_user` function, you'll want to add this block: 158And 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);`
130```c 159```c
131 case KC_SECRET_1 ... KC_SECRET_5: 160 return process_record_keymap(keycode, record) && process_record_secrets(keycode, record);
132 if (!record->event.pressed) { 161}
133 send_string_P(secret[keycode - KC_SECRET_1]);
134 }
135 return false;
136 break;
137``` 162```
138 163
139And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `<name>.h` file fo the new macros, as well. 164###### rules.mk
165
166Here, you want your `/users/<name>/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:
167```c
168ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
169 SRC += secrets.c
170endif
171```
140 172
141Additionally, 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/<name>/rules.mk`, so that it catches the flag: 173Additionally, 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/<name>/rules.mk`, so that it catches the flag:
142```c 174```c
@@ -181,15 +213,15 @@ Pro Micro Hacking
181 213
182Well, you can get the QMK DFU bootloader working on the ProMicro. But you need to change fuses. 214Well, you can get the QMK DFU bootloader working on the ProMicro. But you need to change fuses.
183 215
184What worked to get into the firmware properly was: 216What worked to get into the firmware properly was:
185 217
186``` 218```
187Low: 0x5E High: 0x99 Extended: 0xF3 Lock: 0xFF 219Low: 0x5E High: 0xD9 Extended: 0xC3 Lock: 0x3F
188``` 220```
189 221
190But some of the columns and rows didn't work, like the pin mapping was wrong. Even when setting the bootloader settings. 222The 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).
191 223
192 This is here for future reference. And the default fuse settings I believe were: 224And for reference, if you want to go back to caterina, the default fuse settings I believe were:
193 225
194``` 226```
195Low: 0xFF High: 0xD8 Extended: 0xC3 Lock: 0x3F 227Low: 0xFF High: 0xD8 Extended: 0xC3 Lock: 0x3F
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index af7190cc3..f2a9a47a9 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -1,5 +1,6 @@
1#include "drashna.h" 1#include "drashna.h"
2#include "rgb_stuff.h" 2#include "rgb_stuff.h"
3#include "eeprom.h"
3 4
4extern rgblight_config_t rgblight_config; 5extern rgblight_config_t rgblight_config;
5extern userspace_config_t userspace_config; 6extern userspace_config_t userspace_config;
@@ -22,25 +23,64 @@ uint8_t current_osm;
22void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { 23void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
23 if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { 24 if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) {
24 if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { 25 if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) {
25 rgblight_sethsv_at(0, 255, 255, SHFT_LED1); 26 #ifdef SHFT_LED1
26 rgblight_sethsv_at(0, 255, 255, SHFT_LED2); 27 rgblight_sethsv_at(120, 255, 255, SHFT_LED1);
28 #endif // SHFT_LED1
29 #ifdef SHFT_LED2
30 rgblight_sethsv_at(120, 255, 255, SHFT_LED2);
31 #endif // SHFT_LED2
27 } else { 32 } else {
28 rgblight_sethsv_default_helper(SHFT_LED1); 33 #ifdef SHFT_LED1
29 rgblight_sethsv_default_helper(SHFT_LED2); 34 rgblight_sethsv_default_helper(SHFT_LED1);
35 #endif // SHFT_LED1
36 #ifdef SHFT_LED2
37 rgblight_sethsv_default_helper(SHFT_LED2);
38 #endif // SHFT_LED2
30 } 39 }
31 if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) { 40 if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) {
32 rgblight_sethsv_at(51, 255, 255, CTRL_LED1); 41 #ifdef CTRL_LED1
33 rgblight_sethsv_at(51, 255, 255, CTRL_LED2); 42 rgblight_sethsv_at(0, 255, 255, CTRL_LED1);
43 #endif // CTRL_LED1
44 #ifdef CTRL_LED2
45 rgblight_sethsv_at(0, 255, 255, CTRL_LED2);
46 #endif // CTRL_LED2
34 } else { 47 } else {
35 rgblight_sethsv_default_helper(CTRL_LED1); 48 #ifdef CTRL_LED1
36 rgblight_sethsv_default_helper(CTRL_LED2); 49 rgblight_sethsv_default_helper(CTRL_LED1);
50 #endif // CTRL_LED1
51 #ifdef CTRL_LED2
52 rgblight_sethsv_default_helper(CTRL_LED2);
53 #endif // CTRL_LED2
37 } 54 }
38 if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) { 55 if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) {
39 rgblight_sethsv_at(120, 255, 255, GUI_LED1); 56 #ifdef GUI_LED1
40 rgblight_sethsv_at(120, 255, 255, GUI_LED2); 57 rgblight_sethsv_at(51, 255, 255, GUI_LED1);
58 #endif // GUI_LED1
59 #ifdef GUI_LED2
60 rgblight_sethsv_at(51, 255, 255, GUI_LED2);
61 #endif // GUI_LED2
41 } else { 62 } else {
42 rgblight_sethsv_default_helper(GUI_LED1); 63 #ifdef GUI_LED1
43 rgblight_sethsv_default_helper(GUI_LED2); 64 rgblight_sethsv_default_helper(GUI_LED1);
65 #endif // GUI_LED1
66 #ifdef GUI_LED2
67 rgblight_sethsv_default_helper(GUI_LED2);
68 #endif // GUI_LED2
69 }
70 if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) {
71 #ifdef ALT_LED1
72 rgblight_sethsv_at(240, 255, 255, ALT_LED1);
73 #endif // ALT_LED1
74 #ifdef GUI_LED2
75 rgblight_sethsv_at(240, 255, 255, ALT_LED2);
76 #endif // GUI_LED2
77 } else {
78 #ifdef GUI_LED1
79 rgblight_sethsv_default_helper(ALT_LED1);
80 #endif // GUI_LED1
81 #ifdef GUI_LED2
82 rgblight_sethsv_default_helper(ALT_LED2);
83 #endif // GUI_LED2
44 } 84 }
45 } 85 }
46} 86}
@@ -63,7 +103,48 @@ void matrix_scan_indicator(void) {
63static rgblight_fadeout lights[RGBLED_NUM]; 103static rgblight_fadeout lights[RGBLED_NUM];
64 104
65__attribute__ ((weak)) 105__attribute__ ((weak))
66bool indicator_is_this_led_used(uint8_t index) { return false; } 106bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; }
107
108bool rgblight_twinkle_is_led_used(uint8_t index) {
109 switch (index) {
110#ifdef INDICATOR_LIGHTS
111#ifdef SHFT_LED1
112 case SHFT_LED1:
113 return true;
114#endif //SHFT_LED1
115#ifdef SHFT_LED2
116 case SHFT_LED2:
117 return true;
118#endif //SHFT_LED2
119#ifdef CTRL_LED1
120 case CTRL_LED1:
121 return true;
122#endif //CTRL_LED1
123#ifdef CTRL_LED2
124 case CTRL_LED2:
125 return true;
126#endif //CTRL_LED2
127#ifdef GUI_LED1
128 case GUI_LED1:
129 return true;
130#endif //GUI_LED1
131#ifdef GUI_LED2
132 case GUI_LED2:
133 return true;
134#endif //GUI_LED2
135#ifdef ALT_LED1
136 case ALT_LED1:
137 return true;
138#endif //ALT_LED1
139#ifdef ALT_LED2
140 case ALT_LED2:
141 return true;
142#endif //ALT_LED2
143#endif //INDICATOR_LIGHTS
144 default:
145 return rgblight_twinkle_is_led_used_keymap(index);
146 }
147}
67 148
68void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive 149void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive
69 bool litup = false; 150 bool litup = false;
@@ -97,7 +178,7 @@ void start_rgb_light(void) {
97 uint8_t min_life = 0xFF; 178 uint8_t min_life = 0xFF;
98 uint8_t min_life_index = -1; 179 uint8_t min_life_index = -1;
99 for (uint8_t index = 0 ; index < RGBLED_NUM ; ++index ) { 180 for (uint8_t index = 0 ; index < RGBLED_NUM ; ++index ) {
100 if (indicator_is_this_led_used(index)) { continue; } 181 if (rgblight_twinkle_is_led_used(index)) { continue; }
101 if (lights[index].enabled) { 182 if (lights[index].enabled) {
102 if (min_life_index == -1 || 183 if (min_life_index == -1 ||
103 lights[index].life < min_life) 184 lights[index].life < min_life)
@@ -181,16 +262,16 @@ void matrix_init_rgb(void) {
181#endif 262#endif
182 263
183 if (userspace_config.rgb_layer_change) { 264 if (userspace_config.rgb_layer_change) {
184 uint8_t default_layer = eeconfig_read_default_layer();
185 rgblight_enable_noeeprom(); 265 rgblight_enable_noeeprom();
186 if (default_layer & (1UL << _COLEMAK)) { 266 switch (biton32(eeconfig_read_default_layer())) {
187 rgblight_sethsv_magenta(); 267 case _COLEMAK:
188 } else if (default_layer & (1UL << _DVORAK)) { 268 rgblight_sethsv_noeeprom_magenta(); break;
189 rgblight_sethsv_green(); 269 case _DVORAK:
190 } else if (default_layer & (1UL << _WORKMAN)) { 270 rgblight_sethsv_noeeprom_green(); break;
191 rgblight_sethsv_goldenrod(); 271 case _WORKMAN:
192 } else { 272 rgblight_sethsv_noeeprom_goldenrod(); break;
193 rgblight_sethsv_cyan(); 273 default:
274 rgblight_sethsv_noeeprom_cyan(); break;
194 } 275 }
195 } 276 }
196} 277}
@@ -209,7 +290,6 @@ void matrix_scan_rgb(void) {
209 290
210uint32_t layer_state_set_rgb(uint32_t state) { 291uint32_t layer_state_set_rgb(uint32_t state) {
211#ifdef RGBLIGHT_ENABLE 292#ifdef RGBLIGHT_ENABLE
212 uint8_t default_layer = eeconfig_read_default_layer();
213 if (userspace_config.rgb_layer_change) { 293 if (userspace_config.rgb_layer_change) {
214 switch (biton32(state)) { 294 switch (biton32(state)) {
215 case _MACROS: 295 case _MACROS:
@@ -241,14 +321,15 @@ uint32_t layer_state_set_rgb(uint32_t state) {
241 rgblight_mode_noeeprom(23); 321 rgblight_mode_noeeprom(23);
242 break; 322 break;
243 default: // for any other layers, or the default layer 323 default: // for any other layers, or the default layer
244 if (default_layer & (1UL << _COLEMAK)) { 324 switch (biton32(default_layer_state)) {
245 rgblight_sethsv_noeeprom_magenta(); 325 case _COLEMAK:
246 } else if (default_layer & (1UL << _DVORAK)) { 326 rgblight_sethsv_noeeprom_magenta(); break;
247 rgblight_sethsv_noeeprom_green(); 327 case _DVORAK:
248 } else if (default_layer & (1UL << _WORKMAN)) { 328 rgblight_sethsv_noeeprom_green(); break;
249 rgblight_sethsv_noeeprom_goldenrod(); 329 case _WORKMAN:
250 } else { 330 rgblight_sethsv_noeeprom_goldenrod(); break;
251 rgblight_sethsv_noeeprom_cyan(); 331 default:
332 rgblight_sethsv_noeeprom_cyan(); break;
252 } 333 }
253 biton32(state) == _MODS ? rgblight_mode_noeeprom(2) : rgblight_mode_noeeprom(1); // if _MODS layer is on, then breath to denote it 334 biton32(state) == _MODS ? rgblight_mode_noeeprom(2) : rgblight_mode_noeeprom(1); // if _MODS layer is on, then breath to denote it
254 break; 335 break;
@@ -259,3 +340,5 @@ uint32_t layer_state_set_rgb(uint32_t state) {
259 340
260 return state; 341 return state;
261} 342}
343
344
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index 18df665c0..e299f24a1 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -1,5 +1,9 @@
1 1
2SRC += drashna.c secrets.c rgb_stuff.c 2SRC += drashna.c
3
4ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
5 SRC += secrets.c
6endif
3 7
4ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 8ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
5 SRC += tap_dances.c 9 SRC += tap_dances.c
@@ -11,7 +15,8 @@ ifeq ($(strip $(NO_SECRETS)), yes)
11 OPT_DEFS += -DNO_SECRETS 15 OPT_DEFS += -DNO_SECRETS
12endif 16endif
13 17
14ifdef RGBLIGHT_ENABLE 18ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
19 SRC += rgb_stuff.c
15 ifeq ($(strip $(INDICATOR_LIGHTS)), yes) 20 ifeq ($(strip $(INDICATOR_LIGHTS)), yes)
16 OPT_DEFS += -DINDICATOR_LIGHTS 21 OPT_DEFS += -DINDICATOR_LIGHTS
17 endif 22 endif