diff --git a/keyboards/handwired/corydora/config.h b/keyboards/handwired/corydora/config.h index 246e70c51765..3afce518d169 100644 --- a/keyboards/handwired/corydora/config.h +++ b/keyboards/handwired/corydora/config.h @@ -21,4 +21,3 @@ #define ENCODERS_PAD_A { GP4 } #define ENCODERS_PAD_B { GP5 } #define DIP_SWITCH_PINS { GP6 } - diff --git a/keyboards/handwired/corydora/info.json b/keyboards/handwired/corydora/info.json index e89a8a4cfddf..ab8cefc2306c 100644 --- a/keyboards/handwired/corydora/info.json +++ b/keyboards/handwired/corydora/info.json @@ -12,9 +12,19 @@ "mousekey": true, "nkro": true }, + "encoder": { + "enabled": true, + "rotary": [ + {"pin_a": "GP4", "pin_b": "GP5"} + ] + }, + "dip_switch" : { + "enabled": true, + "pins": ["GP6"] + }, "matrix_pins": { "rows": ["GP14", "GP15", "GP26"], - "cols": ["GP27", "GP28", "GP29"] + "cols": ["GP29", "GP28", "GP27"] }, "processor": "RP2040", "url": "", @@ -26,15 +36,15 @@ "layouts": { "LAYOUT_ortho_3x3": { "layout": [ - { "matrix": [0, 0], "x": 0, "y": 0 }, - { "matrix": [0, 1], "x": 1, "y": 0 }, - { "matrix": [0, 2], "x": 2, "y": 0 }, - { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [0, 0], "x": 0, "y": 2 }, + { "matrix": [0, 1], "x": 0, "y": 1 }, + { "matrix": [0, 2], "x": 0, "y": 0 }, + { "matrix": [1, 0], "x": 1, "y": 2 }, { "matrix": [1, 1], "x": 1, "y": 1 }, - { "matrix": [1, 2], "x": 2, "y": 1 }, - { "matrix": [2, 0], "x": 0, "y": 2 }, - { "matrix": [2, 1], "x": 1, "y": 2 }, - { "matrix": [2, 2], "x": 2, "y": 2 } + { "matrix": [1, 2], "x": 1, "y": 0 }, + { "matrix": [2, 0], "x": 2, "y": 2 }, + { "matrix": [2, 1], "x": 2, "y": 1 }, + { "matrix": [2, 2], "x": 0, "y": 1 } ] } } diff --git a/keyboards/handwired/corydora/keymaps/default/keymap.c b/keyboards/handwired/corydora/keymaps/default/keymap.c index 3d4f14988ce4..a2387c0c98ce 100644 --- a/keyboards/handwired/corydora/keymaps/default/keymap.c +++ b/keyboards/handwired/corydora/keymaps/default/keymap.c @@ -11,10 +11,10 @@ uint8_t current_layer = 0; // Tracks the current layer uint16_t last_switch_time = 0; // Tracks the last time the layer was switched const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_ortho_3x3(KC_3, KC_2, KC_1, KC_6, KC_5, KC_4, KC_9, KC_8, KC_7), - [1] = LAYOUT_ortho_3x3(KC_C, KC_B, KC_A, KC_F, KC_E, KC_D, KC_I, KC_H, KC_G), - [2] = LAYOUT_ortho_3x3(KC_3, KC_2, KC_1, KC_6, KC_5, KC_4, KC_9, KC_8, KC_7), - [3] = LAYOUT_ortho_3x3(KC_C, KC_B, KC_A, KC_F, KC_E, KC_D, KC_I, KC_H, KC_G), + [0] = LAYOUT_ortho_3x3(KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9), + [1] = LAYOUT_ortho_3x3(KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9), + [2] = LAYOUT_ortho_3x3(KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9), + [3] = LAYOUT_ortho_3x3(KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, QK_BOOT), }; // OLED @@ -64,6 +64,15 @@ bool oled_task_user() { #endif +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU)}, + [1] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN)}, + [2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [3] = { ENCODER_CCW_CW(KC_MNXT, KC_MPRV)} +}; +#endif + // Encode Knob bool encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { /* First encoder */ diff --git a/keyboards/handwired/corydora/keymaps/via/keymap.c b/keyboards/handwired/corydora/keymaps/via/keymap.c index 54b95174bedf..57512a598e4d 100644 --- a/keyboards/handwired/corydora/keymaps/via/keymap.c +++ b/keyboards/handwired/corydora/keymaps/via/keymap.c @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H -#include "timer.h" +#include "timer.h" #define NUM_LAYERS 4 // Constant for the number of layers #define DEBOUNCE_TIME 200 // Debounce time in milliseconds @@ -64,6 +64,15 @@ bool oled_task_user() { #endif +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU)}, + [1] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN)}, + [2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [3] = { ENCODER_CCW_CW(KC_MNXT, KC_MPRV)} +}; +#endif + // Encode Knob bool encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { /* First encoder */ diff --git a/keyboards/handwired/corydora/keymaps/via/rules.mk b/keyboards/handwired/corydora/keymaps/via/rules.mk index a021e1e69993..5840e824308c 100644 --- a/keyboards/handwired/corydora/keymaps/via/rules.mk +++ b/keyboards/handwired/corydora/keymaps/via/rules.mk @@ -1,4 +1,4 @@ VIA_ENABLE = yes - +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/handwired/corydora/readme.md b/keyboards/handwired/corydora/readme.md index 421be9deb2b8..9d84c707eecc 100644 --- a/keyboards/handwired/corydora/readme.md +++ b/keyboards/handwired/corydora/readme.md @@ -24,4 +24,4 @@ Enter the bootloader in 3 ways: * **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard * **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead -* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available (default set to Key 9 of Profile #4!) diff --git a/keyboards/handwired/corydora/rules.mk b/keyboards/handwired/corydora/rules.mk index eb80840d7c21..a4c70337e0a9 100644 --- a/keyboards/handwired/corydora/rules.mk +++ b/keyboards/handwired/corydora/rules.mk @@ -1,7 +1,7 @@ -# This file intentionally left blank OLED_ENABLE = yes LTO_ENABLE = yes ENCODER_ENABLE = yes +ENCODER_MAP_ENABLE = yes DIP_SWITCH_ENABLE = yes VIA_ENABLE = yes diff --git a/keyboards/handwired/corydora/via.json b/keyboards/handwired/corydora/via.json index 62fd58aba678..8786ac97524f 100644 --- a/keyboards/handwired/corydora/via.json +++ b/keyboards/handwired/corydora/via.json @@ -3,14 +3,14 @@ "vendorId": "0x4344", "productId": "0x0001", "matrix": { - "rows": 3, + "rows": 4, "cols": 3 }, "layouts": { "keymap": [ ["0,0", "0,1", "0,2"], ["1,0", "1,1", "1,2"], - ["2,0", "2,1", "2,2"] + ["2,0", "2,1", "2,2", "3,0\n\n\n\n\n\n\n\n\ne0"] ] } }