diff options
Diffstat (limited to 'tmk_core/common/action_layer.c')
-rw-r--r-- | tmk_core/common/action_layer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 81f86f0f3..af2d7d964 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -257,7 +257,7 @@ uint8_t layer_switch_get_layer(keypos_t key) { layer_state_t layers = layer_state | default_layer_state; /* check top layer first */ - for (int8_t i = sizeof(layer_state_t) * 8 - 1; i >= 0; i--) { + for (int8_t i = MAX_LAYER - 1; i >= 0; i--) { if (layers & (1UL << i)) { action = action_for_key(i, key); if (action.code != ACTION_TRANSPARENT) { |