Migrate Dilemma 3x5_3 to info.json

Remove rgb matrix layout macro from 3x5_3.c
Remove defines from config.h and rules.mk that are now in info.json
Refactor default keymap to use core tri-layer subsystem
Added default keymap readme
This commit is contained in:
casuanoob 2023-09-07 06:23:16 +10:00
parent 9353250cdc
commit 701b0734eb
5 changed files with 25 additions and 121 deletions

View File

@ -20,92 +20,6 @@
#include "quantum.h" #include "quantum.h"
/**
* LEDs index.
*
* 0 - 17 Underglow 36 - 53 Underglow
*
* 22 21 20 19 18 54 55 56 57 58
*
* 23 24 25 26 27 63 62 61 60 59
*
* 32 31 30 29 28 64 65 66 67 68
*
* 33 34 35 71 70 69
*
*/
// clang-format off
#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
/* Key Matrix to LED index. */
// Left split.
{ 22, 21, 20, 19, 18 }, // Top row
{ 23, 24, 25, 26, 27 }, // Middle row
{ 32, 31, 30, 29, 28 }, // Bottom row
{ 34, 35, 33, NO_LED, NO_LED }, // Thumb cluster
// Right split.
{ 58, 57, 56, 55, 54 }, // Top row
{ 59, 60, 61, 62, 63 }, // Middle row
{ 68, 67, 66, 65, 64 }, // Bottom row
{ 70, 71, 69, NO_LED, NO_LED }, // Thumb cluster
}, {
/* LED index to physical position. */
// Left split underglow.
/* index=0 */ { 82, 0 }, { 60, 0 }, { 22, 0 }, { 15, 0 }, // Top 4
/* index=4 */ { 0, 25 }, { 0, 40 }, { 0, 55 }, // Pinky edge 3
/* index=7 */ { 15, 45 }, { 30, 45 }, { 35, 60 }, { 55, 62 }, // Bottom 8
/* index=11 */ { 72, 64 }, { 90, 64 }, { 98, 47 }, { 107, 40 },
/* index=15 */ { 110, 33 }, { 110, 19 }, { 110, 5 }, // Inner edge 3
// Left split per-key.
/* index=18 */ { 73, 11 }, { 56, 9 }, { 39, 5 }, { 22, 10 }, { 5, 15 }, // row 1 (left most) 90, 107
/* index=23 */ { 5, 30 }, { 22, 25 }, { 39, 20 }, { 56, 24 }, { 73, 26 }, // row 2 (middle)
/* index=28 */ { 73, 41 }, { 56, 39 }, { 39, 35 }, { 22, 25 }, { 5, 45 }, // row 3 (left most)
/* index=33 */ { 45, 51 }, { 64, 53 }, { 81, 60 }, // Thumb cluster
// Right split underglow.
/* index=36 */ { 142, 0 }, { 164, 0 }, { 202, 0 }, { 209, 0 }, // Top 4
/* index=40 */ { 224, 25 }, { 224, 40 }, { 224, 55 }, // Pinky edge 3
/* index=43 */ { 209, 45 }, { 194, 45 }, { 189, 60 }, { 169, 62 }, // Bottom 8
/* index=47 */ { 152, 64 }, { 134, 64 }, { 126, 47 }, { 117, 40 },
/* index=51 */ { 114, 33 }, { 114, 19 }, { 114, 5 }, // Inner edge 3
// Right split per-key.
/* index=54 */ { 151, 11 }, { 168, 9 }, { 185, 5 }, { 202, 10 }, { 219, 15 }, // row 1 (right most) 117 134
/* index=59 */ { 219, 30 }, { 202, 25 }, { 185, 20 }, { 168, 24 }, { 151, 26 }, // row 2 (middle)
/* index=64 */ { 151, 41 }, { 168, 39 }, { 185, 35 }, { 202, 25 }, { 219, 45 }, // row 3 (right most)
/* index=69 */ { 179, 51 }, { 160, 53 }, { 143, 60 }, // Thumb cluster
}, {
/* LED index to flag. */
// Left split underglow.
/* index=0 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=3 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=6 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=9 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=12 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=15 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
// Left split per-key.
/* index=18 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 1
/* index=21 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 2
/* index=24 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
/* index=27 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
/* index=30 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
/* index=33 */ LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, // Thumb cluster
// Right split underglow.
/* index=36 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=39 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=42 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=45 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=48 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
/* index=51 */ LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
// Right split per-key.
/* index=54 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 10
/* index=57 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 9
/* index=60 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
/* index=63 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
/* index=66 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
/* index=69 */ LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, // Thumb cluster
} };
#endif
// clang-format on
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) { bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { if (!encoder_update_user(index, clockwise)) {

View File

@ -29,12 +29,6 @@
#define CRC8_USE_TABLE #define CRC8_USE_TABLE
#define CRC8_OPTIMIZE_SPEED #define CRC8_OPTIMIZE_SPEED
/* Encoders. */
#define ENCODERS_PAD_A \
{ GP25 }
#define ENCODERS_PAD_B \
{ GP24 }
/* Cirque trackpad over SPI. */ /* Cirque trackpad over SPI. */
#define SPI_SCK_PIN GP22 #define SPI_SCK_PIN GP22
#define SPI_MOSI_PIN GP23 #define SPI_MOSI_PIN GP23
@ -47,16 +41,9 @@
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17
/* Bootmagic. */
#define BOOTMAGIC_LITE_ROW_RIGHT 4
#define BOOTMAGIC_LITE_COLUMN_RIGHT 0
/* RGB matrix support. */ /* RGB matrix support. */
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
# define SPLIT_TRANSPORT_MIRROR # define SPLIT_TRANSPORT_MIRROR
# define RGB_MATRIX_LED_COUNT 72
# define RGB_MATRIX_SPLIT { 36, 36 }
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 50
# define RGB_DISABLE_WHEN_USB_SUSPENDED # define RGB_DISABLE_WHEN_USB_SUSPENDED
# define RGB_MATRIX_KEYPRESSES # define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS # define RGB_MATRIX_FRAMEBUFFER_EFFECTS

View File

@ -15,6 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "keycodes.h"
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
enum dilemma_keymap_layers { enum dilemma_keymap_layers {
@ -24,8 +25,8 @@ enum dilemma_keymap_layers {
LAYER_NUM, LAYER_NUM,
}; };
#define NAV MO(LAYER_NAV) #define NAV TRI_LAYER_LOWER_LAYER
#define SYM MO(LAYER_SYM) #define SYM TRI_LAYER_UPPER_LAYER
// clang-format off // clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@ -33,11 +34,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮ // ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯ // ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
KC_A, NAV, CW_TOGG, KC_SPC, SYM, KC_A KC_LCTL, NAV, KC_LGUI, KC_SPC, SYM, KC_A
// ╰───────────────────────────╯ ╰──────────────────────────╯ // ╰───────────────────────────╯ ╰──────────────────────────╯
), ),
@ -45,11 +46,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮ // ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_DEL, KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_DEL,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_LSFT, KC_LCTL, KC_LALT, KC_RGUI, KC_VOLD, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
QK_BOOT, EE_CLR, KC_MPRV, KC_MNXT, KC_MPLY, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, KC_ENT, QK_BOOT, EE_CLR, KC_MPRV, KC_MNXT, KC_MPLY, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, KC_ENT,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯ // ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
KC_A, _______, KC_LSFT, KC_SPC, _______, KC_A XXXXXXX, _______, KC_LSFT, KC_SPC, _______, KC_ESC
// ╰───────────────────────────╯ ╰──────────────────────────╯ // ╰───────────────────────────╯ ╰──────────────────────────╯
), ),
@ -59,9 +60,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_MINS, KC_ASTR, KC_EQL, KC_UNDS, KC_DLR, KC_HASH, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT, KC_MINS, KC_ASTR, KC_EQL, KC_UNDS, KC_DLR, KC_HASH, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_PLUS, KC_PIPE, KC_AT, KC_SLSH, KC_PERC, _______, KC_BSLS, KC_AMPR, KC_QUES, KC_EXLM, KC_PLUS, KC_PIPE, KC_AT, KC_SLSH, KC_PERC, KC_SCLN, KC_BSLS, KC_AMPR, KC_QUES, KC_EXLM,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯ // ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
KC_A, _______, KC_LSFT, KC_SPC, _______, KC_A KC_ESC, _______, KC_LSFT, KC_SPC, _______, XXXXXXX
// ╰───────────────────────────╯ ╰──────────────────────────╯ // ╰───────────────────────────╯ ╰──────────────────────────╯
), ),
@ -73,12 +74,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤ // ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯ // ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
KC_A, _______, KC_LSFT, KC_SPC, _______, KC_A XXXXXXX, _______, KC_LSFT, KC_SPC, _______, XXXXXXX
// ╰───────────────────────────╯ ╰──────────────────────────╯ // ╰───────────────────────────╯ ╰──────────────────────────╯
), ),
}; };
// clang-format on // clang-format on
layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, LAYER_NAV, LAYER_SYM, LAYER_NUM);
}

View File

@ -0,0 +1,3 @@
# Dilemma 3x5+3 default keymap
> :bulb: Have a look at the [`via` keymap](../via) for a more feature-rich layout.

View File

@ -1,28 +1,31 @@
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable
# #
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite #BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys #MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control #EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover #NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output AUDIO_ENABLE = no # Audio output
MAGIC_ENABLE = yes # Magic keycodes MAGIC_ENABLE = yes # Magic keycodes
TRI_LAYER_ENABLE = yes # Tri Layers TRI_LAYER_ENABLE = yes # Tri Layers
CAPS_WORD_ENABLE = yes # Caps Word #CAPS_WORD_ENABLE = yes # Caps Word
ENCODER_ENABLE = yes # Enable encoder support #ENCODER_ENABLE = yes # Enable encoder support
AUDIO_SUPPORTED = no # Audio is not supported AUDIO_SUPPORTED = no # Audio is not supported
RGB_MATRIX_SUPPORTED = yes # RGB matrix is supported and enabled by default #RGB_MATRIX_SUPPORTED = yes # RGB matrix is supported and enabled by default
RGBLIGHT_SUPPORTED = no # RGB underglow is supported, but not enabled by default RGBLIGHT_SUPPORTED = no # RGB underglow is supported, but not enabled by default
RGB_MATRIX_ENABLE = yes # Enable keyboard RGB matrix functionality #RGB_MATRIX_ENABLE = yes # Enable keyboard RGB matrix functionality
SERIAL_DRIVER = vendor SERIAL_DRIVER = vendor
POINTING_DEVICE_ENABLE = yes POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = cirque_pinnacle_spi POINTING_DEVICE_DRIVER = cirque_pinnacle_spi
SPLIT_KEYBOARD = yes #SPLIT_KEYBOARD = yes
# RP2040-specific options
PICO_INTRINSICS_ENABLED = no # ATM Unsupported by ChibiOS.