feat(core): Make physical layout key rotation optional (#2770)

To be able to save on flash space, for layouts on space constrained
devices that don't require rotation, make key rotation props
optional behind a new Kconfig flag.
This commit is contained in:
Pete Johanson
2025-01-15 14:48:18 -07:00
committed by GitHub
parent 6941abc2af
commit c367d8f636
5 changed files with 19 additions and 3 deletions

View File

@@ -46,9 +46,11 @@ BUILD_ASSERT(
.height = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, height), \
.x = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, x), \
.y = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, y), \
.rx = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, rx), \
.ry = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, ry), \
.r = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, r), \
COND_CODE_1(IS_ENABLED(CONFIG_ZMK_PHYSICAL_LAYOUT_KEY_ROTATION), \
(.rx = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, rx), \
.ry = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, ry), \
.r = (int16_t)(int32_t)DT_INST_PHA_BY_IDX(n, keys, i, r), ), \
()) \
}
#define ZMK_LAYOUT_INST(n) \