diff options
author | Drashna Jaelre <drashna@live.com> | 2019-11-20 12:37:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 12:37:24 -0800 |
commit | eb91c962886b1bb52c2d457a574cba09e2a8b0f0 (patch) | |
tree | 20f3d49671b6d42ca1edf285431e3e4120551228 /layouts/community/ortho_4x12/drashna | |
parent | 8e8986b2506ca4cdd2339a441314a0838e3a4329 (diff) |
[Keymap] All about (ARM) RGB and OLEDs (drashna keymaps) (#7354)
* Add Kyria Keymap
* Enable all RGBLIGHT Animations for ARM and high capacity AVR
* Reduce GNUC version for __has_include
* Cleanup Ortho 4x12 Community layout
* Update Collide 39 keymap
* Cleanup Keymaps
* Enable full 30 LEDs for Ergodox
* Change EEPROM Load timing
* Use RGB Matrix on Planck Rev6
* Use correct keymap swap
* Enable everything for ARM
* Only enable rgb sleep on avr until crash is fixed
* Add additional Kyria keymap config
* Overhaul Kyria OLED display
* Improve kyria keymap based on usage
* Minor tweaks to rules
* Update OLED code to truncate properly
* Fix RGB Light layer indication
* Switch all of biton32 to get_highest_layer function
* Fix OLED Keylogger display
* Run qmk cformat over all of my user files
* Slight tweak to kyria based on usage
* Move around LALT_T config
* Add comments about base wrappers to keymaps
* Another cformat pass
* Temp fix for VUSB boards and NKRO
* Convert tabs to spaces in rules.mk files
* Only enable RGBLight if it's enabled
* Add Encoder Flip setting
* Update OLED font file
Diffstat (limited to 'layouts/community/ortho_4x12/drashna')
-rw-r--r-- | layouts/community/ortho_4x12/drashna/config.h | 37 | ||||
-rw-r--r-- | layouts/community/ortho_4x12/drashna/keymap.c | 81 | ||||
-rw-r--r-- | layouts/community/ortho_4x12/drashna/rules.mk | 60 |
3 files changed, 102 insertions, 76 deletions
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index d8ac5e6d11..663708afa6 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -1,9 +1,10 @@ #pragma once #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) -# define RGB_DI_PIN A0 -# define RGBLED_NUM 13 // Number of LEDs -# define RGBLIGHT_ANIMATIONS +# if defined(KEYBOARD_planck_light) +# define RGB_DI_PIN A0 +# define RGBLED_NUM 13 // Number of LEDs +# endif # define RGBLIGHT_HUE_STEP 12 # define RGBLIGHT_SAT_STEP 12 # define RGBLIGHT_VAL_STEP 12 @@ -23,6 +24,9 @@ # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended # undef RGB_MATRIX_LED_PROCESS_LIMIT # undef RGB_MATRIX_LED_FLUSH_LIMIT +# ifdef KEYBOARD_planck_rev6 +# define DRIVER_LED_TOTAL RGBLED_NUM +# endif #endif #if defined(KEYBOARD_lets_split_rev2) @@ -34,7 +38,7 @@ #if !defined(KEYBOARD_planck_light) # ifdef RGBLIGHT_ENABLE # define NO_MUSIC_MODE -# endif // RGBLIGHT_ENABLE +# endif // RGBLIGHT_ENABLE #else # undef QMK_ESC_OUTPUT # define QMK_ESC_OUTPUT E6 // usually COL @@ -45,7 +49,7 @@ # undef QMK_SPEAKER # define QMK_SPEAKER B5 # define SOLENOID_PIN A1 -#endif // KEYBOARD_planck_light +#endif // KEYBOARD_planck_light #if defined(KEYBOARD_planck) # undef PRODUCT @@ -58,6 +62,7 @@ # endif #endif +#define ENCODER_DIRECTION_FLIP /* * MIDI options */ @@ -82,26 +87,26 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ #define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ -#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ /* default 3V ERM vibration motor voltage and library*/ #if FB_ERM_LRA == 0 -#define RATED_VOLTAGE 3 -#define V_RMS 2.3 -#define V_PEAK 3.30 +# define RATED_VOLTAGE 3 +# define V_RMS 2.3 +# define V_PEAK 3.30 /* Library Selection */ -#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +# define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ /* default 2V LRA voltage and library */ #elif FB_ERM_LRA == 1 -#define RATED_VOLTAGE 2 -#define V_RMS 2.0 -#define V_PEAK 2.85 -#define F_LRA 200 +# define RATED_VOLTAGE 2 +# define V_RMS 2.0 +# define V_PEAK 2.85 +# define F_LRA 200 /* Library Selection */ -#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +# define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ #endif diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 1c894c7649..c3899cd036 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -1,20 +1,3 @@ -/* Copyright 2015-2017 Jack Humbert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include QMK_KEYBOARD_H #include "drashna.h" #ifdef RGBLIGHT_ENABLE @@ -46,6 +29,13 @@ enum planck_keycodes { # define PLNK_4 ET_RAIS #endif +/* + * The `LAYOUT_ortho_4x12_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ // clang-format off #define LAYOUT_ortho_4x12_base( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ @@ -54,7 +44,7 @@ enum planck_keycodes { ) \ LAYOUT_ortho_4x12_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_DEL, \ - KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) @@ -159,14 +149,14 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { #ifdef KEYBOARD_planck_ez case TH_LVL: if (record->event.pressed) { - keyboard_config.led_level++; - if (keyboard_config.led_level > 4) { + keyboard_config.led_level++; + if (keyboard_config.led_level > 4) { keyboard_config.led_level = 0; - } - planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); - planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); - eeconfig_update_kb(keyboard_config.raw); - layer_state_set_kb(layer_state); + } + planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4); + planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4); + eeconfig_update_kb(keyboard_config.raw); + layer_state_set_kb(layer_state); } break; #endif @@ -190,6 +180,31 @@ bool music_mask_user(uint16_t keycode) { #ifdef RGB_MATRIX_ENABLE +# ifdef KEYBOARD_planck_rev6 +// clang-format off +led_config_t g_led_config = { + { + // Key Matrix to LED Index + { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, + { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, + { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED } + }, { + // LED Index to Physical Position + {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} + }, { + // LED Index to Flag + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL + } +}; +// clange-format on +# endif + // clang-format off void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); @@ -219,7 +234,7 @@ void rgb_matrix_indicators_user(void) { rgb_matrix_config.enable # endif ) { - switch (biton32(layer_state)) { + switch (get_highest_layer(layer_state)) { case _GAMEPAD: rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); break; @@ -237,7 +252,7 @@ void rgb_matrix_indicators_user(void) { break; default: { bool mods_enabled = IS_LAYER_ON(_MODS); - switch (biton32(default_layer_state)) { + switch (get_highest_layer(default_layer_state)) { case _QWERTY: rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); break; @@ -268,7 +283,7 @@ void rgb_matrix_indicators_user(void) { } } - switch (biton32(default_layer_state)) { + switch (get_highest_layer(default_layer_state)) { case _QWERTY: rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); break; @@ -283,7 +298,9 @@ void rgb_matrix_indicators_user(void) { break; } if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { - if (!layer_state_cmp(layer_state, _ADJUST)) { rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); } + if (!layer_state_cmp(layer_state, _ADJUST)) { + rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); + } rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); } if ((this_mod | this_osm) & MOD_MASK_CTRL) { @@ -320,7 +337,7 @@ void matrix_init_keymap(void) { #ifdef ENCODER_ENABLE void encoder_update(bool clockwise) { - switch (biton32(layer_state)) { + switch (get_highest_layer(layer_state)) { case _RAISE: clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); break; @@ -363,7 +380,7 @@ void dip_update(uint8_t index, bool active) { } break; case 2: - keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = active; + keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = active; break; case 3: userspace_config.nuke_switch = active; @@ -376,7 +393,7 @@ void dip_update(uint8_t index, bool active) { layer_state_t layer_state_set_keymap(layer_state_t state) { planck_ez_left_led_off(); planck_ez_right_led_off(); - switch (biton32(state)) { + switch (get_highest_layer(state)) { case _LOWER: planck_ez_left_led_on(); break; diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index d4726b7a84..38d0d45176 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -1,36 +1,40 @@ -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -AUDIO_ENABLE = yes +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +TAP_DANCE_ENABLE = no +AUDIO_ENABLE = yes SPACE_CADET_ENABLE = no +NKRO_ENABLE = yes ifneq ($(strip $(KEYBOARD)), planck/rev6) - RGBLIGHT_ENABLE = yes - INDICATOR_LIGHTS = yes - RGBLIGHT_TWINKLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes + CONSOLE_ENABLE = no + COMMAND_ENABLE = no + ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) + RGBLIGHT_ENABLE = yes + endif + INDICATOR_LIGHTS = yes + RGBLIGHT_TWINKLE = yes + RGBLIGHT_STARTUP_ANIMATION = yes +else + CONSOLE_ENABLE = yes + COMMAND_ENABLE = yes + RGBLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = WS2812 endif ifeq ($(strip $(KEYBOARD)), planck/light) - RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = no - RGBLIGHT_STARTUP_ANIMATION = no - HAPTIC_ENABLE += SOLENOID + RGB_MATRIX_ENABLE = yes + RGBLIGHT_ENABLE = no + RGBLIGHT_STARTUP_ANIMATION = no + # HAPTIC_ENABLE += SOLENOID endif ifeq ($(strip $(KEYBOARD)), planck/ez) - RGBLIGHT_ENABLE = no - # SERIAL_LINK_ENABLE = yes - ENCODER_ENABLE = yes - RGB_MATRIX_ENABLE = IS31FL3737 - INDICATOR_LIGHTS = yes - RGBLIGHT_TWINKLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes -endif - -ifeq ($(strip $(PROTOCOL)), VUSB) - NKRO_ENABLE = no -else - NKRO_ENABLE = yes + RGBLIGHT_ENABLE = no + # SERIAL_LINK_ENABLE = yes + ENCODER_ENABLE = yes + RGB_MATRIX_ENABLE = IS31FL3737 + INDICATOR_LIGHTS = yes + RGBLIGHT_TWINKLE = yes + RGBLIGHT_STARTUP_ANIMATION = yes + CONSOLE_ENABLE = yes + COMMAND_ENABLE = yes endif |