[Keyboard] Planck: Layout Macro Refactor (#4402)

* Planck: layout macro refactor

Unified layout macro names across AVR and ARM boards.

Currently certain layout macros are specific to either AVR or ARM when used in the QMK Configurator. If an AVR-specific macro is used for a Planck rev. 6, or an ARM-specific macro on a rev. 5 or earlier, the user receives a compile error.

* Update keyboards/planck/planck.h per @drashna

Changed KC_LAYOUT_ortho_4x12 alias to LAYOUT_kc_ortho_4x12.

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Add KC_KEYMAP alias for LAYOUT_kc macro

per @drashna
Update keyboards/planck/planck.h

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Fix LAYOUT_planck_1x2uC macro for Planck rev6

Thanks to drashna for testing.

* Fix inline comment regarding revisions

* Add specific info.json file for Planck rev6
This commit is contained in:
noroadsleft 2019-06-12 09:53:15 -07:00 committed by Drashna Jaelre
parent 29824f3cf7
commit f4840139a2
2 changed files with 388 additions and 117 deletions

View File

@ -9,50 +9,33 @@
#include "ez.h"
#endif
#ifdef __AVR__
#define LAYOUT_planck_mit( \
#ifdef __AVR__ // Planck revs. 1-5
#define LAYOUT_planck_1x2uC( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \
) \
{ \
) \
{ \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \
}
}
#define LAYOUT_planck_grid( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \
}
// Used to create a keymap using only KC_ prefixed keys
#define KC_KEYMAP( \
#define LAYOUT_ortho_4x12( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
LAYOUT_planck_grid( \
KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
)
#define KEYMAP LAYOUT_planck_grid
#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
{ \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \
}
#elif KEYBOARD_planck_rev6
@ -60,43 +43,9 @@
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
{ k30, k31, k32, k39, k3a, k3b }, \
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ k36, k37, k38, k33, k34, k35 } \
}
#define LAYOUT_planck_1x2uR( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
{ k30, k31, k32, k39, k3a, k3b }, \
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ k36, k37, k38, k33, k34, k35 } \
}
#define LAYOUT_planck_1x2uL( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b \
) \
{ \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
@ -104,16 +53,67 @@
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ k36, k37, k38, k33, k34, k35 } \
}
{ k36, k37, k38, k33, k34, KC_NO } \
}
#define LAYOUT_planck_2x2u( \
#define LAYOUT_planck_1x2uR( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k36, k38, k39, k3a, k3b \
) \
{ \
k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
{ k30, k31, k32, k39, k3a, k3b }, \
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ KC_NO, k37, k38, k33, k34, k35 } \
}
#define LAYOUT_planck_1x2uL( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k35, k36, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
{ k30, k31, k32, k39, k3a, k3b }, \
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ k36, k37, k38, k33, KC_NO, k35 } \
}
#define LAYOUT_planck_2x2u( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k35, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
{ k30, k31, k32, k39, k3a, k3b }, \
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ KC_NO, k37, k38, k33, KC_NO, k35 } \
}
#define LAYOUT_ortho_4x12( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
@ -122,29 +122,30 @@
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ k36, k37, k38, k33, k34, k35 } \
}
}
#define LAYOUT_planck_grid( \
#endif
// all Planck keyboards
// Used to create a keymap using only KC_ prefixed keys
#define LAYOUT_kc( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05 }, \
{ k10, k11, k12, k13, k14, k15 }, \
{ k20, k21, k22, k23, k24, k25 }, \
{ k30, k31, k32, k39, k3a, k3b }, \
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ k36, k37, k38, k33, k34, k35 } \
}
LAYOUT_ortho_4x12( \
KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
)
#define KEYMAP LAYOUT_planck_grid
#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
#endif
#define KEYMAP LAYOUT_ortho_4x12
#define LAYOUT_planck_mit LAYOUT_planck_1x2uC
#define LAYOUT_planck_grid LAYOUT_ortho_4x12
#define LAYOUT_kc_ortho_4x12 LAYOUT_kc
#define KC_KEYMAP LAYOUT_kc
#endif

View File

@ -0,0 +1,270 @@
{
"keyboard_name": "Planck",
"keyboard_folder": "planck",
"url": "https://olkb.com/planck",
"maintainer": "jackhumbert",
"width": 12,
"height": 4,
"layouts": {
"LAYOUT_ortho_4x12": {
"key_count": 48,
"layout": [
{ "x": 0, "y": 0 },
{ "x": 1, "y": 0 },
{ "x": 2, "y": 0 },
{ "x": 3, "y": 0 },
{ "x": 4, "y": 0 },
{ "x": 5, "y": 0 },
{ "x": 6, "y": 0 },
{ "x": 7, "y": 0 },
{ "x": 8, "y": 0 },
{ "x": 9, "y": 0 },
{ "x": 10, "y": 0 },
{ "x": 11, "y": 0 },
{ "x": 0, "y": 1 },
{ "x": 1, "y": 1 },
{ "x": 2, "y": 1 },
{ "x": 3, "y": 1 },
{ "x": 4, "y": 1 },
{ "x": 5, "y": 1 },
{ "x": 6, "y": 1 },
{ "x": 7, "y": 1 },
{ "x": 8, "y": 1 },
{ "x": 9, "y": 1 },
{ "x": 10, "y": 1 },
{ "x": 11, "y": 1 },
{ "x": 0, "y": 2 },
{ "x": 1, "y": 2 },
{ "x": 2, "y": 2 },
{ "x": 3, "y": 2 },
{ "x": 4, "y": 2 },
{ "x": 5, "y": 2 },
{ "x": 6, "y": 2 },
{ "x": 7, "y": 2 },
{ "x": 8, "y": 2 },
{ "x": 9, "y": 2 },
{ "x": 10, "y": 2 },
{ "x": 11, "y": 2 },
{ "x": 0, "y": 3 },
{ "x": 1, "y": 3 },
{ "x": 2, "y": 3 },
{ "x": 3, "y": 3 },
{ "x": 4, "y": 3 },
{ "x": 5, "y": 3 },
{ "x": 6, "y": 3 },
{ "x": 7, "y": 3 },
{ "x": 8, "y": 3 },
{ "x": 9, "y": 3 },
{ "x": 10, "y": 3 },
{ "x": 11, "y": 3 }
]
},
"LAYOUT_planck_1x2uC": {
"key_count": 47,
"layout": [
{ "x": 0, "y": 0 },
{ "x": 1, "y": 0 },
{ "x": 2, "y": 0 },
{ "x": 3, "y": 0 },
{ "x": 4, "y": 0 },
{ "x": 5, "y": 0 },
{ "x": 6, "y": 0 },
{ "x": 7, "y": 0 },
{ "x": 8, "y": 0 },
{ "x": 9, "y": 0 },
{ "x": 10, "y": 0 },
{ "x": 11, "y": 0 },
{ "x": 0, "y": 1 },
{ "x": 1, "y": 1 },
{ "x": 2, "y": 1 },
{ "x": 3, "y": 1 },
{ "x": 4, "y": 1 },
{ "x": 5, "y": 1 },
{ "x": 6, "y": 1 },
{ "x": 7, "y": 1 },
{ "x": 8, "y": 1 },
{ "x": 9, "y": 1 },
{ "x": 10, "y": 1 },
{ "x": 11, "y": 1 },
{ "x": 0, "y": 2 },
{ "x": 1, "y": 2 },
{ "x": 2, "y": 2 },
{ "x": 3, "y": 2 },
{ "x": 4, "y": 2 },
{ "x": 5, "y": 2 },
{ "x": 6, "y": 2 },
{ "x": 7, "y": 2 },
{ "x": 8, "y": 2 },
{ "x": 9, "y": 2 },
{ "x": 10, "y": 2 },
{ "x": 11, "y": 2 },
{ "x": 0, "y": 3 },
{ "x": 1, "y": 3 },
{ "x": 2, "y": 3 },
{ "x": 3, "y": 3 },
{ "x": 4, "y": 3 },
{ "x": 5, "y": 3, "w": 2 },
{ "x": 7, "y": 3 },
{ "x": 8, "y": 3 },
{ "x": 9, "y": 3 },
{ "x": 10, "y": 3 },
{ "x": 11, "y": 3 }
]
},
"LAYOUT_planck_1x2uL": {
"key_count": 47,
"layout": [
{ "x": 0, "y": 0 },
{ "x": 1, "y": 0 },
{ "x": 2, "y": 0 },
{ "x": 3, "y": 0 },
{ "x": 4, "y": 0 },
{ "x": 5, "y": 0 },
{ "x": 6, "y": 0 },
{ "x": 7, "y": 0 },
{ "x": 8, "y": 0 },
{ "x": 9, "y": 0 },
{ "x": 10, "y": 0 },
{ "x": 11, "y": 0 },
{ "x": 0, "y": 1 },
{ "x": 1, "y": 1 },
{ "x": 2, "y": 1 },
{ "x": 3, "y": 1 },
{ "x": 4, "y": 1 },
{ "x": 5, "y": 1 },
{ "x": 6, "y": 1 },
{ "x": 7, "y": 1 },
{ "x": 8, "y": 1 },
{ "x": 9, "y": 1 },
{ "x": 10, "y": 1 },
{ "x": 11, "y": 1 },
{ "x": 0, "y": 2 },
{ "x": 1, "y": 2 },
{ "x": 2, "y": 2 },
{ "x": 3, "y": 2 },
{ "x": 4, "y": 2 },
{ "x": 5, "y": 2 },
{ "x": 6, "y": 2 },
{ "x": 7, "y": 2 },
{ "x": 8, "y": 2 },
{ "x": 9, "y": 2 },
{ "x": 10, "y": 2 },
{ "x": 11, "y": 2 },
{ "x": 0, "y": 3 },
{ "x": 1, "y": 3 },
{ "x": 2, "y": 3 },
{ "x": 3, "y": 3 },
{ "x": 4, "y": 3, "w": 2 },
{ "x": 6, "y": 3 },
{ "x": 7, "y": 3 },
{ "x": 8, "y": 3 },
{ "x": 9, "y": 3 },
{ "x": 10, "y": 3 },
{ "x": 11, "y": 3 }
]
},
"LAYOUT_planck_1x2uR": {
"key_count": 47,
"layout": [
{ "x": 0, "y": 0 },
{ "x": 1, "y": 0 },
{ "x": 2, "y": 0 },
{ "x": 3, "y": 0 },
{ "x": 4, "y": 0 },
{ "x": 5, "y": 0 },
{ "x": 6, "y": 0 },
{ "x": 7, "y": 0 },
{ "x": 8, "y": 0 },
{ "x": 9, "y": 0 },
{ "x": 10, "y": 0 },
{ "x": 11, "y": 0 },
{ "x": 0, "y": 1 },
{ "x": 1, "y": 1 },
{ "x": 2, "y": 1 },
{ "x": 3, "y": 1 },
{ "x": 4, "y": 1 },
{ "x": 5, "y": 1 },
{ "x": 6, "y": 1 },
{ "x": 7, "y": 1 },
{ "x": 8, "y": 1 },
{ "x": 9, "y": 1 },
{ "x": 10, "y": 1 },
{ "x": 11, "y": 1 },
{ "x": 0, "y": 2 },
{ "x": 1, "y": 2 },
{ "x": 2, "y": 2 },
{ "x": 3, "y": 2 },
{ "x": 4, "y": 2 },
{ "x": 5, "y": 2 },
{ "x": 6, "y": 2 },
{ "x": 7, "y": 2 },
{ "x": 8, "y": 2 },
{ "x": 9, "y": 2 },
{ "x": 10, "y": 2 },
{ "x": 11, "y": 2 },
{ "x": 0, "y": 3 },
{ "x": 1, "y": 3 },
{ "x": 2, "y": 3 },
{ "x": 3, "y": 3 },
{ "x": 4, "y": 3 },
{ "x": 5, "y": 3 },
{ "x": 6, "y": 3, "w": 2 },
{ "x": 8, "y": 3 },
{ "x": 9, "y": 3 },
{ "x": 10, "y": 3 },
{ "x": 11, "y": 3 }
]
},
"LAYOUT_planck_2x2u": {
"key_count": 46,
"layout": [
{ "x": 0, "y": 0 },
{ "x": 1, "y": 0 },
{ "x": 2, "y": 0 },
{ "x": 3, "y": 0 },
{ "x": 4, "y": 0 },
{ "x": 5, "y": 0 },
{ "x": 6, "y": 0 },
{ "x": 7, "y": 0 },
{ "x": 8, "y": 0 },
{ "x": 9, "y": 0 },
{ "x": 10, "y": 0 },
{ "x": 11, "y": 0 },
{ "x": 0, "y": 1 },
{ "x": 1, "y": 1 },
{ "x": 2, "y": 1 },
{ "x": 3, "y": 1 },
{ "x": 4, "y": 1 },
{ "x": 5, "y": 1 },
{ "x": 6, "y": 1 },
{ "x": 7, "y": 1 },
{ "x": 8, "y": 1 },
{ "x": 9, "y": 1 },
{ "x": 10, "y": 1 },
{ "x": 11, "y": 1 },
{ "x": 0, "y": 2 },
{ "x": 1, "y": 2 },
{ "x": 2, "y": 2 },
{ "x": 3, "y": 2 },
{ "x": 4, "y": 2 },
{ "x": 5, "y": 2 },
{ "x": 6, "y": 2 },
{ "x": 7, "y": 2 },
{ "x": 8, "y": 2 },
{ "x": 9, "y": 2 },
{ "x": 10, "y": 2 },
{ "x": 11, "y": 2 },
{ "x": 0, "y": 3 },
{ "x": 1, "y": 3 },
{ "x": 2, "y": 3 },
{ "x": 3, "y": 3 },
{ "x": 4, "y": 3, "w": 2 },
{ "x": 6, "y": 3, "w": 2 },
{ "x": 8, "y": 3 },
{ "x": 9, "y": 3 },
{ "x": 10, "y": 3 },
{ "x": 11, "y": 3 }
]
}
}
}