aboutsummaryrefslogtreecommitdiff
path: root/converter/x68k_usb/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/x68k_usb/matrix.c')
-rw-r--r--converter/x68k_usb/matrix.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/converter/x68k_usb/matrix.c b/converter/x68k_usb/matrix.c
index 954e7ef12..2d5a1e116 100644
--- a/converter/x68k_usb/matrix.c
+++ b/converter/x68k_usb/matrix.c
@@ -21,8 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21#include <util/delay.h> 21#include <util/delay.h>
22#include "print.h" 22#include "print.h"
23#include "util.h" 23#include "util.h"
24#include "x68k.h" 24#include "serial.h"
25#include "matrix.h" 25#include "matrix.h"
26#include "debug.h"
26 27
27 28
28/* 29/*
@@ -63,7 +64,7 @@ uint8_t matrix_cols(void)
63 64
64void matrix_init(void) 65void matrix_init(void)
65{ 66{
66 x68k_init(); 67 serial_init();
67 68
68 // initialize matrix state: all keys off 69 // initialize matrix state: all keys off
69 for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; 70 for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
@@ -75,13 +76,13 @@ uint8_t matrix_scan(void)
75{ 76{
76 is_modified = false; 77 is_modified = false;
77 78
78 uint8_t code; 79 uint16_t code;
79 code = x68k_recv(); 80 code = serial_recv2();
80 if (code == 0) { 81 if (code == -1) {
81 return 0; 82 return 0;
82 } 83 }
83 84
84 phex(code); print(" "); 85 dprintf("%02X\n", code);
85 if (code&0x80) { 86 if (code&0x80) {
86 // break code 87 // break code
87 if (matrix_is_on(ROW(code), COL(code))) { 88 if (matrix_is_on(ROW(code), COL(code))) {