diff options
Diffstat (limited to 'keyboards/dmqdesign/spin')
-rw-r--r-- | keyboards/dmqdesign/spin/config.h | 8 | ||||
-rw-r--r-- | keyboards/dmqdesign/spin/info.json | 6 | ||||
-rw-r--r-- | keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h | 2 | ||||
-rw-r--r-- | keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c | 82 | ||||
-rw-r--r-- | keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk | 6 |
5 files changed, 48 insertions, 56 deletions
diff --git a/keyboards/dmqdesign/spin/config.h b/keyboards/dmqdesign/spin/config.h index ee4f5bf490..72efc0f556 100644 --- a/keyboards/dmqdesign/spin/config.h +++ b/keyboards/dmqdesign/spin/config.h @@ -19,13 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xA455 -#define PRODUCT_ID 0x0001 -#define DEVICE_VER 0x0001 -#define MANUFACTURER DMQ Design -#define PRODUCT SPIN - /* key matrix size */ #define MATRIX_ROWS 3 #define MATRIX_COLS 5 @@ -33,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MATRIX_ROW_PINS { F0, F1, F4 } #define MATRIX_COL_PINS { F5, F6, F7, C7, C6 } -#define UNUSED_PINS { D5, D2, D1, D0, B7, B3, B2, B0, E6 } /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/dmqdesign/spin/info.json b/keyboards/dmqdesign/spin/info.json index 4d8c09c277..14db65cc65 100644 --- a/keyboards/dmqdesign/spin/info.json +++ b/keyboards/dmqdesign/spin/info.json @@ -1,7 +1,13 @@ { "keyboard_name": "SPIN", + "manufacturer": "DMQ Design", "url": "https://www.DMQdesign.com", "maintainer": "Quarren42", + "usb": { + "vid": "0xA455", + "pid": "0x0001", + "device_version": "0.0.1" + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h index 1851f07f1d..b9a0b53fbf 100644 --- a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h +++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h @@ -24,7 +24,7 @@ #undef LOCKING_SUPPORT_ENABLE #define LAYER_STATE_8BIT -#define MAX_LAYER 4 +#define MAX_LAYER 5 #undef RGBLIGHT_ANIMATIONS #define RGBLIGHT_EFFECT_BREATHING diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c index bdf5dff0df..8c9af7202b 100644 --- a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c +++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c @@ -20,7 +20,7 @@ #define RGB_LAYER_ACK_DURATION 500 -enum layers { _MACRO, _NUMPAD, _RGB, _FN }; +enum layers { _MACRO, _NUMPAD, _CURSOR, _RGB, _FN }; enum layer_base { LAYER_BASE = _MACRO, @@ -44,22 +44,37 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMPAD] = LAYOUT( KC_KP_7, KC_KP_8, KC_KP_9, KC_TRNS, - KC_KP_4, KC_KP_5, KC_KP_6, KC_TRNS, + KC_KP_4, KC_KP_5, KC_KP_6, TO(_CURSOR), KC_KP_1, KC_KP_2, KC_KP_3, KC_TRNS, KC_KP_0, KC_PDOT, KC_PENT), + [_CURSOR] = LAYOUT( + KC_HOME, KC_UP, KC_PGUP, KC_TRNS, + KC_LEFT, KC_NO, KC_RIGHT, TO(_NUMPAD), + KC_END, KC_DOWN, KC_PGDN, KC_TRNS, + KC_INS, KC_DEL, KC_PENT), + [_RGB] = LAYOUT( RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, - RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, + RGB_HUD, RGB_SAD, RGB_VAD, TO(_NUMPAD), RGB_SPD, RGB_SPI, KC_NO, KC_TRNS, RGB_RMOD, RGB_TOG, RGB_MOD), [_FN] = LAYOUT( - KC_TRNS, DEBUG, RESET, KC_TRNS, + KC_NO, DEBUG, QK_BOOT, KC_TRNS, KC_NO, KC_NO, EEP_RST, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_NO, KC_NO), + KC_TRNS, KC_NO, KC_NO), +}; + +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_MACRO] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_NUMPAD] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_CURSOR] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_RGB] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI ), ENCODER_CCW_CW(RGB_SAD, RGB_SAI ), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [_FN] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, }; + // clang-format on typedef enum layer_ack { @@ -71,6 +86,7 @@ typedef enum layer_ack { #define LAYER_OFFSET 0 const rgblight_segment_t PROGMEM _macro_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 1, HSV_TEAL}); const rgblight_segment_t PROGMEM _numpad_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_TEAL}); +const rgblight_segment_t PROGMEM _cursor_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_BLUE}); const rgblight_segment_t PROGMEM _rgb_layer[] = RGBLIGHT_LAYER_SEGMENTS({2, 1, HSV_TEAL}); const rgblight_segment_t PROGMEM _fn_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_PURPLE}); @@ -83,8 +99,9 @@ const rgblight_segment_t PROGMEM _meh_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, H const rgblight_segment_t *const PROGMEM _rgb_layers[] = { [LAYER_OFFSET + 0] = _macro_layer, [LAYER_OFFSET + 1] = _numpad_layer, - [LAYER_OFFSET + 2] = _rgb_layer, - [LAYER_OFFSET + 3] = _fn_layer, + [LAYER_OFFSET + 2] = _cursor_layer, + [LAYER_OFFSET + 3] = _rgb_layer, + [LAYER_OFFSET + 4] = _fn_layer, [ACK_OFFSET + ACK_NO] = _no_layer, [ACK_OFFSET + ACK_YES] = _yes_layer, @@ -145,9 +162,22 @@ void spidey_glow(void) { rgblight_sethsv(255, 230, 128); } -void eeconfig_init_user(void) { spidey_glow(); } +void eeconfig_init_user(void) { + spidey_glow(); +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { + dprintf("key event: kc: %02X, col: %02u, row: %02u, pressed: %u mods: %08b " +#if !defined(NO_ACTION_ONESHOT) + "os: %08b " +#endif + "weak: %08b\n", + keycode, record->event.key.col, record->event.key.row, record->event.pressed, bitrev(get_mods()), +#if !defined(NO_ACTION_ONESHOT) + bitrev(get_oneshot_mods()), +#endif + bitrev(get_weak_mods())); + if (record->event.pressed) { switch (keycode) { // Re-implement this here, but fix the persistence! @@ -200,39 +230,3 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) { } } -bool encoder_update_user(uint8_t index, bool clockwise) { - switch (get_highest_layer(layer_state)) { - case _RGB: - if (index == 0) { - if (clockwise) { - rgblight_increase_hue(); - } else { - rgblight_decrease_hue(); - } - } else if (index == 1) { - if (clockwise) { - rgblight_increase_sat(); - } else { - rgblight_decrease_sat(); - } - } else if (index == 2) { - if (clockwise) { - rgblight_increase_val(); - } else { - rgblight_decrease_val(); - } - } - break; - - default: - if (index == 0) { - tap_code16(C(S(clockwise ? KC_EQL : KC_MINS))); - } else if (index == 1) { - tap_code16(C(clockwise ? KC_EQL : KC_MINS)); - } else if (index == 2) { - tap_code(clockwise ? KC_VOLU : KC_VOLD); - } - break; - } - return true; -} diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk index 7fe1f992aa..5d543e2c7e 100644 --- a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk +++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk @@ -1,7 +1,7 @@ MOUSEKEY_ENABLE = no MIDI_ENABLE = no -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +BOOTMAGIC_ENABLE = yes LTO_ENABLE = yes -CONSOLE_ENABLE = yes # Console for debug +CONSOLE_ENABLE = yes GRAVE_ESC_ENABLE = no - +ENCODER_MAP_ENABLE = yes |