diff options
author | Ryan Caltabiano <rcalt2vt@gmail.com> | 2019-05-18 15:12:35 -0500 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-05-18 13:47:34 -0700 |
commit | ba26736d7e0679e87e34add2445cdae541e2a0b8 (patch) | |
tree | 17e73d5ca62487609f1d57458cbafb72f5fd1f08 | |
parent | d85110b6ec5fcdf3ef88b41909ce739b017abbea (diff) | |
download | qmk_firmware-ba26736d7e0679e87e34add2445cdae541e2a0b8.tar.gz |
Fix bit count calculation for iterating layers
-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 be28107b6..dfcbc110a 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -303,7 +303,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)-1; i >= 0; i--) { + for (int8_t i = sizeof(layer_state_t) * 8 - 1; i >= 0; i--) { if (layers & (1UL << i)) { action = action_for_key(i, key); if (action.code != ACTION_TRANSPARENT) { |