Skip to content

Commit

Permalink
Rely on introspection to handle OOB access. (qmk#21247)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc authored and akeep committed Oct 2, 2023
1 parent fdc632c commit 41eee5d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions quantum/dynamic_keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,13 @@ void dynamic_keymap_reset(void) {
for (int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++) {
for (int row = 0; row < MATRIX_ROWS; row++) {
for (int column = 0; column < MATRIX_COLS; column++) {
if (layer < keymap_layer_count()) {
dynamic_keymap_set_keycode(layer, row, column, keycode_at_keymap_location_raw(layer, row, column));
} else {
dynamic_keymap_set_keycode(layer, row, column, KC_TRANSPARENT);
}
dynamic_keymap_set_keycode(layer, row, column, keycode_at_keymap_location_raw(layer, row, column));
}
}
#ifdef ENCODER_MAP_ENABLE
for (int encoder = 0; encoder < NUM_ENCODERS; encoder++) {
if (layer < encodermap_layer_count()) {
dynamic_keymap_set_encoder(layer, encoder, true, keycode_at_encodermap_location_raw(layer, encoder, true));
dynamic_keymap_set_encoder(layer, encoder, false, keycode_at_encodermap_location_raw(layer, encoder, false));
} else {
dynamic_keymap_set_encoder(layer, encoder, true, KC_TRANSPARENT);
dynamic_keymap_set_encoder(layer, encoder, false, KC_TRANSPARENT);
}
dynamic_keymap_set_encoder(layer, encoder, true, keycode_at_encodermap_location_raw(layer, encoder, true));
dynamic_keymap_set_encoder(layer, encoder, false, keycode_at_encodermap_location_raw(layer, encoder, false));
}
#endif // ENCODER_MAP_ENABLE
}
Expand Down

0 comments on commit 41eee5d

Please sign in to comment.