From dc3e8442a809bbb594fc70445a508b4dd175d830 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 7 Sep 2019 13:18:45 -0700 Subject: [PATCH 01/25] Change RGBLight pin for Planck Light Move it to A0, so that the SPI? pins are available for BT hackery --- layouts/community/ortho_4x12/drashna/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 9f3d2b82d6ce..53b68e7c7015 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -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 From 3947142fc414fe697839413c2796e2aa43fc62bd Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 7 Sep 2019 15:49:20 -0700 Subject: [PATCH 02/25] Add QMK DFU bootloader info --- layouts/community/ortho_4x12/drashna/config.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 53b68e7c7015..9424b8647031 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -17,7 +17,7 @@ #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 @@ -32,8 +32,12 @@ #if !defined(KEYBOARD_planck_light) # ifdef RGBLIGHT_ENABLE # define NO_MUSIC_MODE -# endif // RGBLIGHT_ENABLE -#endif // KEYBOARD_planck_light +# endif // RGBLIGHT_ENABLE +# define QMK_ESC_OUTPUT E6 // usually COL +# define QMK_ESC_INPUT B0 // usually ROW +# define QMK_LED D6 +# define QMK_SPEAKER C6 +#endif // KEYBOARD_planck_light #if defined(KEYBOARD_planck) # undef PRODUCT From 32776a44835a97e7ecf9a5803d2650124d4834ee Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 7 Sep 2019 15:55:15 -0700 Subject: [PATCH 03/25] Add Solenoid --- layouts/community/ortho_4x12/drashna/config.h | 10 ++++++++-- layouts/community/ortho_4x12/drashna/keymap.c | 2 +- layouts/community/ortho_4x12/drashna/rules.mk | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 9424b8647031..3dafe6dd35c2 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -33,11 +33,17 @@ # ifdef RGBLIGHT_ENABLE # define NO_MUSIC_MODE # endif // RGBLIGHT_ENABLE +#else +# undef QMK_ESC_OUTPUT # define QMK_ESC_OUTPUT E6 // usually COL -# define QMK_ESC_INPUT B0 // usually ROW +# undef QMK_ESC_INPUT +# define QMK_ESC_INPUT B0 // usually ROW +# undef QMK_LED # define QMK_LED D6 +# undef QMK_SPEAKER # define QMK_SPEAKER C6 -#endif // KEYBOARD_planck_light +# define SOLENOID_PIN A1 +#endif // KEYBOARD_planck_light #if defined(KEYBOARD_planck) # undef PRODUCT diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 26f611c08898..756e95d34ff4 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -134,7 +134,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 ) }; diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 55f3acd70ecf..951144e7dab8 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -17,6 +17,7 @@ ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Lig 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 From 6d7b935112de781fe6294a7be6401fe0e5f6bc7a Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 7 Sep 2019 16:10:48 -0700 Subject: [PATCH 04/25] Disable annoying white LED on bottom --- layouts/community/ortho_4x12/drashna/keymap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 756e95d34ff4..eb9bd4da1ebd 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -298,6 +298,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 From 0c52477dc1003c07a7ebd38225d58a3dd50374dc Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sun, 8 Sep 2019 18:30:18 -0700 Subject: [PATCH 05/25] Enable Solenoid on Corne --- keyboards/crkbd/keymaps/drashna/config.h | 10 +++++++--- keyboards/crkbd/keymaps/drashna/keymap.c | 2 +- keyboards/crkbd/keymaps/drashna/rules.mk | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index d35f723dac77..26af029573bc 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h @@ -41,7 +41,7 @@ along with this program. If not, see . # define RGBLIGHT_HUE_STEP 8 # define RGBLIGHT_SAT_STEP 8 # define RGBLIGHT_VAL_STEP 5 -# define RGBLIGHT_LIMIT_VAL 150 +# define RGBLIGHT_LIMIT_VAL 120 #endif #ifdef RGB_MATRIX_ENABLE @@ -51,7 +51,7 @@ along with this program. If not, see . # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended // # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) // # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) -# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 # define RGB_MATRIX_HUE_STEP 8 # define RGB_MATRIX_SAT_STEP 8 # define RGB_MATRIX_VAL_STEP 5 @@ -60,7 +60,11 @@ along with this program. If not, see . #ifdef AUDIO_ENABLE # define B6_AUDIO -// #define NO_MUSIC_MODE +# define NO_MUSIC_MODE +#endif + +#ifdef HAPTIC_ENABLE +# define SOLENOID_PIN B7 #endif #undef PRODUCT diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 36a5f5dd3379..072a103a4259 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -107,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, MG_NKRO, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, - _______, KC_NUKE, _______, _______, TG_MODS, _______ + HPT_TOG, KC_NUKE, _______, _______, TG_MODS, HPT_FBK ) }; // clang-format on diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index af340459716e..492c17e20fe0 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -18,6 +18,7 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing RGB_MATRIX_ENABLE = WS2812 +HAPTIC_ENABLE = SOLENOID # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend From 8d6942ca0f41f42403bcc19d19d6fbf9bf89b86f Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 18 Sep 2019 08:54:13 -0700 Subject: [PATCH 06/25] Remove bounds for animations --- layouts/community/ergodox/drashna_glow/config.h | 3 +++ layouts/community/ortho_4x12/drashna/config.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/layouts/community/ergodox/drashna_glow/config.h b/layouts/community/ergodox/drashna_glow/config.h index 28bed20e0871..6431cb4ff8d6 100644 --- a/layouts/community/ergodox/drashna_glow/config.h +++ b/layouts/community/ergodox/drashna_glow/config.h @@ -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 diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 3dafe6dd35c2..e1241de898c9 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -21,6 +21,8 @@ // #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) From 0681553abaff1391cf5e2624717f821b33bc56e3 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 18 Sep 2019 08:54:49 -0700 Subject: [PATCH 07/25] Increase debounce for Ergodox EZ to reduce repeat key issues --- layouts/community/ergodox/drashna/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 0ccf10c31c2e..4943832990e0 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -13,6 +13,6 @@ #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine #undef DEBOUNCE -#define DEBOUNCE 15 +#define DEBOUNCE 30 #define TAPPING_TERM_PER_KEY From 622c9d0fc2494034e2b4a9460a0c0becce1ea73e Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 18 Sep 2019 08:57:18 -0700 Subject: [PATCH 08/25] Set swap hands key to be a hold-tap key This way, it's not ANNOYING and doesn't swap the hands inteniontally --- users/drashna/process_records.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index 0ae468a04ed5..feeb0e36936c 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h @@ -57,9 +57,9 @@ 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) #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) From 57c7c765ef18065d426c293829456ec7a6ffe35d Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 18 Sep 2019 09:00:19 -0700 Subject: [PATCH 09/25] Move MT Alt in Corne keymap --- keyboards/crkbd/keymaps/drashna/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 072a103a4259..d6ae2aa75e95 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -27,7 +27,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ - KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ + ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ ) From 3b27761d2ac20e5a87cd6d6320c08246d9503c8a Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Thu, 19 Sep 2019 11:31:38 -0700 Subject: [PATCH 10/25] Re-Add fine tuned control of secrets --- users/drashna/rules.mk | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 7b77a51d963c..1b5a86385027 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -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) @@ -14,9 +19,7 @@ endif -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif + ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) SRC += rgb_stuff.c From 1350689e8fa694da4542c87fd07b6fdb6225d915 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 21 Sep 2019 12:17:28 -0700 Subject: [PATCH 11/25] Squash mods to single row --- keyboards/crkbd/keymaps/drashna/keymap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index d6ae2aa75e95..766468f3f396 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -197,19 +197,18 @@ void render_layer_state(void) { void render_keylock_status(uint8_t led_usb_state) { oled_write_P(PSTR("Lock:"), false); oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("NUM "), led_usb_state & (1 << USB_LED_NUM_LOCK)); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("CAPS"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); - oled_write_P(PSTR(" "), false); - oled_write_P(PSTR("SCRL"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); + oled_write_P(PSTR("N"), led_usb_state & (1 << USB_LED_NUM_LOCK)); + oled_write_P(PSTR("C"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); + oled_write_ln_P(PSTR("S"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); } void render_mod_status(uint8_t modifiers) { oled_write_P(PSTR("Mods:"), false); - oled_write_P(PSTR(" SHFT"), (modifiers & MOD_MASK_SHIFT)); - oled_write_P(PSTR(" CTRL"), (modifiers & MOD_MASK_CTRL)); - oled_write_P(PSTR(" ALT "), (modifiers & MOD_MASK_ALT)); - oled_write_P(PSTR(" GUI "), (modifiers & MOD_MASK_GUI)); + oled_write_P(PSTR(" "), false); + oled_write_P(PSTR("S"), (modifiers & MOD_MASK_SHIFT)); + oled_write_P(PSTR("C"), (modifiers & MOD_MASK_CTRL)); + oled_write_P(PSTR("A"), (modifiers & MOD_MASK_ALT)); + oled_write_ln_P(PSTR("G"), (modifiers & MOD_MASK_GUI)); } void render_bootmagic_status(void) { From e4294bfe46832442d0dea6941f7cb3c0211dc8e9 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sun, 22 Sep 2019 09:18:25 -0700 Subject: [PATCH 12/25] Add LRA settings to haptic feedback settings for Rev6 --- layouts/community/ortho_4x12/drashna/config.h | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index e1241de898c9..e547cd61f1d4 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -81,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 From 15e403d85a704d77bb87332b2d1d06aa8c08af02 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 28 Sep 2019 20:45:59 -0700 Subject: [PATCH 13/25] Fix issue with non-Planck EZ keymaps --- layouts/community/ortho_4x12/drashna/keymap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index eb9bd4da1ebd..1c894c7649c2 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -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 { From 62401f5c3a11ae8a5132e1c3cc58b24e4018d7c9 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 2 Oct 2019 10:45:33 -0700 Subject: [PATCH 14/25] Add 40 Percent Nano with Analog Joystick --- .../nano/keymaps/drashna/keymap.c | 111 ++++++++++++++++++ .../nano/keymaps/drashna/rules.mk | 5 + 2 files changed, 116 insertions(+) create mode 100644 keyboards/40percentclub/nano/keymaps/drashna/keymap.c create mode 100644 keyboards/40percentclub/nano/keymaps/drashna/rules.mk diff --git a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c new file mode 100644 index 000000000000..6c5b97457208 --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c @@ -0,0 +1,111 @@ +#include QMK_KEYBOARD_H +#include "drashna.h" +#include "analog.c" +#include "pointing_device.h" +#include "pincontrol.h" + + +#define KC_X0 LT(_FN, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_VOLU, KC_MPLY, KC_MPRV, RESET, + KC_VOLD, KC_MUTE, KC_MNXT, RESET + ), + +}; + +// Joystick +// Set Pins +uint8_t xPin = 8; // VRx / /B4 +uint8_t yPin = 7; // VRy // B5 +uint8_t swPin = E6; // SW + +// Set Parameters +uint16_t minAxisValue = 0; +uint16_t maxAxisValue = 1023; + +uint8_t maxCursorSpeed = 2; +uint8_t precisionSpeed = 1; +uint8_t speedRegulator = 20; // Lower Values Create Faster Movement + +int8_t xPolarity = 1; +int8_t yPolarity = 1; + +uint8_t cursorTimeout = 10; + +int16_t xOrigin, yOrigin; + +uint16_t lastCursor = 0; + +int16_t axisCoordinate(uint8_t pin, uint16_t origin) { + int8_t direction; + int16_t distanceFromOrigin; + int16_t range; + + int16_t position = analogRead(pin); + + if (origin == position) { + return 0; + } else if (origin > position) { + distanceFromOrigin = origin - position; + range = origin - minAxisValue; + direction = -1; + } else { + distanceFromOrigin = position - origin; + range = maxAxisValue - origin; + direction = 1; + } + + float percent = (float)distanceFromOrigin / range; + int16_t coordinate = (int16_t)(percent * 100); + if (coordinate < 0) { + return 0; + } else if (coordinate > 100) { + return 100 * direction; + } else { + return coordinate * direction; + } +} + +int8_t axisToMouseComponent(uint8_t pin, int16_t origin, uint8_t maxSpeed, int8_t polarity) { + int coordinate = axisCoordinate(pin, origin); + if (coordinate == 0) { + return 0; + } else { + float percent = (float)coordinate / 100; + if (keyboard_report->mods & MOD_BIT(KC_LSFT)) { + return percent * precisionSpeed * polarity * (abs(coordinate) / speedRegulator); + } else { + return percent * maxCursorSpeed * polarity * (abs(coordinate) / speedRegulator); + } + } +} + +void pointing_device_task(void) { + report_mouse_t report = pointing_device_get_report(); + + // todo read as one vector + if (timer_elapsed(lastCursor) > cursorTimeout) { + lastCursor = timer_read(); + report.x = axisToMouseComponent(xPin, xOrigin, maxCursorSpeed, xPolarity); + report.y = axisToMouseComponent(yPin, yOrigin, maxCursorSpeed, yPolarity); + } + // + if (!readPin(swPin)) { + report.buttons |= MOUSE_BTN1; + } else { + report.buttons &= ~MOUSE_BTN1; + } + + pointing_device_set_report(report); + pointing_device_send(); +} + +void matrix_init_keymap(void) { + // init pin? Is needed? + setPinInputHigh(swPin); + // Account for drift + xOrigin = analogRead(xPin); + yOrigin = analogRead(yPin); +} diff --git a/keyboards/40percentclub/nano/keymaps/drashna/rules.mk b/keyboards/40percentclub/nano/keymaps/drashna/rules.mk new file mode 100644 index 000000000000..06110a0a2e29 --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/drashna/rules.mk @@ -0,0 +1,5 @@ +POINTING_DEVICE_ENABLE = yes +RGBLIGHT_ENABLE = no +CONSOLE_ENABLE = no + +BOOTLOADER = qmk-dfu From 7f18f74ef7d6a34e53c144265ae0e843012635cb Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 4 Oct 2019 01:39:02 -0700 Subject: [PATCH 15/25] Add Collide39 keymap --- keyboards/c39/keymaps/drashna/config.h | 5 +++ keyboards/c39/keymaps/drashna/keymap.c | 45 +++++++++++++++++++++++++ keyboards/c39/keymaps/drashna/readme.md | 1 + keyboards/c39/keymaps/drashna/rules.mk | 17 ++++++++++ 4 files changed, 68 insertions(+) create mode 100755 keyboards/c39/keymaps/drashna/config.h create mode 100755 keyboards/c39/keymaps/drashna/keymap.c create mode 100755 keyboards/c39/keymaps/drashna/readme.md create mode 100644 keyboards/c39/keymaps/drashna/rules.mk diff --git a/keyboards/c39/keymaps/drashna/config.h b/keyboards/c39/keymaps/drashna/config.h new file mode 100755 index 000000000000..918b85fb40de --- /dev/null +++ b/keyboards/c39/keymaps/drashna/config.h @@ -0,0 +1,5 @@ +#pragma once + +// place overrides here +#undef MATRIX_COL_PINS +#define MATRIX_COL_PINS { PAL_LINE(GPIOA, 3), F4, F5, F6, B1, B3, B2, B6, D7, E6, C6, D2, D3 } diff --git a/keyboards/c39/keymaps/drashna/keymap.c b/keyboards/c39/keymaps/drashna/keymap.c new file mode 100755 index 000000000000..9de75190d030 --- /dev/null +++ b/keyboards/c39/keymaps/drashna/keymap.c @@ -0,0 +1,45 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _FN1 1 + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,----------------------------------------------------------------------------. ,-------------. + * | Q | W | E | R | T | Bksp | Y | U | I | O | P | | M1 | M2 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | A | S | D | F | G | Enter| H | J | K | L | ; | | M3 | M4 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | Z | X | C | V | B | FN1 | N | M | , | . | / | | M5 | M6 | + * `----------------------------------------------------------------------------' `-------------' + */ +[_QWERTY] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_1, KC_2, + KC_A, KC_S, KC_D, KC_F, KC_G, MT(MOD_LSFT, KC_ENT), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_3, KC_4, + KC_Z, KC_X, KC_C, KC_V, KC_B, LT(_FN1, KC_SPC), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_5, KC_6 +), + +/* FN1 + * ,----------------------------------------------------------------------------. ,-------------. + * | 1 | 2 | 3 | 4 | 5 | Bksp | 6 | 7 | 8 | 9 | 0 | | M1 | M2 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | 4 | 5 | 6 | + | | Enter| | | | | | | M3 | M4 | + * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| + * | 7 | 8 | 9 | 0 | | FN1 | | | | | | | M5 | M6 | + * `----------------------------------------------------------------------------' `-------------' + */ +[_FN1] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_BSPC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_1, KC_2, + KC_4, KC_5, KC_6, KC_PLUS, _______, KC_ENT, _______, _______, _______, _______, _______, KC_3, KC_4, + KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, _______, KC_5, KC_6 +), +}; diff --git a/keyboards/c39/keymaps/drashna/readme.md b/keyboards/c39/keymaps/drashna/readme.md new file mode 100755 index 000000000000..f5b1b6ac1145 --- /dev/null +++ b/keyboards/c39/keymaps/drashna/readme.md @@ -0,0 +1 @@ +# The default keymap for the C39 diff --git a/keyboards/c39/keymaps/drashna/rules.mk b/keyboards/c39/keymaps/drashna/rules.mk new file mode 100644 index 000000000000..50591d97049a --- /dev/null +++ b/keyboards/c39/keymaps/drashna/rules.mk @@ -0,0 +1,17 @@ +CTPC = yes + +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = yes # Audio output on port C6 +RGBLIGHT_ENABLE = no # RGB Enable / Disable From e8c1310f1033318bfa529814f35f4e5ad8f461a8 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 4 Oct 2019 21:14:36 -0700 Subject: [PATCH 16/25] Fix OLED printing to be more flavorful --- keyboards/crkbd/keymaps/drashna/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 766468f3f396..0183b117f0d2 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -12,7 +12,7 @@ extern rgblight_config_t rgblight_config; static uint32_t oled_timer = 0; static char keylog_str[6] = {}; static uint16_t log_timer = 0; -static const char code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; +static const char PROGMEM code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; void add_keylog(uint16_t keycode); #endif @@ -139,8 +139,8 @@ void add_keylog(uint16_t keycode) { keylog_str[i] = keylog_str[i - 1]; } - if (keycode < 60) { - keylog_str[0] = code_to_name[keycode]; + if (keycode < (sizeof(code_to_name) / sizeof(char))) { + keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); } log_timer = timer_read(); From bbf7c929e744b3e76d57d1c3bbc456112d3e71ad Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 5 Oct 2019 08:55:43 -0700 Subject: [PATCH 17/25] Fix up Iris GamePad and come cleanup --- .../keebio/iris/keymaps/drashna/keymap.c | 4 +-- .../keebio/iris/keymaps/drashna_lp/config.h | 13 ++++--- users/drashna/process_records.h | 34 ++++++++++--------- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index 28783dd8af5a..de19f7ca08c9 100644 --- a/keyboards/keebio/iris/keymaps/drashna/keymap.c +++ b/keyboards/keebio/iris/keymaps/drashna/keymap.c @@ -77,11 +77,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_GAMEPAD] = LAYOUT_wrapper( - KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_P, _______, _______, _______, _______, _______, _______, + KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, _______, _______, _______, _______, _______, _______, KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, TG_GAME, _______, _______, _______, _______, _______, _______, _______, - LOWER, KC_V, KC_SPC, _______, _______, _______ + KC_GRV, KC_V, KC_SPC, _______, _______, _______ ), diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/config.h b/keyboards/keebio/iris/keymaps/drashna_lp/config.h index d59890b46a39..5370d88ed4b9 100644 --- a/keyboards/keebio/iris/keymaps/drashna_lp/config.h +++ b/keyboards/keebio/iris/keymaps/drashna_lp/config.h @@ -21,15 +21,16 @@ along with this program. If not, see . #include "../drashna/config.h" #ifdef RGBLIGHT_ENABLE -# undef RGBLED_NUM -# define RGBLED_NUM 16 // Number of LEDs -# undef RGBLED_SPLIT -# define RGBLED_SPLIT { 8, 8 } +# undef RGBLED_NUM +# define RGBLED_NUM 16 // Number of LEDs +# undef RGBLED_SPLIT +# define RGBLED_SPLIT \ + { 8, 8 } #endif #undef PRODUCT #ifdef KEYBOARD_keebio_iris_rev2 -# define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) +# define PRODUCT Drashna Hacked Iris LP Rev .2(Backlit) #endif #undef SHFT_LED1 @@ -46,3 +47,5 @@ along with this program. If not, see . #define ALT_LED1 7 #undef GUI_LED1 #define GUI_LED1 8 + +#define DRASHNA_LP diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index feeb0e36936c..cb7ec3ec401d 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h @@ -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); @@ -58,6 +58,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #ifdef SWAP_HANDS_ENABLE # define KC_C1R3 SH_T(KC_TAB) +#elif defined(DRASHNA_LP) +# define KC_C1R3 TG(_GAMEPAD) #else // SWAP_HANDS_ENABLE # define KC_C1R3 KC_TAB #endif // SWAP_HANDS_ENABLE @@ -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) From 9a71f2b1a93889b9603b19ce06e680979f8eb6a9 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 5 Oct 2019 13:47:11 -0700 Subject: [PATCH 18/25] Expand OLED char map further --- keyboards/crkbd/keymaps/drashna/keymap.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 0183b117f0d2..dbdbd885567b 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -12,7 +12,25 @@ extern rgblight_config_t rgblight_config; static uint32_t oled_timer = 0; static char keylog_str[6] = {}; static uint16_t log_timer = 0; -static const char PROGMEM code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; +static const char PROGMEM code_to_name[0xFF] = { +// 0 1 2 3 4 5 6 7 8 9 A B c D E F + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x + '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x + ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x + ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx + 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx +}; void add_keylog(uint16_t keycode); #endif @@ -133,6 +151,8 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_ void add_keylog(uint16_t keycode) { if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; + } else if (keycode > 0xFF) { + keycode = 0; } for (uint8_t i = 4; i > 0; --i) { @@ -148,7 +168,7 @@ void add_keylog(uint16_t keycode) { void update_log(void) { if (timer_elapsed(log_timer) > 750) { - add_keylog(0); + //add_keylog(0); } } From c8c32d3c0840f477c57ee3d7ef35ae634fe9845a Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Mon, 7 Oct 2019 09:42:28 -0700 Subject: [PATCH 19/25] Add modded characters to keylogger --- keyboards/crkbd/keymaps/drashna/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index dbdbd885567b..00436d85e9b8 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -149,7 +149,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } void add_keylog(uint16_t keycode) { - if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { keycode = keycode & 0xFF; } else if (keycode > 0xFF) { keycode = 0; From dbda625d903a9620daf226b2e7f47485d8c39d1f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 7 Oct 2019 17:00:07 -0700 Subject: [PATCH 20/25] Here be dragons Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> --- keyboards/c39/keymaps/drashna/readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/c39/keymaps/drashna/readme.md b/keyboards/c39/keymaps/drashna/readme.md index f5b1b6ac1145..a8efbaa5fe5a 100755 --- a/keyboards/c39/keymaps/drashna/readme.md +++ b/keyboards/c39/keymaps/drashna/readme.md @@ -1 +1,3 @@ -# The default keymap for the C39 +# @drashna's keymap for the C39 + +HERE BE DRAGONS From 91a39e2a3c1b75919aaefa499fdb389d4b1230e9 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Mon, 7 Oct 2019 19:06:21 -0700 Subject: [PATCH 21/25] Fix up rules for community layouts --- layouts/community/ergodox/drashna/rules.mk | 6 +-- .../community/ergodox/drashna_glow/rules.mk | 6 +-- layouts/community/ortho_4x12/drashna/rules.mk | 40 +++++++++---------- layouts/community/ortho_5x12/drashna/rules.mk | 12 +++--- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index f14353f4c6ae..f9f9ea2bab6c 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -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 diff --git a/layouts/community/ergodox/drashna_glow/rules.mk b/layouts/community/ergodox/drashna_glow/rules.mk index e1da86443fa6..45addc7c224c 100644 --- a/layouts/community/ergodox/drashna_glow/rules.mk +++ b/layouts/community/ergodox/drashna_glow/rules.mk @@ -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 diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 951144e7dab8..d4726b7a84da 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -7,30 +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 - HAPTIC_ENABLE += SOLENOID +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 diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index 0606f3e5225f..75affedd1209 100644 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -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) From 587b1170b1804d0e69c5f80a9870aa83df7d97fe Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Tue, 8 Oct 2019 11:52:53 -0700 Subject: [PATCH 22/25] Some more OLED tweaks --- keyboards/crkbd/keymaps/drashna/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 00436d85e9b8..cd84f0d91923 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -228,7 +228,7 @@ void render_mod_status(uint8_t modifiers) { oled_write_P(PSTR("S"), (modifiers & MOD_MASK_SHIFT)); oled_write_P(PSTR("C"), (modifiers & MOD_MASK_CTRL)); oled_write_P(PSTR("A"), (modifiers & MOD_MASK_ALT)); - oled_write_ln_P(PSTR("G"), (modifiers & MOD_MASK_GUI)); + oled_write_P(PSTR("G"), (modifiers & MOD_MASK_GUI)); } void render_bootmagic_status(void) { From c02f73719f7c740eb278a12dc19f320226a7ab60 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 11 Oct 2019 11:32:15 -0700 Subject: [PATCH 23/25] Add mod mask check function --- users/drashna/drashna.c | 7 +++++++ users/drashna/drashna.h | 1 + 2 files changed, 8 insertions(+) diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 6a436e0af0ee..b48d837d00d2 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -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; +} diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index e3edf8112417..0ccb7614fa1f 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -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; From bc1f0da5da9be113407cfe21bc9fb6fcf97990fd Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Mon, 14 Oct 2019 23:09:11 -0700 Subject: [PATCH 24/25] Change QMK DFU Audio pin to be correct --- layouts/community/ortho_4x12/drashna/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index e547cd61f1d4..d8ac5e6d1156 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -43,7 +43,7 @@ # undef QMK_LED # define QMK_LED D6 # undef QMK_SPEAKER -# define QMK_SPEAKER C6 +# define QMK_SPEAKER B5 # define SOLENOID_PIN A1 #endif // KEYBOARD_planck_light From 2db1a892919b99839b8a9c9431eef943a9db5535 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 16 Oct 2019 12:56:18 -0700 Subject: [PATCH 25/25] Use manual STM config instead of CTPC for Collide 39 --- keyboards/c39/keymaps/drashna/config.h | 4 +++- keyboards/c39/keymaps/drashna/rules.mk | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/keyboards/c39/keymaps/drashna/config.h b/keyboards/c39/keymaps/drashna/config.h index 918b85fb40de..361f68a78ea5 100755 --- a/keyboards/c39/keymaps/drashna/config.h +++ b/keyboards/c39/keymaps/drashna/config.h @@ -2,4 +2,6 @@ // place overrides here #undef MATRIX_COL_PINS -#define MATRIX_COL_PINS { PAL_LINE(GPIOA, 3), F4, F5, F6, B1, B3, B2, B6, D7, E6, C6, D2, D3 } +#define MATRIX_COL_PINS { A3, A2, A1, A0, B13, B14, B15, B9, B3, B2, B4, A10, A9 } +#undef MATRIX_ROW_PINS +#define MATRIX_ROW_PINS { B7, B1, B0 } diff --git a/keyboards/c39/keymaps/drashna/rules.mk b/keyboards/c39/keymaps/drashna/rules.mk index 50591d97049a..ae0cc9efee6e 100644 --- a/keyboards/c39/keymaps/drashna/rules.mk +++ b/keyboards/c39/keymaps/drashna/rules.mk @@ -1,4 +1,5 @@ -CTPC = yes +MCU = STM32F303 +BOOTLOADER = BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700)