]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - converter/sun_usb/matrix.c
lufa: Fix comment on INTERRUPT_CONTROL_ENDPOINT
[max/tmk_keyboard.git] / converter / sun_usb / matrix.c
index 3126bd33ca4b2bfcd3d3becff57c764d420226ae..0cea3700c6e185a8c413f554cc245eb2701f774b 100644 (file)
@@ -24,6 +24,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "matrix.h"
 #include "debug.h"
 #include "protocol/serial.h"
+#include "led.h"
+#include "host.h"
 
 
 /*
@@ -46,20 +48,6 @@ static uint8_t matrix[MATRIX_ROWS];
 #define ROW(code)      ((code>>3)&0xF)
 #define COL(code)      (code&0x07)
 
-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)
 {
@@ -87,13 +75,13 @@ void matrix_init(void)
         }
     }
     print(" Done\n");
+
+    PORTD &= ~(1<<6);
     return;
 }
 
 uint8_t matrix_scan(void)
 {
-    is_modified = false;
-
     uint8_t code;
     code = serial_recv();
     if (!code) return 0;
@@ -131,56 +119,18 @@ uint8_t matrix_scan(void)
         // break code
         if (matrix_is_on(ROW(code), COL(code))) {
             matrix[ROW(code)] &= ~(1<<COL(code));
-            is_modified = true;
         }
     } else {
         // make code
         if (!matrix_is_on(ROW(code), COL(code))) {
             matrix[ROW(code)] |=  (1<<COL(code));
-            is_modified = true;
         }
     }
     return code;
 }
 
-bool matrix_is_modified(void)
-{
-    return is_modified;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-    return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
 inline
 uint8_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));
-        print("\n");
-    }
-}
-
-uint8_t matrix_key_count(void)
-{
-    uint8_t count = 0;
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        count += bitpop(matrix[i]);
-    }
-    return count;
-}