diff options
Diffstat (limited to 'keyboards/custommk/genesis')
-rw-r--r-- | keyboards/custommk/genesis/rev1/config.h | 6 | ||||
-rw-r--r-- | keyboards/custommk/genesis/rev1/info.json | 6 | ||||
-rw-r--r-- | keyboards/custommk/genesis/rev2/config.h | 6 | ||||
-rw-r--r-- | keyboards/custommk/genesis/rev2/info.json | 39 | ||||
-rw-r--r-- | keyboards/custommk/genesis/rev2/keymaps/via/keymap.c | 129 | ||||
-rw-r--r-- | keyboards/custommk/genesis/rev2/keymaps/via/rules.mk | 3 |
6 files changed, 42 insertions, 147 deletions
diff --git a/keyboards/custommk/genesis/rev1/config.h b/keyboards/custommk/genesis/rev1/config.h index d894b55edf..892ac61ad3 100644 --- a/keyboards/custommk/genesis/rev1/config.h +++ b/keyboards/custommk/genesis/rev1/config.h @@ -16,8 +16,6 @@ #pragma once -#define TAP_CODE_DELAY 10 - #define RGBLIGHT_EFFECT_BREATHING #define RGBLIGHT_EFFECT_RAINBOW_MOOD #define RGBLIGHT_EFFECT_RAINBOW_SWIRL @@ -28,9 +26,5 @@ #define RGBLIGHT_EFFECT_RGB_TEST #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE -#define RGBLED_NUM 13 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + 4 diff --git a/keyboards/custommk/genesis/rev1/info.json b/keyboards/custommk/genesis/rev1/info.json index 4915497bb0..8404cdbaca 100644 --- a/keyboards/custommk/genesis/rev1/info.json +++ b/keyboards/custommk/genesis/rev1/info.json @@ -12,6 +12,9 @@ "pin": "E6" }, "rgblight": { + "saturation_steps": 8, + "brightness_steps": 8, + "led_count": 13, "max_brightness": 128 }, "matrix_pins": { @@ -25,6 +28,9 @@ {"pin_a": "D2", "pin_b": "D1", "resolution": 2} ] }, + "qmk": { + "tap_keycode_delay": 10 + }, "processor": "atmega32u4", "bootloader": "qmk-dfu", "layouts": { diff --git a/keyboards/custommk/genesis/rev2/config.h b/keyboards/custommk/genesis/rev2/config.h index 126caeab6a..6427c5de2b 100644 --- a/keyboards/custommk/genesis/rev2/config.h +++ b/keyboards/custommk/genesis/rev2/config.h @@ -16,8 +16,6 @@ #pragma once -#define TAP_CODE_DELAY 10 - #define RGBLIGHT_EFFECT_BREATHING #define RGBLIGHT_EFFECT_RAINBOW_MOOD #define RGBLIGHT_EFFECT_RAINBOW_SWIRL @@ -28,10 +26,6 @@ #define RGBLIGHT_EFFECT_RGB_TEST #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE -#define RGBLED_NUM 13 #define RGBLIGHT_LAYERS -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + 4 diff --git a/keyboards/custommk/genesis/rev2/info.json b/keyboards/custommk/genesis/rev2/info.json index 0ee3d9a537..6b7d1c6de3 100644 --- a/keyboards/custommk/genesis/rev2/info.json +++ b/keyboards/custommk/genesis/rev2/info.json @@ -12,6 +12,9 @@ "pin": "E6" }, "rgblight": { + "saturation_steps": 8, + "brightness_steps": 8, + "led_count": 13, "max_brightness": 128 }, "matrix_pins": { @@ -25,6 +28,9 @@ {"pin_a": "D2", "pin_b": "D1", "resolution": 2} ] }, + "qmk": { + "tap_keycode_delay": 10 + }, "processor": "atmega32u4", "bootloader": "qmk-dfu", "layouts": { @@ -80,39 +86,6 @@ {"matrix": [4, 2], "x": 0, "y": 4, "w": 2}, {"matrix": [4, 3], "x": 2, "y": 4} ] - }, - "LAYOUT_via_6x4": { - "layout": [ - {"matrix": [5, 0], "x": 0, "y": 0}, - {"matrix": [5, 1], "x": 1, "y": 0}, - {"matrix": [5, 2], "x": 3, "y": 0}, - {"matrix": [5, 3], "x": 4, "y": 0}, - - {"matrix": [0, 0], "x": 0.5, "y": 1.1}, - {"matrix": [0, 1], "x": 1.5, "y": 1.1}, - {"matrix": [0, 2], "x": 2.5, "y": 1.1}, - {"matrix": [0, 3], "x": 3.5, "y": 1.1}, - - {"matrix": [1, 0], "x": 0.5, "y": 2.1}, - {"matrix": [1, 1], "x": 1.5, "y": 2.1}, - {"matrix": [1, 2], "x": 2.5, "y": 2.1}, - {"matrix": [1, 3], "x": 3.5, "y": 2.1}, - - {"matrix": [2, 0], "x": 0.5, "y": 3.1}, - {"matrix": [2, 1], "x": 1.5, "y": 3.1}, - {"matrix": [2, 2], "x": 2.5, "y": 3.1}, - {"matrix": [2, 3], "x": 3.5, "y": 3.1}, - - {"matrix": [3, 0], "x": 0.5, "y": 4.1}, - {"matrix": [3, 1], "x": 1.5, "y": 4.1}, - {"matrix": [3, 2], "x": 2.5, "y": 4.1}, - {"matrix": [3, 3], "x": 3.5, "y": 4.1}, - - {"matrix": [4, 0], "x": 0.5, "y": 5.1}, - {"matrix": [4, 1], "x": 1.5, "y": 5.1}, - {"matrix": [4, 2], "x": 2.5, "y": 5.1}, - {"matrix": [4, 3], "x": 3.5, "y": 5.1} - ] } } } diff --git a/keyboards/custommk/genesis/rev2/keymaps/via/keymap.c b/keyboards/custommk/genesis/rev2/keymaps/via/keymap.c index 6739b8857d..eedf9b4dcf 100644 --- a/keyboards/custommk/genesis/rev2/keymaps/via/keymap.c +++ b/keyboards/custommk/genesis/rev2/keymaps/via/keymap.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - + #include QMK_KEYBOARD_H //#define GENESIS_LAYER_COLORS @@ -24,36 +24,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_via_6x4( - KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, - MO(1), KC_PSLS, KC_PAST, KC_PMNS, - KC_P7, KC_P8, KC_P9, KC_PGUP, - KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_P1, KC_P2, KC_P3, KC_PGDN, + [0] = LAYOUT_ortho_5x4( + MO(1), KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PGUP, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_PGDN, KC_P0, KC_SPC, KC_PDOT, KC_PENT), - [1] = LAYOUT_via_6x4( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + [1] = LAYOUT_ortho_5x4( + KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS), - [2] = LAYOUT_via_6x4( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + [2] = LAYOUT_ortho_5x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - [3] = LAYOUT_via_6x4( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + [3] = LAYOUT_ortho_5x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; @@ -92,80 +88,11 @@ void keyboard_post_init_user(void) { } #endif - -keyevent_t encoder_left_ccw = { - .key = (keypos_t){.row = 5, .col = 0}, - .pressed = false, - .type = KEY_EVENT -}; - -keyevent_t encoder_left_cw = { - .key = (keypos_t){.row = 5, .col = 1}, - .pressed = false, - .type = KEY_EVENT -}; - -keyevent_t encoder_right_ccw = { - .key = (keypos_t){.row = 5, .col = 2}, - .pressed = false, - .type = KEY_EVENT -}; - -keyevent_t encoder_right_cw = { - .key = (keypos_t){.row = 5, .col = 3}, - .pressed = false, - .type = KEY_EVENT +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) } }; - -void matrix_scan_user(void) { - if (encoder_left_ccw.pressed) { - encoder_left_ccw.pressed = false; - encoder_left_ccw.time = timer_read(); - action_exec(encoder_left_ccw); - } - - if (encoder_left_cw.pressed) { - encoder_left_cw.pressed = false; - encoder_left_cw.time = timer_read(); - action_exec(encoder_left_cw); - } - - if (encoder_right_ccw.pressed) { - encoder_right_ccw.pressed = false; - encoder_right_ccw.time = timer_read(); - action_exec(encoder_right_ccw); - } - - if (encoder_right_cw.pressed) { - encoder_right_cw.pressed = false; - encoder_right_cw.time = timer_read(); - action_exec(encoder_right_cw); - } - -} - - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - encoder_left_cw.pressed = true; - encoder_left_cw.time = timer_read(); - action_exec(encoder_left_cw); - } else { - encoder_left_ccw.pressed = true; - encoder_left_ccw.time = timer_read(); - action_exec(encoder_left_ccw); - } - } else { - if (clockwise) { - encoder_right_cw.pressed = true; - encoder_right_cw.time = timer_read(); - action_exec(encoder_right_cw); - } else { - encoder_right_ccw.pressed = true; - encoder_right_ccw.time = timer_read(); - action_exec(encoder_right_ccw); - } - } - return false; -} +#endif diff --git a/keyboards/custommk/genesis/rev2/keymaps/via/rules.mk b/keyboards/custommk/genesis/rev2/keymaps/via/rules.mk index 43061db1dd..1189f4ad19 100644 --- a/keyboards/custommk/genesis/rev2/keymaps/via/rules.mk +++ b/keyboards/custommk/genesis/rev2/keymaps/via/rules.mk @@ -1,2 +1,3 @@ VIA_ENABLE = yes -LTO_ENABLE = yes
\ No newline at end of file +LTO_ENABLE = yes +ENCODER_MAP_ENABLE = yes |