diff options
23 files changed, 382 insertions, 85 deletions
diff --git a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c new file mode 100644 index 000000000..6c5b97457 --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #include "drashna.h" | ||
| 3 | #include "analog.c" | ||
| 4 | #include "pointing_device.h" | ||
| 5 | #include "pincontrol.h" | ||
| 6 | |||
| 7 | |||
| 8 | #define KC_X0 LT(_FN, KC_ESC) | ||
| 9 | |||
| 10 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 11 | [_QWERTY] = LAYOUT( | ||
| 12 | KC_VOLU, KC_MPLY, KC_MPRV, RESET, | ||
| 13 | KC_VOLD, KC_MUTE, KC_MNXT, RESET | ||
| 14 | ), | ||
| 15 | |||
| 16 | }; | ||
| 17 | |||
| 18 | // Joystick | ||
| 19 | // Set Pins | ||
| 20 | uint8_t xPin = 8; // VRx / /B4 | ||
| 21 | uint8_t yPin = 7; // VRy // B5 | ||
| 22 | uint8_t swPin = E6; // SW | ||
| 23 | |||
| 24 | // Set Parameters | ||
| 25 | uint16_t minAxisValue = 0; | ||
| 26 | uint16_t maxAxisValue = 1023; | ||
| 27 | |||
| 28 | uint8_t maxCursorSpeed = 2; | ||
| 29 | uint8_t precisionSpeed = 1; | ||
| 30 | uint8_t speedRegulator = 20; // Lower Values Create Faster Movement | ||
| 31 | |||
| 32 | int8_t xPolarity = 1; | ||
| 33 | int8_t yPolarity = 1; | ||
| 34 | |||
| 35 | uint8_t cursorTimeout = 10; | ||
| 36 | |||
| 37 | int16_t xOrigin, yOrigin; | ||
| 38 | |||
| 39 | uint16_t lastCursor = 0; | ||
| 40 | |||
| 41 | int16_t axisCoordinate(uint8_t pin, uint16_t origin) { | ||
| 42 | int8_t direction; | ||
| 43 | int16_t distanceFromOrigin; | ||
| 44 | int16_t range; | ||
| 45 | |||
| 46 | int16_t position = analogRead(pin); | ||
| 47 | |||
| 48 | if (origin == position) { | ||
| 49 | return 0; | ||
| 50 | } else if (origin > position) { | ||
| 51 | distanceFromOrigin = origin - position; | ||
| 52 | range = origin - minAxisValue; | ||
| 53 | direction = -1; | ||
| 54 | } else { | ||
| 55 | distanceFromOrigin = position - origin; | ||
| 56 | range = maxAxisValue - origin; | ||
| 57 | direction = 1; | ||
| 58 | } | ||
| 59 | |||
| 60 | float percent = (float)distanceFromOrigin / range; | ||
| 61 | int16_t coordinate = (int16_t)(percent * 100); | ||
| 62 | if (coordinate < 0) { | ||
| 63 | return 0; | ||
| 64 | } else if (coordinate > 100) { | ||
| 65 | return 100 * direction; | ||
| 66 | } else { | ||
| 67 | return coordinate * direction; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | int8_t axisToMouseComponent(uint8_t pin, int16_t origin, uint8_t maxSpeed, int8_t polarity) { | ||
| 72 | int coordinate = axisCoordinate(pin, origin); | ||
| 73 | if (coordinate == 0) { | ||
| 74 | return 0; | ||
| 75 | } else { | ||
| 76 | float percent = (float)coordinate / 100; | ||
| 77 | if (keyboard_report->mods & MOD_BIT(KC_LSFT)) { | ||
| 78 | return percent * precisionSpeed * polarity * (abs(coordinate) / speedRegulator); | ||
| 79 | } else { | ||
| 80 | return percent * maxCursorSpeed * polarity * (abs(coordinate) / speedRegulator); | ||
| 81 | } | ||
| 82 | } | ||
| 83 | } | ||
| 84 | |||
| 85 | void pointing_device_task(void) { | ||
| 86 | report_mouse_t report = pointing_device_get_report(); | ||
| 87 | |||
| 88 | // todo read as one vector | ||
| 89 | if (timer_elapsed(lastCursor) > cursorTimeout) { | ||
| 90 | lastCursor = timer_read(); | ||
| 91 | report.x = axisToMouseComponent(xPin, xOrigin, maxCursorSpeed, xPolarity); | ||
| 92 | report.y = axisToMouseComponent(yPin, yOrigin, maxCursorSpeed, yPolarity); | ||
| 93 | } | ||
| 94 | // | ||
| 95 | if (!readPin(swPin)) { | ||
| 96 | report.buttons |= MOUSE_BTN1; | ||
| 97 | } else { | ||
| 98 | report.buttons &= ~MOUSE_BTN1; | ||
| 99 | } | ||
| 100 | |||
| 101 | pointing_device_set_report(report); | ||
| 102 | pointing_device_send(); | ||
| 103 | } | ||
| 104 | |||
| 105 | void matrix_init_keymap(void) { | ||
| 106 | // init pin? Is needed? | ||
| 107 | setPinInputHigh(swPin); | ||
| 108 | // Account for drift | ||
| 109 | xOrigin = analogRead(xPin); | ||
| 110 | yOrigin = analogRead(yPin); | ||
| 111 | } | ||
diff --git a/keyboards/40percentclub/nano/keymaps/drashna/rules.mk b/keyboards/40percentclub/nano/keymaps/drashna/rules.mk new file mode 100644 index 000000000..06110a0a2 --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/drashna/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | POINTING_DEVICE_ENABLE = yes | ||
| 2 | RGBLIGHT_ENABLE = no | ||
| 3 | CONSOLE_ENABLE = no | ||
| 4 | |||
| 5 | BOOTLOADER = qmk-dfu | ||
diff --git a/keyboards/c39/keymaps/drashna/config.h b/keyboards/c39/keymaps/drashna/config.h new file mode 100755 index 000000000..361f68a78 --- /dev/null +++ b/keyboards/c39/keymaps/drashna/config.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | // place overrides here | ||
| 4 | #undef MATRIX_COL_PINS | ||
| 5 | #define MATRIX_COL_PINS { A3, A2, A1, A0, B13, B14, B15, B9, B3, B2, B4, A10, A9 } | ||
| 6 | #undef MATRIX_ROW_PINS | ||
| 7 | #define MATRIX_ROW_PINS { B7, B1, B0 } | ||
diff --git a/keyboards/c39/keymaps/drashna/keymap.c b/keyboards/c39/keymaps/drashna/keymap.c new file mode 100755 index 000000000..9de75190d --- /dev/null +++ b/keyboards/c39/keymaps/drashna/keymap.c | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 4 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 5 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 6 | // entirely and just use numbers. | ||
| 7 | #define _QWERTY 0 | ||
| 8 | #define _FN1 1 | ||
| 9 | |||
| 10 | // Defines for task manager and such | ||
| 11 | #define CALTDEL LCTL(LALT(KC_DEL)) | ||
| 12 | #define TSKMGR LCTL(LSFT(KC_ESC)) | ||
| 13 | |||
| 14 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 15 | |||
| 16 | /* Qwerty | ||
| 17 | * ,----------------------------------------------------------------------------. ,-------------. | ||
| 18 | * | Q | W | E | R | T | Bksp | Y | U | I | O | P | | M1 | M2 | | ||
| 19 | * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| | ||
| 20 | * | A | S | D | F | G | Enter| H | J | K | L | ; | | M3 | M4 | | ||
| 21 | * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| | ||
| 22 | * | Z | X | C | V | B | FN1 | N | M | , | . | / | | M5 | M6 | | ||
| 23 | * `----------------------------------------------------------------------------' `-------------' | ||
| 24 | */ | ||
| 25 | [_QWERTY] = LAYOUT( | ||
| 26 | 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, | ||
| 27 | 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, | ||
| 28 | 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 | ||
| 29 | ), | ||
| 30 | |||
| 31 | /* FN1 | ||
| 32 | * ,----------------------------------------------------------------------------. ,-------------. | ||
| 33 | * | 1 | 2 | 3 | 4 | 5 | Bksp | 6 | 7 | 8 | 9 | 0 | | M1 | M2 | | ||
| 34 | * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| | ||
| 35 | * | 4 | 5 | 6 | + | | Enter| | | | | | | M3 | M4 | | ||
| 36 | * |------+------+------+------+------+------+------+------+------+------+------+ |------+------| | ||
| 37 | * | 7 | 8 | 9 | 0 | | FN1 | | | | | | | M5 | M6 | | ||
| 38 | * `----------------------------------------------------------------------------' `-------------' | ||
| 39 | */ | ||
| 40 | [_FN1] = LAYOUT( | ||
| 41 | 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, | ||
| 42 | KC_4, KC_5, KC_6, KC_PLUS, _______, KC_ENT, _______, _______, _______, _______, _______, KC_3, KC_4, | ||
| 43 | KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, _______, KC_5, KC_6 | ||
| 44 | ), | ||
| 45 | }; | ||
diff --git a/keyboards/c39/keymaps/drashna/readme.md b/keyboards/c39/keymaps/drashna/readme.md new file mode 100755 index 000000000..a8efbaa5f --- /dev/null +++ b/keyboards/c39/keymaps/drashna/readme.md | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # @drashna's keymap for the C39 | ||
| 2 | |||
| 3 | HERE BE DRAGONS | ||
diff --git a/keyboards/c39/keymaps/drashna/rules.mk b/keyboards/c39/keymaps/drashna/rules.mk new file mode 100644 index 000000000..ae0cc9efe --- /dev/null +++ b/keyboards/c39/keymaps/drashna/rules.mk | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | MCU = STM32F303 | ||
| 2 | BOOTLOADER = | ||
| 3 | |||
| 4 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) | ||
| 5 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 6 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 7 | CONSOLE_ENABLE = yes # Console for debug(+400) | ||
| 8 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 9 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 10 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 11 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 12 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
| 13 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default | ||
| 14 | MIDI_ENABLE = no # MIDI controls | ||
| 15 | UNICODE_ENABLE = yes # Unicode | ||
| 16 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 17 | AUDIO_ENABLE = yes # Audio output on port C6 | ||
| 18 | RGBLIGHT_ENABLE = no # RGB Enable / Disable | ||
diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index d35f723da..26af02957 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 <http://www.gnu.org/licenses/>. | |||
| 41 | # define RGBLIGHT_HUE_STEP 8 | 41 | # define RGBLIGHT_HUE_STEP 8 |
| 42 | # define RGBLIGHT_SAT_STEP 8 | 42 | # define RGBLIGHT_SAT_STEP 8 |
| 43 | # define RGBLIGHT_VAL_STEP 5 | 43 | # define RGBLIGHT_VAL_STEP 5 |
| 44 | # define RGBLIGHT_LIMIT_VAL 150 | 44 | # define RGBLIGHT_LIMIT_VAL 120 |
| 45 | #endif | 45 | #endif |
| 46 | 46 | ||
| 47 | #ifdef RGB_MATRIX_ENABLE | 47 | #ifdef RGB_MATRIX_ENABLE |
| @@ -51,7 +51,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 51 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended | 51 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended |
| 52 | // # 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) | 52 | // # 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) |
| 53 | // # 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) | 53 | // # 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) |
| 54 | # 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 | 54 | # 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 |
| 55 | # define RGB_MATRIX_HUE_STEP 8 | 55 | # define RGB_MATRIX_HUE_STEP 8 |
| 56 | # define RGB_MATRIX_SAT_STEP 8 | 56 | # define RGB_MATRIX_SAT_STEP 8 |
| 57 | # define RGB_MATRIX_VAL_STEP 5 | 57 | # define RGB_MATRIX_VAL_STEP 5 |
| @@ -60,7 +60,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 60 | 60 | ||
| 61 | #ifdef AUDIO_ENABLE | 61 | #ifdef AUDIO_ENABLE |
| 62 | # define B6_AUDIO | 62 | # define B6_AUDIO |
| 63 | // #define NO_MUSIC_MODE | 63 | # define NO_MUSIC_MODE |
| 64 | #endif | ||
| 65 | |||
| 66 | #ifdef HAPTIC_ENABLE | ||
| 67 | # define SOLENOID_PIN B7 | ||
| 64 | #endif | 68 | #endif |
| 65 | 69 | ||
| 66 | #undef PRODUCT | 70 | #undef PRODUCT |
diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 36a5f5dd3..cd84f0d91 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; | |||
| 12 | static uint32_t oled_timer = 0; | 12 | static uint32_t oled_timer = 0; |
| 13 | static char keylog_str[6] = {}; | 13 | static char keylog_str[6] = {}; |
| 14 | static uint16_t log_timer = 0; | 14 | static uint16_t log_timer = 0; |
| 15 | 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', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; | 15 | static const char PROGMEM code_to_name[0xFF] = { |
| 16 | // 0 1 2 3 4 5 6 7 8 9 A B c D E F | ||
| 17 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x | ||
| 18 | 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x | ||
| 19 | '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x | ||
| 20 | ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x | ||
| 21 | ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x | ||
| 22 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x | ||
| 23 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x | ||
| 24 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x | ||
| 25 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x | ||
| 26 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x | ||
| 27 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax | ||
| 28 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx | ||
| 29 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx | ||
| 30 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx | ||
| 31 | 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex | ||
| 32 | ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx | ||
| 33 | }; | ||
| 16 | 34 | ||
| 17 | void add_keylog(uint16_t keycode); | 35 | void add_keylog(uint16_t keycode); |
| 18 | #endif | 36 | #endif |
| @@ -27,7 +45,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; | |||
| 27 | ) \ | 45 | ) \ |
| 28 | LAYOUT_wrapper( \ | 46 | LAYOUT_wrapper( \ |
| 29 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ | 47 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ |
| 30 | KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ | 48 | ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ |
| 31 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ | 49 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ |
| 32 | KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ | 50 | KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ |
| 33 | ) | 51 | ) |
| @@ -107,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 107 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, | 125 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, |
| 108 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, | 126 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, |
| 109 | MG_NKRO, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, | 127 | MG_NKRO, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, |
| 110 | _______, KC_NUKE, _______, _______, TG_MODS, _______ | 128 | HPT_TOG, KC_NUKE, _______, _______, TG_MODS, HPT_FBK |
| 111 | ) | 129 | ) |
| 112 | }; | 130 | }; |
| 113 | // clang-format on | 131 | // clang-format on |
| @@ -131,16 +149,18 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
| 131 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } | 149 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } |
| 132 | 150 | ||
| 133 | void add_keylog(uint16_t keycode) { | 151 | void add_keylog(uint16_t keycode) { |
| 134 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { | 152 | 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)) { |
| 135 | keycode = keycode & 0xFF; | 153 | keycode = keycode & 0xFF; |
| 154 | } else if (keycode > 0xFF) { | ||
| 155 | keycode = 0; | ||
| 136 | } | 156 | } |
| 137 | 157 | ||
| 138 | for (uint8_t i = 4; i > 0; --i) { | 158 | for (uint8_t i = 4; i > 0; --i) { |
| 139 | keylog_str[i] = keylog_str[i - 1]; | 159 | keylog_str[i] = keylog_str[i - 1]; |
| 140 | } | 160 | } |
| 141 | 161 | ||
| 142 | if (keycode < 60) { | 162 | if (keycode < (sizeof(code_to_name) / sizeof(char))) { |
| 143 | keylog_str[0] = code_to_name[keycode]; | 163 | keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); |
| 144 | } | 164 | } |
| 145 | 165 | ||
| 146 | log_timer = timer_read(); | 166 | log_timer = timer_read(); |
| @@ -148,7 +168,7 @@ void add_keylog(uint16_t keycode) { | |||
| 148 | 168 | ||
| 149 | void update_log(void) { | 169 | void update_log(void) { |
| 150 | if (timer_elapsed(log_timer) > 750) { | 170 | if (timer_elapsed(log_timer) > 750) { |
| 151 | add_keylog(0); | 171 | //add_keylog(0); |
| 152 | } | 172 | } |
| 153 | } | 173 | } |
| 154 | 174 | ||
| @@ -197,19 +217,18 @@ void render_layer_state(void) { | |||
| 197 | void render_keylock_status(uint8_t led_usb_state) { | 217 | void render_keylock_status(uint8_t led_usb_state) { |
| 198 | oled_write_P(PSTR("Lock:"), false); | 218 | oled_write_P(PSTR("Lock:"), false); |
| 199 | oled_write_P(PSTR(" "), false); | 219 | oled_write_P(PSTR(" "), false); |
| 200 | oled_write_P(PSTR("NUM "), led_usb_state & (1 << USB_LED_NUM_LOCK)); | 220 | oled_write_P(PSTR("N"), led_usb_state & (1 << USB_LED_NUM_LOCK)); |
| 201 | oled_write_P(PSTR(" "), false); | 221 | oled_write_P(PSTR("C"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); |
| 202 | oled_write_P(PSTR("CAPS"), led_usb_state & (1 << USB_LED_CAPS_LOCK)); | 222 | oled_write_ln_P(PSTR("S"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); |
| 203 | oled_write_P(PSTR(" "), false); | ||
| 204 | oled_write_P(PSTR("SCRL"), led_usb_state & (1 << USB_LED_SCROLL_LOCK)); | ||
| 205 | } | 223 | } |
| 206 | 224 | ||
| 207 | void render_mod_status(uint8_t modifiers) { | 225 | void render_mod_status(uint8_t modifiers) { |
| 208 | oled_write_P(PSTR("Mods:"), false); | 226 | oled_write_P(PSTR("Mods:"), false); |
| 209 | oled_write_P(PSTR(" SHFT"), (modifiers & MOD_MASK_SHIFT)); | 227 | oled_write_P(PSTR(" "), false); |
| 210 | oled_write_P(PSTR(" CTRL"), (modifiers & MOD_MASK_CTRL)); | 228 | oled_write_P(PSTR("S"), (modifiers & MOD_MASK_SHIFT)); |
| 211 | oled_write_P(PSTR(" ALT "), (modifiers & MOD_MASK_ALT)); | 229 | oled_write_P(PSTR("C"), (modifiers & MOD_MASK_CTRL)); |
| 212 | oled_write_P(PSTR(" GUI "), (modifiers & MOD_MASK_GUI)); | 230 | oled_write_P(PSTR("A"), (modifiers & MOD_MASK_ALT)); |
| 231 | oled_write_P(PSTR("G"), (modifiers & MOD_MASK_GUI)); | ||
| 213 | } | 232 | } |
| 214 | 233 | ||
| 215 | void render_bootmagic_status(void) { | 234 | void render_bootmagic_status(void) { |
diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index af3404597..492c17e20 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. | |||
| 18 | SWAP_HANDS_ENABLE = no # Enable one-hand typing | 18 | SWAP_HANDS_ENABLE = no # Enable one-hand typing |
| 19 | RGB_MATRIX_ENABLE = WS2812 | 19 | RGB_MATRIX_ENABLE = WS2812 |
| 20 | 20 | ||
| 21 | HAPTIC_ENABLE = SOLENOID | ||
| 21 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 22 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 22 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 23 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 23 | 24 | ||
diff --git a/keyboards/keebio/iris/keymaps/drashna/keymap.c b/keyboards/keebio/iris/keymaps/drashna/keymap.c index 28783dd8a..de19f7ca0 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] = { | |||
| 77 | ), | 77 | ), |
| 78 | 78 | ||
| 79 | [_GAMEPAD] = LAYOUT_wrapper( | 79 | [_GAMEPAD] = LAYOUT_wrapper( |
| 80 | KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_P, _______, _______, _______, _______, _______, _______, | 80 | KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, _______, _______, _______, _______, _______, _______, |
| 81 | KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, | 81 | KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, |
| 82 | KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, | 82 | KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, |
| 83 | KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, TG_GAME, _______, _______, _______, _______, _______, _______, _______, | 83 | KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, TG_GAME, _______, _______, _______, _______, _______, _______, _______, |
| 84 | LOWER, KC_V, KC_SPC, _______, _______, _______ | 84 | KC_GRV, KC_V, KC_SPC, _______, _______, _______ |
| 85 | ), | 85 | ), |
| 86 | 86 | ||
| 87 | 87 | ||
diff --git a/keyboards/keebio/iris/keymaps/drashna_lp/config.h b/keyboards/keebio/iris/keymaps/drashna_lp/config.h index d59890b46..5370d88ed 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 <http://www.gnu.org/licenses/>. | |||
| 21 | #include "../drashna/config.h" | 21 | #include "../drashna/config.h" |
| 22 | 22 | ||
| 23 | #ifdef RGBLIGHT_ENABLE | 23 | #ifdef RGBLIGHT_ENABLE |
| 24 | # undef RGBLED_NUM | 24 | # undef RGBLED_NUM |
| 25 | # define RGBLED_NUM 16 // Number of LEDs | 25 | # define RGBLED_NUM 16 // Number of LEDs |
| 26 | # undef RGBLED_SPLIT | 26 | # undef RGBLED_SPLIT |
| 27 | # define RGBLED_SPLIT { 8, 8 } | 27 | # define RGBLED_SPLIT \ |
| 28 | { 8, 8 } | ||
| 28 | #endif | 29 | #endif |
| 29 | 30 | ||
| 30 | #undef PRODUCT | 31 | #undef PRODUCT |
| 31 | #ifdef KEYBOARD_keebio_iris_rev2 | 32 | #ifdef KEYBOARD_keebio_iris_rev2 |
| 32 | # define PRODUCT Drashna Hacked Iris LP Rev.2 (Backlit) | 33 | # define PRODUCT Drashna Hacked Iris LP Rev .2(Backlit) |
| 33 | #endif | 34 | #endif |
| 34 | 35 | ||
| 35 | #undef SHFT_LED1 | 36 | #undef SHFT_LED1 |
| @@ -46,3 +47,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 46 | #define ALT_LED1 7 | 47 | #define ALT_LED1 7 |
| 47 | #undef GUI_LED1 | 48 | #undef GUI_LED1 |
| 48 | #define GUI_LED1 8 | 49 | #define GUI_LED1 8 |
| 50 | |||
| 51 | #define DRASHNA_LP | ||
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 0ccf10c31..494383299 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h | |||
| @@ -13,6 +13,6 @@ | |||
| 13 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine | 13 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine |
| 14 | 14 | ||
| 15 | #undef DEBOUNCE | 15 | #undef DEBOUNCE |
| 16 | #define DEBOUNCE 15 | 16 | #define DEBOUNCE 30 |
| 17 | 17 | ||
| 18 | #define TAPPING_TERM_PER_KEY | 18 | #define TAPPING_TERM_PER_KEY |
diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index f14353f4c..f9f9ea2ba 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk | |||
| @@ -2,9 +2,9 @@ TAP_DANCE_ENABLE = yes | |||
| 2 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 2 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 3 | COMMAND_ENABLE = no # Commands for debug and configuration | 3 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 4 | SPACE_CADET_ENABLE = no | 4 | SPACE_CADET_ENABLE = no |
| 5 | ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) | 5 | ifeq ($(strip $(KEYBOARD)), ergodox_ez) |
| 6 | RGBLIGHT_ENABLE = yes | 6 | RGBLIGHT_ENABLE = yes |
| 7 | RGB_MATRIX_ENABLE = no | 7 | RGB_MATRIX_ENABLE = no |
| 8 | endif | 8 | endif |
| 9 | CONSOLE_ENABLE = no | 9 | CONSOLE_ENABLE = no |
| 10 | BOOTMAGIC_ENABLE = yes | 10 | BOOTMAGIC_ENABLE = yes |
diff --git a/layouts/community/ergodox/drashna_glow/config.h b/layouts/community/ergodox/drashna_glow/config.h index 28bed20e0..6431cb4ff 100644 --- a/layouts/community/ergodox/drashna_glow/config.h +++ b/layouts/community/ergodox/drashna_glow/config.h | |||
| @@ -4,3 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #undef PRODUCT | 5 | #undef PRODUCT |
| 6 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow | 6 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow |
| 7 | |||
| 8 | #undef RGB_MATRIX_LED_PROCESS_LIMIT | ||
| 9 | #undef RGB_MATRIX_LED_FLUSH_LIMIT | ||
diff --git a/layouts/community/ergodox/drashna_glow/rules.mk b/layouts/community/ergodox/drashna_glow/rules.mk index e1da86443..45addc7c2 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 | |||
| 6 | 6 | ||
| 7 | -include $(CORRECTED_LAYOUT)/rules.mk | 7 | -include $(CORRECTED_LAYOUT)/rules.mk |
| 8 | 8 | ||
| 9 | ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) | 9 | ifeq ($(strip $(KEYBOARD)), ergodox_ez) |
| 10 | RGBLIGHT_ENABLE = no | 10 | RGBLIGHT_ENABLE = no |
| 11 | RGB_MATRIX_ENABLE = yes | 11 | RGB_MATRIX_ENABLE = yes |
| 12 | # TAP_DANCE_ENABLE = no | 12 | # TAP_DANCE_ENABLE = no |
| 13 | endif | 13 | endif |
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 9f3d2b82d..d8ac5e6d1 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) | 3 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) |
| 4 | # define RGB_DI_PIN B3 | 4 | # define RGB_DI_PIN A0 |
| 5 | # define RGBLED_NUM 13 // Number of LEDs | 5 | # define RGBLED_NUM 13 // Number of LEDs |
| 6 | # define RGBLIGHT_ANIMATIONS | 6 | # define RGBLIGHT_ANIMATIONS |
| 7 | # define RGBLIGHT_HUE_STEP 12 | 7 | # define RGBLIGHT_HUE_STEP 12 |
| @@ -17,10 +17,12 @@ | |||
| 17 | #ifdef RGB_MATRIX_ENABLE | 17 | #ifdef RGB_MATRIX_ENABLE |
| 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_MATRIX_FRAMEBUFFER_EFFECTS | 20 | # define RGB_MATRIX_FRAMEBUFFER_EFFECTS |
| 21 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 21 | // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
| 22 | // #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 | 22 | // #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_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended | 23 | # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended |
| 24 | # undef RGB_MATRIX_LED_PROCESS_LIMIT | ||
| 25 | # undef RGB_MATRIX_LED_FLUSH_LIMIT | ||
| 24 | #endif | 26 | #endif |
| 25 | 27 | ||
| 26 | #if defined(KEYBOARD_lets_split_rev2) | 28 | #if defined(KEYBOARD_lets_split_rev2) |
| @@ -32,7 +34,17 @@ | |||
| 32 | #if !defined(KEYBOARD_planck_light) | 34 | #if !defined(KEYBOARD_planck_light) |
| 33 | # ifdef RGBLIGHT_ENABLE | 35 | # ifdef RGBLIGHT_ENABLE |
| 34 | # define NO_MUSIC_MODE | 36 | # define NO_MUSIC_MODE |
| 35 | # endif // RGBLIGHT_ENABLE | 37 | # endif // RGBLIGHT_ENABLE |
| 38 | #else | ||
| 39 | # undef QMK_ESC_OUTPUT | ||
| 40 | # define QMK_ESC_OUTPUT E6 // usually COL | ||
| 41 | # undef QMK_ESC_INPUT | ||
| 42 | # define QMK_ESC_INPUT B0 // usually ROW | ||
| 43 | # undef QMK_LED | ||
| 44 | # define QMK_LED D6 | ||
| 45 | # undef QMK_SPEAKER | ||
| 46 | # define QMK_SPEAKER B5 | ||
| 47 | # define SOLENOID_PIN A1 | ||
| 36 | #endif // KEYBOARD_planck_light | 48 | #endif // KEYBOARD_planck_light |
| 37 | 49 | ||
| 38 | #if defined(KEYBOARD_planck) | 50 | #if defined(KEYBOARD_planck) |
| @@ -69,3 +81,50 @@ | |||
| 69 | 81 | ||
| 70 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ | 82 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ |
| 71 | //#define MIDI_TONE_KEYCODE_OCTAVES 2 | 83 | //#define MIDI_TONE_KEYCODE_OCTAVES 2 |
| 84 | |||
| 85 | #define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ | ||
| 86 | #define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ | ||
| 87 | #define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ | ||
| 88 | |||
| 89 | /* default 3V ERM vibration motor voltage and library*/ | ||
| 90 | #if FB_ERM_LRA == 0 | ||
| 91 | #define RATED_VOLTAGE 3 | ||
| 92 | #define V_RMS 2.3 | ||
| 93 | #define V_PEAK 3.30 | ||
| 94 | /* Library Selection */ | ||
| 95 | #define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ | ||
| 96 | |||
| 97 | /* default 2V LRA voltage and library */ | ||
| 98 | #elif FB_ERM_LRA == 1 | ||
| 99 | #define RATED_VOLTAGE 2 | ||
| 100 | #define V_RMS 2.0 | ||
| 101 | #define V_PEAK 2.85 | ||
| 102 | #define F_LRA 200 | ||
| 103 | /* Library Selection */ | ||
| 104 | #define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ | ||
| 105 | |||
| 106 | #endif | ||
| 107 | |||
| 108 | /* Control 1 register settings */ | ||
| 109 | #define DRIVE_TIME 25 | ||
| 110 | #define AC_COUPLE 0 | ||
| 111 | #define STARTUP_BOOST 1 | ||
| 112 | |||
| 113 | /* Control 2 Settings */ | ||
| 114 | #define BIDIR_INPUT 1 | ||
| 115 | #define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ | ||
| 116 | #define SAMPLE_TIME 3 | ||
| 117 | #define BLANKING_TIME 1 | ||
| 118 | #define IDISS_TIME 1 | ||
| 119 | |||
| 120 | /* Control 3 settings */ | ||
| 121 | #define NG_THRESH 2 | ||
| 122 | #define ERM_OPEN_LOOP 1 | ||
| 123 | #define SUPPLY_COMP_DIS 0 | ||
| 124 | #define DATA_FORMAT_RTO 0 | ||
| 125 | #define LRA_DRIVE_MODE 0 | ||
| 126 | #define N_PWM_ANALOG 0 | ||
| 127 | #define LRA_OPEN_LOOP 0 | ||
| 128 | /* Control 4 settings */ | ||
| 129 | #define ZC_DET_TIME 0 | ||
| 130 | #define AUTO_CAL_TIME 3 | ||
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 26f611c08..1c894c764 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; | |||
| 24 | #ifdef BACKLIGHT_ENABLE | 24 | #ifdef BACKLIGHT_ENABLE |
| 25 | enum planck_keycodes { | 25 | enum planck_keycodes { |
| 26 | BACKLIT = NEW_SAFE_RANGE, | 26 | BACKLIT = NEW_SAFE_RANGE, |
| 27 | TH_LVL, | ||
| 27 | }; | 28 | }; |
| 29 | |||
| 28 | #else | 30 | #else |
| 29 | # define BACKLIT OSM(MOD_LSFT) | 31 | # define BACKLIT OSM(MOD_LSFT) |
| 30 | enum planck_keycodes { | 32 | enum planck_keycodes { |
| @@ -134,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 134 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, | 136 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, |
| 135 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, | 137 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, |
| 136 | TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, | 138 | TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, |
| 137 | _______, _______, _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, TG_MODS | 139 | HPT_TOG, _______, _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, TG_MODS |
| 138 | ) | 140 | ) |
| 139 | 141 | ||
| 140 | }; | 142 | }; |
| @@ -298,6 +300,9 @@ void rgb_matrix_indicators_user(void) { | |||
| 298 | } | 300 | } |
| 299 | 301 | ||
| 300 | void matrix_init_keymap(void) { | 302 | void matrix_init_keymap(void) { |
| 303 | # ifdef KEYBOARD_planck_light | ||
| 304 | writePinLow(D6); | ||
| 305 | # endif | ||
| 301 | // rgblight_mode(RGB_MATRIX_MULTISPLASH); | 306 | // rgblight_mode(RGB_MATRIX_MULTISPLASH); |
| 302 | } | 307 | } |
| 303 | #else // RGB_MATRIX_INIT | 308 | #else // RGB_MATRIX_INIT |
diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 55f3acd70..d4726b7a8 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk | |||
| @@ -7,29 +7,30 @@ TAP_DANCE_ENABLE = no | |||
| 7 | AUDIO_ENABLE = yes | 7 | AUDIO_ENABLE = yes |
| 8 | SPACE_CADET_ENABLE = no | 8 | SPACE_CADET_ENABLE = no |
| 9 | 9 | ||
| 10 | ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6 | 10 | ifneq ($(strip $(KEYBOARD)), planck/rev6) |
| 11 | RGBLIGHT_ENABLE = yes | 11 | RGBLIGHT_ENABLE = yes |
| 12 | INDICATOR_LIGHTS = yes | 12 | INDICATOR_LIGHTS = yes |
| 13 | RGBLIGHT_TWINKLE = yes | 13 | RGBLIGHT_TWINKLE = yes |
| 14 | RGBLIGHT_STARTUP_ANIMATION = yes | 14 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 15 | endif | 15 | endif |
| 16 | ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light | 16 | ifeq ($(strip $(KEYBOARD)), planck/light) |
| 17 | RGB_MATRIX_ENABLE = yes | 17 | RGB_MATRIX_ENABLE = yes |
| 18 | RGBLIGHT_ENABLE = no | 18 | RGBLIGHT_ENABLE = no |
| 19 | RGBLIGHT_STARTUP_ANIMATION = no | 19 | RGBLIGHT_STARTUP_ANIMATION = no |
| 20 | HAPTIC_ENABLE += SOLENOID | ||
| 20 | endif | 21 | endif |
| 21 | ifneq (,$(findstring planck/ez,$(KEYBOARD))) # Make sure it IS the Planck Light | 22 | ifeq ($(strip $(KEYBOARD)), planck/ez) |
| 22 | RGBLIGHT_ENABLE = no | 23 | RGBLIGHT_ENABLE = no |
| 23 | # SERIAL_LINK_ENABLE = yes | 24 | # SERIAL_LINK_ENABLE = yes |
| 24 | ENCODER_ENABLE = yes | 25 | ENCODER_ENABLE = yes |
| 25 | RGB_MATRIX_ENABLE = IS31FL3737 | 26 | RGB_MATRIX_ENABLE = IS31FL3737 |
| 26 | INDICATOR_LIGHTS = yes | 27 | INDICATOR_LIGHTS = yes |
| 27 | RGBLIGHT_TWINKLE = yes | 28 | RGBLIGHT_TWINKLE = yes |
| 28 | RGBLIGHT_STARTUP_ANIMATION = yes | 29 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 29 | endif | 30 | endif |
| 30 | 31 | ||
| 31 | ifeq ($(strip $(PROTOCOL)), VUSB) | 32 | ifeq ($(strip $(PROTOCOL)), VUSB) |
| 32 | NKRO_ENABLE = no | 33 | NKRO_ENABLE = no |
| 33 | else | 34 | else |
| 34 | NKRO_ENABLE = yes | 35 | NKRO_ENABLE = yes |
| 35 | endif | 36 | endif |
diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index 0606f3e52..75affedd1 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) | |||
| 5 | COMMAND_ENABLE = no # Commands for debug and configuration | 5 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 6 | TAP_DANCE_ENABLE = no | 6 | TAP_DANCE_ENABLE = no |
| 7 | AUDIO_ENABLE = yes | 7 | AUDIO_ENABLE = yes |
| 8 | ifneq (,$(findstring fractal,$(KEYBOARD))) # Make sure it IS the Planck Light | 8 | ifeq ($(strip $(KEYBOARD)), fractal) |
| 9 | RGB_MATRIX_ENABLE = no | 9 | RGB_MATRIX_ENABLE = no |
| 10 | AUDIO_ENABLE = yes | 10 | AUDIO_ENABLE = yes |
| 11 | RGBLIGHT_ENABLE = yes | 11 | RGBLIGHT_ENABLE = yes |
| 12 | RGBLIGHT_TWINKLE = yes | 12 | RGBLIGHT_TWINKLE = yes |
| 13 | BOOTLOADER = qmk-dfu | 13 | BOOTLOADER = qmk-dfu |
| 14 | endif | 14 | endif |
| 15 | 15 | ||
| 16 | ifeq ($(strip $(PROTOCOL)), VUSB) | 16 | ifeq ($(strip $(PROTOCOL)), VUSB) |
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 6a436e0af..b48d837d0 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -219,3 +219,10 @@ void eeconfig_init_user(void) { | |||
| 219 | eeconfig_init_keymap(); | 219 | eeconfig_init_keymap(); |
| 220 | keyboard_init(); | 220 | keyboard_init(); |
| 221 | } | 221 | } |
| 222 | |||
| 223 | bool hasAllBitsInMask(uint8_t value, uint8_t mask) { | ||
| 224 | value &= 0xF; | ||
| 225 | mask &= 0xF; | ||
| 226 | |||
| 227 | return (value & mask) == mask; | ||
| 228 | } | ||
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index e3edf8112..0ccb7614f 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); | |||
| 60 | layer_state_t default_layer_state_set_keymap(layer_state_t state); | 60 | layer_state_t default_layer_state_set_keymap(layer_state_t state); |
| 61 | void led_set_keymap(uint8_t usb_led); | 61 | void led_set_keymap(uint8_t usb_led); |
| 62 | void eeconfig_init_keymap(void); | 62 | void eeconfig_init_keymap(void); |
| 63 | bool hasAllBitsInMask(uint8_t value, uint8_t mask); | ||
| 63 | 64 | ||
| 64 | typedef union { | 65 | typedef union { |
| 65 | uint32_t raw; | 66 | uint32_t raw; |
diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index 0ae468a04..cb7ec3ec4 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h | |||
| @@ -14,21 +14,21 @@ enum userspace_custom_keycodes { | |||
| 14 | KC_DVORAK, // Sets default layer to DVORAK | 14 | KC_DVORAK, // Sets default layer to DVORAK |
| 15 | KC_WORKMAN, // Sets default layer to WORKMAN | 15 | KC_WORKMAN, // Sets default layer to WORKMAN |
| 16 | KC_DIABLO_CLEAR, // Clears all Diablo Timers | 16 | KC_DIABLO_CLEAR, // Clears all Diablo Timers |
| 17 | KC_MAKE, // Run keyboard's customized make command | 17 | KC_MAKE, // Run keyboard's customized make command |
| 18 | KC_RGB_T, // Toggles RGB Layer Indication mode | 18 | KC_RGB_T, // Toggles RGB Layer Indication mode |
| 19 | RGB_IDL, // RGB Idling animations | 19 | RGB_IDL, // RGB Idling animations |
| 20 | KC_SECRET_1, // test1 | 20 | KC_SECRET_1, // test1 |
| 21 | KC_SECRET_2, // test2 | 21 | KC_SECRET_2, // test2 |
| 22 | KC_SECRET_3, // test3 | 22 | KC_SECRET_3, // test3 |
| 23 | KC_SECRET_4, // test4 | 23 | KC_SECRET_4, // test4 |
| 24 | KC_SECRET_5, // test5 | 24 | KC_SECRET_5, // test5 |
| 25 | KC_CCCV, // Hold to copy, tap to paste | 25 | KC_CCCV, // Hold to copy, tap to paste |
| 26 | KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! | 26 | KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! |
| 27 | UC_FLIP, // (ಠ痊ಠ)┻━┻ | 27 | UC_FLIP, // (ಠ痊ಠ)┻━┻ |
| 28 | UC_TABL, // ┬─┬ノ( º _ ºノ) | 28 | UC_TABL, // ┬─┬ノ( º _ ºノ) |
| 29 | UC_SHRG, // ¯\_(ツ)_/¯ | 29 | UC_SHRG, // ¯\_(ツ)_/¯ |
| 30 | UC_DISA, // ಠ_ಠ | 30 | UC_DISA, // ಠ_ಠ |
| 31 | NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes | 31 | NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); | 34 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record); |
| @@ -57,9 +57,11 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); | |||
| 57 | #define KC_RST KC_RESET | 57 | #define KC_RST KC_RESET |
| 58 | 58 | ||
| 59 | #ifdef SWAP_HANDS_ENABLE | 59 | #ifdef SWAP_HANDS_ENABLE |
| 60 | # define KC_C1R3 SH_TT | 60 | # define KC_C1R3 SH_T(KC_TAB) |
| 61 | #elif defined(DRASHNA_LP) | ||
| 62 | # define KC_C1R3 TG(_GAMEPAD) | ||
| 61 | #else // SWAP_HANDS_ENABLE | 63 | #else // SWAP_HANDS_ENABLE |
| 62 | # define KC_C1R3 KC_BSPC | 64 | # define KC_C1R3 KC_TAB |
| 63 | #endif // SWAP_HANDS_ENABLE | 65 | #endif // SWAP_HANDS_ENABLE |
| 64 | 66 | ||
| 65 | #define BK_LWER LT(_LOWER, KC_BSPC) | 67 | #define BK_LWER LT(_LOWER, KC_BSPC) |
| @@ -79,7 +81,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); | |||
| 79 | #define OS_RCTL OSM(MOD_RCTL) | 81 | #define OS_RCTL OSM(MOD_RCTL) |
| 80 | #define OS_LALT OSM(MOD_LALT) | 82 | #define OS_LALT OSM(MOD_LALT) |
| 81 | #define OS_RALT OSM(MOD_RALT) | 83 | #define OS_RALT OSM(MOD_RALT) |
| 82 | #define OS_MEH OSM(MOD_MEH) | 84 | #define OS_MEH OSM(MOD_MEH) |
| 83 | #define OS_HYPR OSM(MOD_HYPR) | 85 | #define OS_HYPR OSM(MOD_HYPR) |
| 84 | 86 | ||
| 85 | #define ALT_APP ALT_T(KC_APP) | 87 | #define ALT_APP ALT_T(KC_APP) |
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 7b77a51d9..1b5a86385 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk | |||
| @@ -4,8 +4,13 @@ SRC += drashna.c \ | |||
| 4 | LINK_TIME_OPTIMIZATION_ENABLE = yes | 4 | LINK_TIME_OPTIMIZATION_ENABLE = yes |
| 5 | SPACE_CADET_ENABLE = no | 5 | SPACE_CADET_ENABLE = no |
| 6 | 6 | ||
| 7 | ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") | 7 | ifneq ($(strip $(NO_SECRETS)), yes) |
| 8 | SRC += secrets.c | 8 | ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") |
| 9 | SRC += secrets.c | ||
| 10 | endif | ||
| 11 | ifeq ($(strip $(NO_SECRETS)), lite) | ||
| 12 | OPT_DEFS += -DNO_SECRETS | ||
| 13 | endif | ||
| 9 | endif | 14 | endif |
| 10 | 15 | ||
| 11 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) | 16 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) |
| @@ -14,9 +19,7 @@ endif | |||
| 14 | 19 | ||
| 15 | 20 | ||
| 16 | 21 | ||
| 17 | ifeq ($(strip $(NO_SECRETS)), yes) | 22 | |
| 18 | OPT_DEFS += -DNO_SECRETS | ||
| 19 | endif | ||
| 20 | 23 | ||
| 21 | ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) | 24 | ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) |
| 22 | SRC += rgb_stuff.c | 25 | SRC += rgb_stuff.c |
