Merge pull request #21 from KurtE/gigabyte_keyboard

Fix/workaround for Gigabyte keyboard
This commit is contained in:
Paul Stoffregen 2018-08-23 13:45:11 -07:00 committed by GitHub
commit 207ffd7682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -138,13 +138,24 @@ bool KeyboardController::claim(Device_t *dev, int type, const uint8_t *descripto
datapipe = new_Pipe(dev, 3, endpoint, 1, 8, interval);
datapipe->callback_function = callback;
queue_Data_Transfer(datapipe, report, 8, this);
mk_setup(setup, 0x21, 10, 0, 0, 0); // 10=SET_IDLE
mk_setup(setup, 0x21, 11, 0, 0, 0); // 11=SET_PROTOCOL BOOT
queue_Control_Transfer(dev, &setup, NULL, this);
return true;
}
void KeyboardController::control(const Transfer_t *transfer)
{
println("control callback (keyboard)");
print_hexbytes(transfer->buffer, transfer->length);
// To decode hex dump to human readable HID report summary:
// http://eleccelerator.com/usbdescreqparser/
uint32_t mesg = transfer->setup.word1;
println(" mesg = ", mesg, HEX);
if (mesg == 0x001021 && transfer->length == 0) { // SET_PROTOCOL
mk_setup(setup, 0x21, 10, 0, 0, 0); // 10=SET_IDLE
queue_Control_Transfer(device, &setup, NULL, this);
}
}
void KeyboardController::callback(const Transfer_t *transfer)