diff options
author | Colin T.A. Gray <colinta@gmail.com> | 2017-12-11 08:53:50 -0700 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-12-15 13:23:30 -0500 |
commit | 3aec9a4354440f36adbfb8e1a1feb9942724b74c (patch) | |
tree | a8e8a2bcecc0651fa6f9ecdf383453f0ef29dfec /tmk_core | |
parent | 163ddd5d155d8403cf41bea6465e21b59dba9e0f (diff) | |
download | firmware-3aec9a4354440f36adbfb8e1a1feb9942724b74c.tar.gz firmware-3aec9a4354440f36adbfb8e1a1feb9942724b74c.tar.bz2 firmware-3aec9a4354440f36adbfb8e1a1feb9942724b74c.zip |
fixes 'layer_state_cmp' when layer is '1' (aka layer 0, aka layer 1<<0)
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common/action_layer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 46ea58727..9dfbba9da 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -94,8 +94,8 @@ bool layer_state_is(uint8_t layer) } bool layer_state_cmp(uint32_t cmp_layer_state, uint8_t layer) { - if (layer == 0) { return cmp_layer_state == 0; } - return (cmp_layer_state & (1UL<<layer)) > 0; + if (!cmp_layer_state) { return layer == 0; } + return (cmp_layer_state & (1UL<<layer)) != 0; } void layer_move(uint8_t layer) |