Browse Source

Remove clear matrix on ADB recv error

led_matrix
tmk 10 years ago
parent
commit
cb434cfebc
2 changed files with 4 additions and 3 deletions
  1. 1
    3
      converter/adb_usb/matrix.c
  2. 3
    0
      protocol/adb.c

+ 1
- 3
converter/adb_usb/matrix.c View File

} else if (codes == 0xFFFF) { // power key release } else if (codes == 0xFFFF) { // power key release
register_key(0xFF); register_key(0xFF);
} else if (key0 == 0xFF) { // error } else if (key0 == 0xFF) { // error
if (debug_matrix) print("adb_host_kbd_recv: ERROR(matrix cleared.)\n");
// clear matrix to unregister all keys
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
xprintf("adb_host_kbd_recv: ERROR(%02X)\n", codes);
return key1; return key1;
} else { } else {
register_key(key0); register_key(key0);

+ 3
- 0
protocol/adb.c View File

#include <avr/io.h> #include <avr/io.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include "adb.h" #include "adb.h"
#include "debug.h"




static inline void data_lo(void); static inline void data_lo(void);
} }
if (!read_bit()) { // Startbit(1) if (!read_bit()) { // Startbit(1)
// Service Request // Service Request
dprintf("Startbit ERROR\n");
return -2; return -2;
} }


sei(); sei();


if (stop) { if (stop) {
dprintf("Stopbit ERROR\n");
return -3; return -3;
} }
return data; return data;