summaryrefslogtreecommitdiff
path: root/layouts/community/ortho_4x12/drashna
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/community/ortho_4x12/drashna')
-rw-r--r--layouts/community/ortho_4x12/drashna/config.h37
-rw-r--r--layouts/community/ortho_4x12/drashna/keymap.c81
-rw-r--r--layouts/community/ortho_4x12/drashna/rules.mk60
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