aboutsummaryrefslogtreecommitdiff
path: root/keyboards/orthodox
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-05-15 19:34:34 -0700
committerJack Humbert <jack.humb@gmail.com>2018-05-15 22:34:34 -0400
commit53a6501d71cabbe4c5c41652cf24fdc059609e5d (patch)
tree4662908d245fe7176307f99a994d1f8d8ef12158 /keyboards/orthodox
parenta572323f94b533582edab4402867dc994cc8c75f (diff)
downloadqmk_firmware-53a6501d71cabbe4c5c41652cf24fdc059609e5d.tar.gz
qmk_firmware-53a6501d71cabbe4c5c41652cf24fdc059609e5d.zip
Yet another update to drashna keymaps and userspace (EEPROM, RGB indicators) (#2959)
* More Iris Tweaks * Mess with iris arrow keys * Massive layout overhaul to make everything more OLKB * Additional tweaks * Cleanup Userspace Remove unused layer code, and properly set userspace eeprom structure. * EEPROM stuff * Only use indicators if layer indication is enabled * Iris and Orthodox Tweaks (Status Indicators) * Additional tweaks to finish tri layer conversion * Disable ProMicro ligths globally * Add Pro Micro hacking info * Successfully get mod indication working on thumb clusters * Enable printing when console is enabled * Make Modifier Indicator lights more modular * Keymap cleanup * Tapping test changes * Cleanup and minor tweaks
Diffstat (limited to 'keyboards/orthodox')
-rw-r--r--keyboards/orthodox/keymaps/drashna/keymap.c73
-rw-r--r--keyboards/orthodox/keymaps/drashna/rules.mk1
2 files changed, 51 insertions, 23 deletions
diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c
index 3c99e9cb8..bcc59268c 100644
--- a/keyboards/orthodox/keymaps/drashna/keymap.c
+++ b/keyboards/orthodox/keymaps/drashna/keymap.c
@@ -22,6 +22,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
22#include QMK_KEYBOARD_H 22#include QMK_KEYBOARD_H
23#include "drashna.h" 23#include "drashna.h"
24 24
25#ifdef INDICATOR_LIGHTS
26extern userspace_config_t userspace_config;
27
28uint8_t last_mod;
29uint8_t last_led;
30uint8_t last_osm;
31bool has_mods_changed = false;
32#endif
25 33
26// Each layer gets a name for readability, which is then used in the keymap matrix below. 34// Each layer gets a name for readability, which is then used in the keymap matrix below.
27// The underscores don't mean anything - you can have a layer called STUFF or any other name. 35// The underscores don't mean anything - you can have a layer called STUFF or any other name.
@@ -33,6 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define XXXXXXX KC_NO 41#define XXXXXXX KC_NO
34 42
35 43
44
36const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 45const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
37 46
38[_QWERTY] = LAYOUT_wrapper(\ 47[_QWERTY] = LAYOUT_wrapper(\
@@ -65,27 +74,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65 74
66[_LOWER] = LAYOUT_wrapper(\ 75[_LOWER] = LAYOUT_wrapper(\
67 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, 76 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
68 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, 77 _______, _________________FUNC_LEFT_________________, KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
69 KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, _______ 78 _______, _________________FUNC_RIGHT________________, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______
70), 79),
71 80
72[_RAISE] = LAYOUT_wrapper(\ 81[_RAISE] = LAYOUT_wrapper(\
73 KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_BSPC, 82 KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_BSPC,
74 _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, 83 _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
75 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, _______ 84 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______
76), 85),
77 86
78[_ADJUST] = LAYOUT_wrapper(\ 87[_ADJUST] = LAYOUT_wrapper(\
79 KC_MAKE,KC_RESET, EPRM, _______, _______, _______, _______, _______, _______, _______, _______, _______, 88 KC_MAKE, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5, KC_RESET,
80 RGB_SMOD,RGB_HUI, CK_TOGG, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, TG(_MODS), 89 VRSN, _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, EPRM,
81 KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY 90 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
82) 91)
83 92
84 93
85}; 94};
86 95
87#ifdef RGBLIGHT_ENABLE 96void matrix_init_keymap(void) {
97#ifdef INDICATOR_LIGHTS
98 last_mod = get_mods();
99 last_led = host_keyboard_leds();
100 last_osm =get_oneshot_mods();
101#endif
102}
103
88uint32_t layer_state_set_keymap (uint32_t state) { 104uint32_t layer_state_set_keymap (uint32_t state) {
105#ifdef INDICATOR_LIGHTS
89 uint8_t modifiders = get_mods(); 106 uint8_t modifiders = get_mods();
90 uint8_t led_usb_state = host_keyboard_leds(); 107 uint8_t led_usb_state = host_keyboard_leds();
91 uint8_t one_shot = get_oneshot_mods(); 108 uint8_t one_shot = get_oneshot_mods();
@@ -103,41 +120,49 @@ uint32_t layer_state_set_keymap (uint32_t state) {
103 rgblight_sethsv_at(120, 255, 255, 7); 120 rgblight_sethsv_at(120, 255, 255, 7);
104 rgblight_sethsv_at(120, 255, 255, 8); 121 rgblight_sethsv_at(120, 255, 255, 8);
105 } 122 }
123#endif
106 124
107 return state; 125 return state;
108} 126}
109 127
110 128
111void matrix_scan_keymap (void) { 129void matrix_scan_keymap (void) {
112 static uint8_t current_mods; 130
113 static uint8_t current_host_leds; 131#ifdef INDICATOR_LIGHTS
114 static uint8_t current_oneshot_mods; 132 uint8_t current_mod = get_mods();
115 static bool has_status_changed = true; 133 uint8_t current_led = host_keyboard_leds();
116 134 uint8_t current_osm =get_oneshot_mods();
117 if ( current_mods != get_mods() || current_host_leds != host_keyboard_leds() || current_oneshot_mods != get_oneshot_mods()) { 135
118 has_status_changed = true; 136 if (last_mod == current_mod) {
119 current_mods = get_mods(); 137 last_mod = current_mod;
120 current_host_leds = host_keyboard_leds(); 138 has_mods_changed = true;
121 current_oneshot_mods = get_oneshot_mods(); 139 }
140 if (last_led == current_led) {
141 last_led = current_led;
142 has_mods_changed = true;
122 } 143 }
123 if (has_status_changed) { 144 if (last_osm == current_osm) {
124 has_status_changed = false; 145 last_osm = current_osm;
146 has_mods_changed = true;
147 }
148
125 149
126 if (current_mods & MODS_SHIFT_MASK || current_host_leds & (1<<USB_LED_CAPS_LOCK) || current_oneshot_mods & MODS_SHIFT_MASK) { 150 if (userspace_config.rgb_layer_change && has_mods_changed && biton32(layer_state) == 0) {
151 if (current_mod & MODS_SHIFT_MASK || current_led & (1<<USB_LED_CAPS_LOCK) || current_osm & MODS_SHIFT_MASK) {
127 rgblight_sethsv_at(0, 255, 255, 5); 152 rgblight_sethsv_at(0, 255, 255, 5);
128 rgblight_sethsv_at(0, 255, 255, 10); 153 rgblight_sethsv_at(0, 255, 255, 10);
129 } else { 154 } else {
130 rgblight_sethsv_default_helper(5); 155 rgblight_sethsv_default_helper(5);
131 rgblight_sethsv_default_helper(10); 156 rgblight_sethsv_default_helper(10);
132 } 157 }
133 if (current_mods & MODS_CTRL_MASK || current_oneshot_mods & MODS_CTRL_MASK) { 158 if (current_mod & MODS_CTRL_MASK || current_osm & MODS_CTRL_MASK) {
134 rgblight_sethsv_at(51, 255, 255, 6); 159 rgblight_sethsv_at(51, 255, 255, 6);
135 rgblight_sethsv_at(51, 255, 255, 9); 160 rgblight_sethsv_at(51, 255, 255, 9);
136 } else { 161 } else {
137 rgblight_sethsv_default_helper(6); 162 rgblight_sethsv_default_helper(6);
138 rgblight_sethsv_default_helper(9); 163 rgblight_sethsv_default_helper(9);
139 } 164 }
140 if (current_mods & MODS_GUI_MASK || current_oneshot_mods & MODS_GUI_MASK) { 165 if (current_mod & MODS_GUI_MASK || current_osm & MODS_GUI_MASK) {
141 rgblight_sethsv_at(120, 255, 255, 7); 166 rgblight_sethsv_at(120, 255, 255, 7);
142 rgblight_sethsv_at(120, 255, 255, 8); 167 rgblight_sethsv_at(120, 255, 255, 8);
143 } else { 168 } else {
@@ -146,5 +171,7 @@ void matrix_scan_keymap (void) {
146 171
147 } 172 }
148 } 173 }
149}
150#endif 174#endif
175
176}
177
diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk
index 222a43640..7ea609ede 100644
--- a/keyboards/orthodox/keymaps/drashna/rules.mk
+++ b/keyboards/orthodox/keymaps/drashna/rules.mk
@@ -7,3 +7,4 @@ TAP_DANCE_ENABLE = no
7RGBLIGHT_ENABLE = yes 7RGBLIGHT_ENABLE = yes
8AUDIO_ENABLE = yes 8AUDIO_ENABLE = yes
9NKRO_ENABLE = yes 9NKRO_ENABLE = yes
10INDICATOR_LIGHTS = yes