aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-11-05 21:36:26 -0800
committerJack Humbert <jack.humb@gmail.com>2018-11-06 00:36:26 -0500
commitf2101cfb6a2270345fe6235d4c36e2e0d49db528 (patch)
treedfa98b41f5dc9afd377712bb54aa6c0dde848178
parent672926562519c1ee7370b3ef188c11525de326e5 (diff)
downloadqmk_firmware-f2101cfb6a2270345fe6235d4c36e2e0d49db528.tar.gz
qmk_firmware-f2101cfb6a2270345fe6235d4c36e2e0d49db528.zip
Update to drashna keymaps (#4365)
* Consistency fixes and more eeprom defaults * Handle setting Unicode mode on eeprom reset better * Unicode EEPROM hack * Re-enable permissive hold and ignore mod tap * Set unicode input mode * More unicode stuff * more haaaaaacks * Attempted RGB Cleanup * Fix compiler issue * Add GitLab CI config for personal compiling * Add avr gcc version to GitLab CI script * Add rgblight init to matrix init
-rw-r--r--layouts/community/ergodox/drashna/keymap.c2
-rw-r--r--layouts/community/ortho_4x12/drashna/config.h2
-rw-r--r--layouts/community/ortho_4x12/drashna/keymap.c52
-rw-r--r--users/drashna/.gitlab-ci.yml26
-rw-r--r--users/drashna/config.h4
-rw-r--r--users/drashna/drashna.c40
-rw-r--r--users/drashna/rgb_stuff.c35
7 files changed, 98 insertions, 63 deletions
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c
index 518eaf034..360a2d9c6 100644
--- a/layouts/community/ergodox/drashna/keymap.c
+++ b/layouts/community/ergodox/drashna/keymap.c
@@ -40,7 +40,7 @@ bool skip_leds = false;
40 KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ 40 KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \
41 KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ 41 KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
42 KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ 42 KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \
43 KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_IRNY, \ 43 KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_SHRG, \
44 OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ 44 OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \
45 KC_HOME, KC_PGUP, \ 45 KC_HOME, KC_PGUP, \
46 LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ 46 LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h
index b4c780cc1..f279651b6 100644
--- a/layouts/community/ortho_4x12/drashna/config.h
+++ b/layouts/community/ortho_4x12/drashna/config.h
@@ -18,7 +18,7 @@
18#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) 18#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
19// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) 19// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
20// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects 20// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
21#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended 21// #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
22// #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 22// #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1
23// #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 23// #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
24// #define EECONFIG_RGB_MATRIX (uint32_t *)16 24// #define EECONFIG_RGB_MATRIX (uint32_t *)16
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c
index 108df6931..2a9e32cc8 100644
--- a/layouts/community/ortho_4x12/drashna/keymap.c
+++ b/layouts/community/ortho_4x12/drashna/keymap.c
@@ -17,6 +17,10 @@
17#include QMK_KEYBOARD_H 17#include QMK_KEYBOARD_H
18#include "drashna.h" 18#include "drashna.h"
19 19
20#ifdef RGB_MATRIX_ENABLE
21extern bool g_suspend_state;
22#endif
23
20#ifdef BACKLIGHT_ENABLE 24#ifdef BACKLIGHT_ENABLE
21enum planck_keycodes { 25enum planck_keycodes {
22 BACKLIT = NEW_SAFE_RANGE, 26 BACKLIT = NEW_SAFE_RANGE,
@@ -135,6 +139,15 @@ bool music_mask_user(uint16_t keycode) {
135 139
136#ifdef RGB_MATRIX_ENABLE 140#ifdef RGB_MATRIX_ENABLE
137 141
142void suspend_power_down_keymap(void)
143{
144 rgb_matrix_set_suspend_state(true);
145}
146
147void suspend_wakeup_init_keymap(void)
148{
149 rgb_matrix_set_suspend_state(false);
150}
138 151
139void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { 152void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
140 rgb_led led; 153 rgb_led led;
@@ -152,25 +165,26 @@ void rgb_matrix_indicators_user(void) {
152 uint8_t this_mod = get_mods(); 165 uint8_t this_mod = get_mods();
153 uint8_t this_led = host_keyboard_leds(); 166 uint8_t this_led = host_keyboard_leds();
154 uint8_t this_osm = get_oneshot_mods(); 167 uint8_t this_osm = get_oneshot_mods();
155 168 if (!g_suspend_state) {
156 switch (biton32(layer_state)) { 169 switch (biton32(layer_state)) {
157 case _RAISE: 170 case _RAISE:
158 rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; 171 rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break;
159 case _LOWER: 172 case _LOWER:
160 rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; 173 rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break;
161 case _ADJUST: 174 case _ADJUST:
162 rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; 175 rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break;
163 default: 176 default:
164 switch (biton32(default_layer_state)) { 177 switch (biton32(default_layer_state)) {
165 case _QWERTY: 178 case _QWERTY:
166 rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; 179 rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break;
167 case _COLEMAK: 180 case _COLEMAK:
168 rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; 181 rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break;
169 case _DVORAK: 182 case _DVORAK:
170 rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; 183 rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break;
171 case _WORKMAN: 184 case _WORKMAN:
172 rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; 185 rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break;
173 } 186 }
187 }
174 } 188 }
175 189
176 switch (biton32(default_layer_state)) { 190 switch (biton32(default_layer_state)) {
diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml
new file mode 100644
index 000000000..3c95ad850
--- /dev/null
+++ b/users/drashna/.gitlab-ci.yml
@@ -0,0 +1,26 @@
1stages:
2 - build
3
4qmk_firmware:
5 stage: build
6 variables:
7 GIT_SUBMODULE_STRATEGY: recursive
8 tags:
9 - linux
10 image: ubuntu
11 before_script:
12 - apt-get update -qy
13 - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util diffutils gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip
14 - avr-gcc --version
15 script:
16 - make iris/rev2:drashna iris/rev2:drashna_old ergodox_ez:drashna viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna
17 artifacts:
18 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
19 paths:
20 - ./*.hex
21 - ./*.bin
22 only:
23 - master
24 - drashna_keymaps
25 - merge-requests
26 - branches
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 9d7d20add..7e6a7d1c8 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -44,8 +44,8 @@
44// and when this option isn't enabled, z rapidly followed by x 44// and when this option isn't enabled, z rapidly followed by x
45// actually sends Ctrl-x. That's bad.) 45// actually sends Ctrl-x. That's bad.)
46#define IGNORE_MOD_TAP_INTERRUPT 46#define IGNORE_MOD_TAP_INTERRUPT
47#undef PERMISSIVE_HOLD 47#define PERMISSIVE_HOLD
48// #define TAPPING_FORCE_HOLD 48//#define TAPPING_FORCE_HOLD
49//#define RETRO_TAPPING 49//#define RETRO_TAPPING
50 50
51#define FORCE_NKRO 51#define FORCE_NKRO
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index b2219e9aa..4111d2931 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -20,6 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include "rgb_stuff.h" 20#include "rgb_stuff.h"
21 21
22userspace_config_t userspace_config; 22userspace_config_t userspace_config;
23#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
24 #define DRASHNA_UNICODE_MODE UC_WIN
25#else
26 // set to 2 for UC_WIN, set to 4 for UC_WINC
27 #define DRASHNA_UNICODE_MODE 2
28#endif
23 29
24uint16_t copy_paste_timer; 30uint16_t copy_paste_timer;
25// Helper Functions 31// Helper Functions
@@ -154,19 +160,18 @@ void matrix_init_user(void) {
154 160
155 userspace_config.raw = eeconfig_read_user(); 161 userspace_config.raw = eeconfig_read_user();
156 162
157#ifdef BOOTLOADER_CATERINA 163 #ifdef BOOTLOADER_CATERINA
158 DDRD &= ~(1<<5); 164 DDRD &= ~(1<<5);
159 PORTD &= ~(1<<5); 165 PORTD &= ~(1<<5);
160 166
161 DDRB &= ~(1<<0); 167 DDRB &= ~(1<<0);
162 PORTB &= ~(1<<0); 168 PORTB &= ~(1<<0);
163#endif 169 #endif
164 170
165#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) 171 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
166 if (eeprom_read_byte(EECONFIG_UNICODEMODE) != UC_WIN) { 172 set_unicode_input_mode(DRASHNA_UNICODE_MODE);
167 set_unicode_input_mode(UC_WIN); 173 get_unicode_input_mode();
168 } 174 #endif //UNICODE_ENABLE
169#endif //UNICODE_ENABLE
170 matrix_init_keymap(); 175 matrix_init_keymap();
171} 176}
172 177
@@ -266,9 +271,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
266 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader 271 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
267 if (!record->event.pressed) { 272 if (!record->event.pressed) {
268 uint8_t temp_mod = get_mods(); 273 uint8_t temp_mod = get_mods();
269 clear_mods(); 274 uint8_t temp_osm = get_oneshot_mods();
275 clear_mods(); clear_oneshot_mods();
270 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); 276 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
271 if (temp_mod & MODS_SHIFT_MASK) { 277 if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) {
272 #if defined(__ARM__) 278 #if defined(__ARM__)
273 send_string_with_delay_P(PSTR(":dfu-util"), 10); 279 send_string_with_delay_P(PSTR(":dfu-util"), 10);
274 #elif defined(BOOTLOADER_DFU) 280 #elif defined(BOOTLOADER_DFU)
@@ -282,7 +288,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
282 #if defined(KEYBOARD_viterbi) 288 #if defined(KEYBOARD_viterbi)
283 send_string_with_delay_P(PSTR(":dfu"), 10); 289 send_string_with_delay_P(PSTR(":dfu"), 10);
284 #endif 290 #endif
285 if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } 291 if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); }
286 send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); 292 send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
287 set_mods(temp_mod); 293 set_mods(temp_mod);
288 } 294 }
@@ -422,4 +428,10 @@ void eeconfig_init_user(void) {
422 userspace_config.raw = 0; 428 userspace_config.raw = 0;
423 userspace_config.rgb_layer_change = true; 429 userspace_config.rgb_layer_change = true;
424 eeconfig_update_user(userspace_config.raw); 430 eeconfig_update_user(userspace_config.raw);
431 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
432 set_unicode_input_mode(DRASHNA_UNICODE_MODE);
433 get_unicode_input_mode();
434 #else
435 eeprom_update_byte(EECONFIG_UNICODEMODE, DRASHNA_UNICODE_MODE);
436 #endif
425} 437}
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 9ad94c0c3..b6de4d39e 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -12,14 +12,6 @@ void rgblight_sethsv_default_helper(uint8_t index) {
12#endif // RGBLIGHT_ENABLE 12#endif // RGBLIGHT_ENABLE
13 13
14#ifdef INDICATOR_LIGHTS 14#ifdef INDICATOR_LIGHTS
15uint8_t last_mod;
16uint8_t last_led;
17uint8_t last_osm;
18uint8_t current_mod;
19uint8_t current_led;
20uint8_t current_osm;
21
22
23void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { 15void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
24 if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { 16 if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) {
25 if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { 17 if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) {
@@ -86,16 +78,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
86} 78}
87 79
88void matrix_scan_indicator(void) { 80void matrix_scan_indicator(void) {
89 current_mod = get_mods(); 81 set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
90 current_led = host_keyboard_leds();
91 current_osm = get_oneshot_mods();
92
93 set_rgb_indicators(current_mod, current_led, current_osm);
94
95 last_mod = current_mod;
96 last_led = current_led;
97 last_osm = current_osm;
98
99} 82}
100#endif //INDICATOR_LIGHTS 83#endif //INDICATOR_LIGHTS
101 84
@@ -255,13 +238,9 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
255 238
256 239
257void matrix_init_rgb(void) { 240void matrix_init_rgb(void) {
258#ifdef INDICATOR_LIGHTS
259 current_mod = last_mod = get_mods();
260 current_led = last_led = host_keyboard_leds();
261 current_osm = last_osm = get_oneshot_mods();
262#endif
263 241
264 if (userspace_config.rgb_layer_change) { 242 if (userspace_config.rgb_layer_change) {
243 rgblight_init();
265 rgblight_enable_noeeprom(); 244 rgblight_enable_noeeprom();
266 switch (biton32(eeconfig_read_default_layer())) { 245 switch (biton32(eeconfig_read_default_layer())) {
267 case _COLEMAK: 246 case _COLEMAK:
@@ -291,6 +270,7 @@ void matrix_scan_rgb(void) {
291 270
292uint32_t layer_state_set_rgb(uint32_t state) { 271uint32_t layer_state_set_rgb(uint32_t state) {
293#ifdef RGBLIGHT_ENABLE 272#ifdef RGBLIGHT_ENABLE
273 static bool has_ran;
294 if (userspace_config.rgb_layer_change) { 274 if (userspace_config.rgb_layer_change) {
295 switch (biton32(state)) { 275 switch (biton32(state)) {
296 case _MACROS: 276 case _MACROS:
@@ -332,7 +312,12 @@ uint32_t layer_state_set_rgb(uint32_t state) {
332 default: 312 default:
333 rgblight_sethsv_noeeprom_cyan(); break; 313 rgblight_sethsv_noeeprom_cyan(); break;
334 } 314 }
335 biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it 315 if (has_ran) {
316 biton32(state) == _MODS ? rgblight_mode(RGBLIGHT_MODE_BREATHING) : rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
317 } else {
318 biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
319 has_ran = true;
320 }
336 break; 321 break;
337 } 322 }
338// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow 323// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow
@@ -341,5 +326,3 @@ uint32_t layer_state_set_rgb(uint32_t state) {
341 326
342 return state; 327 return state;
343} 328}
344
345