- is_modified = false;
-
- uint8_t code;
- PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
- _delay_us(30);
- code = serial_recv();
- PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
- if (!code) 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;
+ uint16_t code;
+ code = serial_recv2();
+ if (code == -1) {
+#ifdef PC98_LED_CONTROL
+ // Before sending command we have to make sure that there is no unprocessed key in queue
+ // otherwise keys will be missed during sending command
+ if (pc98_led) {
+ pc98_led_set();
+ pc98_led = 0;
+ }
+#endif
+ return 0;