]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - keyboard/hbkb/matrix.c
Fix matrix.c to use new default impl.
[max/tmk_keyboard.git] / keyboard / hbkb / matrix.c
index ee32312d9a2de3431618c3a3ca550f62e8490b6b..86c18b4b2af77de69941055fa899c3781535e870 100644 (file)
@@ -41,26 +41,11 @@ static uint8_t debouncing = DEBOUNCE;
 static matrix_row_t matrix[MATRIX_ROWS];
 static matrix_row_t matrix_debouncing[MATRIX_ROWS];
 
-#ifdef MATRIX_HAS_GHOST
-static bool matrix_has_ghost_in_row(uint8_t row);
-#endif
 static matrix_row_t read_cols(void);
 static void unselect_rows(void);
 static void select_row(uint8_t row);
 
 
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
 void matrix_init(void)
 {
     // JTAG disable for PORT F. write JTD bit twice within four cycles.
@@ -110,56 +95,12 @@ uint8_t matrix_scan(void)
     return 1;
 }
 
-bool matrix_is_modified(void)
-{
-    if (debouncing) return false;
-    return true;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & ((matrix_row_t)1<<col));
-}
-
 inline
 matrix_row_t matrix_get_row(uint8_t row)
 {
     return matrix[row];
 }
 
-void matrix_print(void)
-{
-    print("\nr/c 01234567\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        phex(row); print(": ");
-        pbin_reverse(matrix_get_row(row));
-#ifdef MATRIX_HAS_GHOST
-        if (matrix_has_ghost_in_row(row)) {
-            print(" <ghost");
-        }
-#endif
-        print("\n");
-    }
-}
-
-#ifdef MATRIX_HAS_GHOST
-inline
-static bool matrix_has_ghost_in_row(uint8_t row)
-{
-    // no ghost exists in case less than 2 keys on
-    if (((matrix[row] - 1) & matrix[row]) == 0)
-        return false;
-
-    // ghost exists in case same state as other row
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
-        if (i != row && (matrix[i] & matrix[row]))
-            return true;
-    }
-    return false;
-}
-#endif
-
 inline
 static matrix_row_t read_cols(void)
 {