summaryrefslogtreecommitdiff
path: root/converter/pc98_usb/matrix.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-02-22 19:37:27 +0900
committertmk <nobody@nowhere>2013-02-22 19:37:27 +0900
commit4a91d182776a956c5442debbaf7a8af047d429c0 (patch)
treed8c56ca5deac251d1beb6ed3ef8c27f764ea3aa2 /converter/pc98_usb/matrix.c
parenteb776c1b7918f320b717cedfd8957f55e53c5adf (diff)
Add keymap for PC98
Diffstat (limited to 'converter/pc98_usb/matrix.c')
-rw-r--r--converter/pc98_usb/matrix.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c
index ef2bc38186..2f1e821c5d 100644
--- a/converter/pc98_usb/matrix.c
+++ b/converter/pc98_usb/matrix.c
@@ -65,6 +65,7 @@ void matrix_init(void)
{
print_enable = true;
debug_enable = true;
+ //debug_matrix = true;
PC98_RST_DDR |= (1<<PC98_RST_BIT);
PC98_RDY_DDR |= (1<<PC98_RDY_BIT);
@@ -99,32 +100,15 @@ uint8_t matrix_scan(void)
{
is_modified = false;
- uint8_t code;
+ uint16_t code;
PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
_delay_us(30);
- code = serial_recv();
+ code = serial_recv2();
PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
- if (!code) return 0;
+ if (code == -1) return 0;
debug_hex(code); debug(" ");
-/*
- switch (code) {
- case 0x7E: // reset fail
- case 0xFE: // layout
- case 0xFF: // reset success
- _delay_ms(500);
- // ignore response byte
- debug("(response ignored:");
- while ((code = serial_recv())) { debug(" "); debug_hex(code); }
- debug(") ");
- // FALL THROUGH
- case 0x7F:
- // all keys up
- for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
- return 0;
- }
-
if (code&0x80) {
// break code
if (matrix_is_on(ROW(code), COL(code))) {
@@ -138,7 +122,6 @@ uint8_t matrix_scan(void)
is_modified = true;
}
}
-*/
return code;
}