소스 검색

fixes 'layer_state_cmp' when layer is '1' (aka layer 0, aka layer 1<<0)

Colin T.A. Gray 7 년 전
부모
커밋
3aec9a4354
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      tmk_core/common/action_layer.c

+ 2 - 2
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)