소스 검색

faster, less bits :)

Jeremiah 8 년 전
부모
커밋
b9b2244b82
1개의 변경된 파일2개의 추가작업 그리고 9개의 파일을 삭제
  1. 2 9
      tmk_core/common/keyboard.c

+ 2 - 9
tmk_core/common/keyboard.c

@@ -76,15 +76,8 @@ static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata){
 
 static inline bool countones(matrix_row_t row)
 {
-    int count = 0;
-    while (row > 0){
-        count += 1;
-        row &= row-1;
-    }
-    if (count > 1){
-        return true;
-    }
-    return false;
+    row &= row-1;
+    return row;
 }
 
 static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata)