1
0
Fork 0

[Bug] Prevent dynamic keymaps from processing layers that don't exist (#19225)

This commit is contained in:
Drashna Jael're 2022-12-31 16:55:14 -08:00 committed by GitHub
parent d0ebafaea6
commit ac561b9473
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 69 deletions

View file

@ -17,7 +17,11 @@ uint8_t keymap_layer_count(void) {
return NUM_KEYMAP_LAYERS;
}
#ifdef DYNAMIC_KEYMAP_ENABLE
_Static_assert(NUM_KEYMAP_LAYERS <= MAX_LAYER, "Number of keymap layers exceeds maximum set by DYNAMIC_KEYMAP_LAYER_COUNT");
#else
_Static_assert(NUM_KEYMAP_LAYERS <= MAX_LAYER, "Number of keymap layers exceeds maximum set by LAYER_STATE_(8|16|32)BIT");
#endif
uint16_t keycode_at_keymap_location_raw(uint8_t layer_num, uint8_t row, uint8_t column) {
if (layer_num < NUM_KEYMAP_LAYERS && row < MATRIX_ROWS && column < MATRIX_COLS) {