adb_usb: Poll R0 of unsupported device

This commit is contained in:
tmk 2022-05-29 13:58:00 +09:00
parent d8991ce621
commit 3d6e5cd570
2 changed files with 2 additions and 6 deletions

View file

@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// https://github.com/tmk/tmk_keyboard/issues/724
#define ADB_MOUSE_2ND_BUTTON_QUIRK
// Scan unsupported devices with register0 when SRQ is asserted
#define ADB_SRQ_SCAN_REG0
/* ADB port setting */
#define ADB_PORT PORTD

View file

@ -715,7 +715,7 @@ again:
case 5:
case 6:
if (device_table[addr].addr_default == 0) {
xprintf("R:Unspported at $%X. R3:%04X\n", addr, reg3);
xprintf("R:Unsupported at $%X. R3:%04X\n", addr, reg3);
device_table[addr].addr_default = addr;
device_table[addr].handler_default = reg3 & 0xFF;
device_table[addr].handler = reg3 & 0xFF;
@ -876,15 +876,14 @@ void hook_main_loop(void)
}
break;
default:
// Unsupported device
len = adb_host_talk_buf(addr, ADB_REG_0, buf, sizeof(buf));
if (len) {
#ifdef ADB_SRQ_SCAN_REG0
xprintf("$%X R0: [ ", addr);
for (uint8_t i = 0; i < len; i++) {
xprintf("%02X ", buf[i]);
}
xprintf("]\n");
#endif
busy = 1;
}
break;