Skip to content

Commit

Permalink
[Keymap] Drashna's Hardware Features Experimentations (qmk#6920)
Browse files Browse the repository at this point in the history
* Change RGBLight pin for Planck Light

Move it to A0, so that the SPI? pins are available for BT hackery

* Add QMK DFU bootloader info

* Add Solenoid

* Disable annoying white LED on bottom

* Enable Solenoid on Corne

* Remove bounds for animations

* Increase debounce for Ergodox EZ to reduce repeat key issues

* Set swap hands key to be a hold-tap key

This way, it's not ANNOYING and doesn't swap the hands inteniontally

* Move MT Alt in Corne keymap

* Re-Add fine tuned control of secrets

* Squash mods to single row

* Add LRA settings to haptic feedback settings for Rev6

* Fix issue with non-Planck EZ keymaps

* Add 40 Percent Nano with Analog Joystick

* Add Collide39 keymap

* Fix OLED printing to be more flavorful

* Fix up Iris GamePad and come cleanup

* Expand OLED char map further

* Add modded characters to keylogger

* Here be dragons

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Fix up rules for community layouts

* Some more OLED tweaks

* Add mod mask check function

* Change QMK DFU Audio pin to be correct

* Use manual STM config instead of CTPC for Collide 39
  • Loading branch information
drashna authored Oct 16, 2019
1 parent 8d774da commit 583fc28
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 59 deletions.
2 changes: 1 addition & 1 deletion layouts/community/ergodox/drashna/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine

#undef DEBOUNCE
#define DEBOUNCE 15
#define DEBOUNCE 30

#define TAPPING_TERM_PER_KEY
6 changes: 3 additions & 3 deletions layouts/community/ergodox/drashna/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TAP_DANCE_ENABLE = yes
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
COMMAND_ENABLE = no # Commands for debug and configuration
SPACE_CADET_ENABLE = no
ifneq (,$(findstring ergodox_ez,$(KEYBOARD)))
RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no
ifeq ($(strip $(KEYBOARD)), ergodox_ez)
RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no
endif
CONSOLE_ENABLE = no
BOOTMAGIC_ENABLE = yes
Expand Down
3 changes: 3 additions & 0 deletions layouts/community/ergodox/drashna_glow/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

#undef PRODUCT
#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow

#undef RGB_MATRIX_LED_PROCESS_LIMIT
#undef RGB_MATRIX_LED_FLUSH_LIMIT
6 changes: 3 additions & 3 deletions layouts/community/ergodox/drashna_glow/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ SRC += $(CORRECTED_LAYOUT)/keymap.c

-include $(CORRECTED_LAYOUT)/rules.mk

ifneq (,$(findstring ergodox_ez,$(KEYBOARD)))
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes
ifeq ($(strip $(KEYBOARD)), ergodox_ez)
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes
# TAP_DANCE_ENABLE = no
endif
65 changes: 62 additions & 3 deletions layouts/community/ortho_4x12/drashna/config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
# define RGB_DI_PIN B3
# define RGB_DI_PIN A0
# define RGBLED_NUM 13 // Number of LEDs
# define RGBLIGHT_ANIMATIONS
# define RGBLIGHT_HUE_STEP 12
Expand All @@ -17,10 +17,12 @@
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
// #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
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
# undef RGB_MATRIX_LED_PROCESS_LIMIT
# undef RGB_MATRIX_LED_FLUSH_LIMIT
#endif

#if defined(KEYBOARD_lets_split_rev2)
Expand All @@ -32,7 +34,17 @@
#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
# undef QMK_ESC_INPUT
# define QMK_ESC_INPUT B0 // usually ROW
# undef QMK_LED
# define QMK_LED D6
# undef QMK_SPEAKER
# define QMK_SPEAKER B5
# define SOLENOID_PIN A1
#endif // KEYBOARD_planck_light

#if defined(KEYBOARD_planck)
Expand Down Expand Up @@ -69,3 +81,50 @@

/* 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_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 */

/* 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
/* Library Selection */
#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
/* Library Selection */
#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */

#endif

/* Control 1 register settings */
#define DRIVE_TIME 25
#define AC_COUPLE 0
#define STARTUP_BOOST 1

/* Control 2 Settings */
#define BIDIR_INPUT 1
#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
#define SAMPLE_TIME 3
#define BLANKING_TIME 1
#define IDISS_TIME 1

/* Control 3 settings */
#define NG_THRESH 2
#define ERM_OPEN_LOOP 1
#define SUPPLY_COMP_DIS 0
#define DATA_FORMAT_RTO 0
#define LRA_DRIVE_MODE 0
#define N_PWM_ANALOG 0
#define LRA_OPEN_LOOP 0
/* Control 4 settings */
#define ZC_DET_TIME 0
#define AUTO_CAL_TIME 3
7 changes: 6 additions & 1 deletion layouts/community/ortho_4x12/drashna/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ extern rgblight_config_t rgblight_config;
#ifdef BACKLIGHT_ENABLE
enum planck_keycodes {
BACKLIT = NEW_SAFE_RANGE,
TH_LVL,
};

#else
# define BACKLIT OSM(MOD_LSFT)
enum planck_keycodes {
Expand Down Expand Up @@ -134,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST,
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL,
_______, _______, _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, TG_MODS
HPT_TOG, _______, _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, TG_MODS
)

};
Expand Down Expand Up @@ -298,6 +300,9 @@ void rgb_matrix_indicators_user(void) {
}

void matrix_init_keymap(void) {
# ifdef KEYBOARD_planck_light
writePinLow(D6);
# endif
// rgblight_mode(RGB_MATRIX_MULTISPLASH);
}
#else // RGB_MATRIX_INIT
Expand Down
39 changes: 20 additions & 19 deletions layouts/community/ortho_4x12/drashna/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@ TAP_DANCE_ENABLE = no
AUDIO_ENABLE = yes
SPACE_CADET_ENABLE = no

ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6
RGBLIGHT_ENABLE = yes
INDICATOR_LIGHTS = yes
RGBLIGHT_TWINKLE = yes
RGBLIGHT_STARTUP_ANIMATION = yes
ifneq ($(strip $(KEYBOARD)), planck/rev6)
RGBLIGHT_ENABLE = yes
INDICATOR_LIGHTS = yes
RGBLIGHT_TWINKLE = yes
RGBLIGHT_STARTUP_ANIMATION = yes
endif
ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light
RGB_MATRIX_ENABLE = yes
RGBLIGHT_ENABLE = no
RGBLIGHT_STARTUP_ANIMATION = no
ifeq ($(strip $(KEYBOARD)), planck/light)
RGB_MATRIX_ENABLE = yes
RGBLIGHT_ENABLE = no
RGBLIGHT_STARTUP_ANIMATION = no
HAPTIC_ENABLE += SOLENOID
endif
ifneq (,$(findstring planck/ez,$(KEYBOARD))) # Make sure it IS the Planck Light
RGBLIGHT_ENABLE = no
# SERIAL_LINK_ENABLE = yes
ENCODER_ENABLE = yes
RGB_MATRIX_ENABLE = IS31FL3737
INDICATOR_LIGHTS = yes
RGBLIGHT_TWINKLE = yes
RGBLIGHT_STARTUP_ANIMATION = yes
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
NKRO_ENABLE = no
else
NKRO_ENABLE = yes
NKRO_ENABLE = yes
endif
12 changes: 6 additions & 6 deletions layouts/community/ortho_5x12/drashna/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
TAP_DANCE_ENABLE = no
AUDIO_ENABLE = yes
ifneq (,$(findstring fractal,$(KEYBOARD))) # Make sure it IS the Planck Light
RGB_MATRIX_ENABLE = no
AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGBLIGHT_TWINKLE = yes
BOOTLOADER = qmk-dfu
ifeq ($(strip $(KEYBOARD)), fractal)
RGB_MATRIX_ENABLE = no
AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGBLIGHT_TWINKLE = yes
BOOTLOADER = qmk-dfu
endif

ifeq ($(strip $(PROTOCOL)), VUSB)
Expand Down
7 changes: 7 additions & 0 deletions users/drashna/drashna.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,10 @@ void eeconfig_init_user(void) {
eeconfig_init_keymap();
keyboard_init();
}

bool hasAllBitsInMask(uint8_t value, uint8_t mask) {
value &= 0xF;
mask &= 0xF;

return (value & mask) == mask;
}
1 change: 1 addition & 0 deletions users/drashna/drashna.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ layer_state_t layer_state_set_keymap(layer_state_t state);
layer_state_t default_layer_state_set_keymap(layer_state_t state);
void led_set_keymap(uint8_t usb_led);
void eeconfig_init_keymap(void);
bool hasAllBitsInMask(uint8_t value, uint8_t mask);

typedef union {
uint32_t raw;
Expand Down
38 changes: 20 additions & 18 deletions users/drashna/process_records.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ enum userspace_custom_keycodes {
KC_DVORAK, // Sets default layer to DVORAK
KC_WORKMAN, // Sets default layer to WORKMAN
KC_DIABLO_CLEAR, // Clears all Diablo Timers
KC_MAKE, // Run keyboard's customized make command
KC_RGB_T, // Toggles RGB Layer Indication mode
RGB_IDL, // RGB Idling animations
KC_SECRET_1, // test1
KC_SECRET_2, // test2
KC_SECRET_3, // test3
KC_SECRET_4, // test4
KC_SECRET_5, // test5
KC_CCCV, // Hold to copy, tap to paste
KC_NUKE, // NUCLEAR LAUNCH DETECTED!!!
UC_FLIP, // (ಠ痊ಠ)┻━┻
UC_TABL, // ┬─┬ノ( º _ ºノ)
UC_SHRG, // ¯\_(ツ)_/¯
UC_DISA, // ಠ_ಠ
NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes
KC_MAKE, // Run keyboard's customized make command
KC_RGB_T, // Toggles RGB Layer Indication mode
RGB_IDL, // RGB Idling animations
KC_SECRET_1, // test1
KC_SECRET_2, // test2
KC_SECRET_3, // test3
KC_SECRET_4, // test4
KC_SECRET_5, // test5
KC_CCCV, // Hold to copy, tap to paste
KC_NUKE, // NUCLEAR LAUNCH DETECTED!!!
UC_FLIP, // (ಠ痊ಠ)┻━┻
UC_TABL, // ┬─┬ノ( º _ ºノ)
UC_SHRG, // ¯\_(ツ)_/¯
UC_DISA, // ಠ_ಠ
NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes
};

bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
Expand Down Expand Up @@ -57,9 +57,11 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
#define KC_RST KC_RESET

#ifdef SWAP_HANDS_ENABLE
# define KC_C1R3 SH_TT
# define KC_C1R3 SH_T(KC_TAB)
#elif defined(DRASHNA_LP)
# define KC_C1R3 TG(_GAMEPAD)
#else // SWAP_HANDS_ENABLE
# define KC_C1R3 KC_BSPC
# define KC_C1R3 KC_TAB
#endif // SWAP_HANDS_ENABLE

#define BK_LWER LT(_LOWER, KC_BSPC)
Expand All @@ -79,7 +81,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
#define OS_RCTL OSM(MOD_RCTL)
#define OS_LALT OSM(MOD_LALT)
#define OS_RALT OSM(MOD_RALT)
#define OS_MEH OSM(MOD_MEH)
#define OS_MEH OSM(MOD_MEH)
#define OS_HYPR OSM(MOD_HYPR)

#define ALT_APP ALT_T(KC_APP)
Expand Down
13 changes: 8 additions & 5 deletions users/drashna/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ SRC += drashna.c \
LINK_TIME_OPTIMIZATION_ENABLE = yes
SPACE_CADET_ENABLE = no

ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
SRC += secrets.c
ifneq ($(strip $(NO_SECRETS)), yes)
ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
SRC += secrets.c
endif
ifeq ($(strip $(NO_SECRETS)), lite)
OPT_DEFS += -DNO_SECRETS
endif
endif

ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
Expand All @@ -14,9 +19,7 @@ endif



ifeq ($(strip $(NO_SECRETS)), yes)
OPT_DEFS += -DNO_SECRETS
endif


ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
SRC += rgb_stuff.c
Expand Down

0 comments on commit 583fc28

Please sign in to comment.