X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=converter%2Fadb_usb%2Fmatrix.c;h=8f6a0dc9a81382af76d437aa47fc78069b243d28;hb=62e92645e6fd2d900e3a9c5b1fcfd2842ea55dc8;hp=6190c71a06c8d33bb1f4425628837284e4bb7ab7;hpb=b653b622a623f0e8e2c03af8254e6ac3d29b71c7;p=max%2Ftmk_keyboard.git
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index 6190c71a..8f6a0dc9 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -31,44 +31,18 @@ along with this program. If not, see .
#include "host.h"
-#if (MATRIX_COLS > 16)
-# error "MATRIX_COLS must not exceed 16"
-#endif
-#if (MATRIX_ROWS > 255)
-# error "MATRIX_ROWS must not exceed 255"
-#endif
static bool has_media_keys = false;
static bool is_iso_layout = false;
-static bool is_modified = false;
static report_mouse_t mouse_report = {};
// matrix state buffer(1:on, 0:off)
-#if (MATRIX_COLS <= 8)
-static uint8_t matrix[MATRIX_ROWS];
-#else
-static uint16_t matrix[MATRIX_ROWS];
-#endif
+static matrix_row_t matrix[MATRIX_ROWS];
-#ifdef MATRIX_HAS_GHOST
-static bool matrix_has_ghost_in_row(uint8_t row);
-#endif
static void register_key(uint8_t key);
-inline
-uint8_t matrix_rows(void)
-{
- return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
- return MATRIX_COLS;
-}
-
void matrix_init(void)
{
// LED on
@@ -208,8 +182,6 @@ uint8_t matrix_scan(void)
uint16_t codes;
uint8_t key0, key1;
- is_modified = false;
-
codes = extra_key;
extra_key = 0xFFFF;
@@ -328,93 +300,12 @@ uint8_t matrix_scan(void)
return 1;
}
-bool matrix_is_modified(void)
-{
- return is_modified;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-#ifdef MATRIX_HAS_GHOST
- for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
- if (matrix_has_ghost_in_row(i))
- return true;
- }
-#endif
- return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
- return (matrix[row] & (1<