summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorRyan Caltabiano <rcalt2vt@gmail.com>2019-05-18 15:12:35 -0500
committerFlorian Didron <fdidron@users.noreply.github.com>2019-07-27 11:25:58 +0900
commita393d4d43e879a0238f224732577a70a26ebe912 (patch)
tree1ed67e423b6dee8cc2924aa23015da020110d4fd /tmk_core
parent8253427f12bea961443bb0cb1c22171a4ccd8db0 (diff)
Fix bit count calculation for iterating layers
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/action_layer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c
index be28107b63..dfcbc110ad 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) {