X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=converter%2Fxt_usb%2Fmatrix.c;h=b556c0cc26967ac03612bd9f3668eaf8056f21b9;hb=773a9195a63b1348e86b0ba440e7a8bfdd39cb9e;hp=92fa693595a4012b631a08da74f18601c42dc10b;hpb=f37805e698a34ce07f10c7f5316f9bbd2a63563b;p=max%2Ftmk_keyboard.git
diff --git a/converter/xt_usb/matrix.c b/converter/xt_usb/matrix.c
index 92fa6935..b556c0cc 100644
--- a/converter/xt_usb/matrix.c
+++ b/converter/xt_usb/matrix.c
@@ -28,10 +28,6 @@ along with this program. If not, see .
static void matrix_make(uint8_t code);
static void matrix_break(uint8_t code);
-static void matrix_clear(void);
-#ifdef MATRIX_HAS_GHOST
-static bool matrix_has_ghost_in_row(uint8_t row);
-#endif
static uint8_t matrix[MATRIX_ROWS];
#define ROW(code) (code>>3)
@@ -41,20 +37,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define PRINT_SCREEN (0x7C)
#define PAUSE (0x7D)
-static bool is_modified = false;
-
-
-inline
-uint8_t matrix_rows(void)
-{
- return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
- return MATRIX_COLS;
-}
void matrix_init(void)
{
@@ -132,14 +114,13 @@ uint8_t matrix_scan(void)
} state = INIT;
- is_modified = false;
-
// 'pseudo break code' hack
if (matrix_is_on(ROW(PAUSE), COL(PAUSE))) {
matrix_break(PAUSE);
}
uint8_t code = xt_host_recv();
+ if (code) xprintf("%02X ", code);
switch (state) {
case INIT:
switch (code) {
@@ -151,10 +132,8 @@ uint8_t matrix_scan(void)
break;
default: // normal key make
if (code < 0x80 && code != 0x00) {
- xprintf("make: %X\r\n", code);
matrix_make(code);
} else if (code > 0x80 && code < 0xFF && code != 0x00) {
- xprintf("break %X\r\n", code);
matrix_break(code - 0x80);
}
state = INIT;
@@ -237,83 +216,17 @@ 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<