|
|
@ -40,10 +40,15 @@ static uint8_t kbuf_tail = 0;
|
|
|
|
void vusb_transfer_keyboard(void)
|
|
|
|
void vusb_transfer_keyboard(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (usbInterruptIsReady()) {
|
|
|
|
if (usbInterruptIsReady()) {
|
|
|
|
if (kbuf_head != kbuf_tail) {
|
|
|
|
if (kbuf_head != kbuf_tail) {
|
|
|
|
usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t));
|
|
|
|
usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t));
|
|
|
|
|
|
|
|
if (!debug_keyboard) {
|
|
|
|
|
|
|
|
print("keys: ");
|
|
|
|
|
|
|
|
for (int i = 0; i < REPORT_KEYS; i++) { phex(kbuf[kbuf_tail].keys[i]); print(" "); }
|
|
|
|
|
|
|
|
print(" mods: "); phex((kbuf[kbuf_tail]).mods); print("\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
kbuf_tail = (kbuf_tail + 1) % KBUF_SIZE;
|
|
|
|
kbuf_tail = (kbuf_tail + 1) % KBUF_SIZE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|