mirror of
https://github.com/gdsports/USBHost_t36
synced 2024-12-22 07:18:54 -05:00
Fix/workaround for Gigabyte keyboard
The gigabyte keyboard has an N key rollover input, that is different than all of our current keyboards. So this code tells (currently All) keyboards to choose their boot protocol, which gets us back to the standard boot definition. Which alllows these keyboards to function like others.
This commit is contained in:
parent
e857a2728a
commit
51eea763d7
13
keyboard.cpp
13
keyboard.cpp
@ -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 = new_Pipe(dev, 3, endpoint, 1, 8, interval);
|
||||||
datapipe->callback_function = callback;
|
datapipe->callback_function = callback;
|
||||||
queue_Data_Transfer(datapipe, report, 8, this);
|
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);
|
queue_Control_Transfer(dev, &setup, NULL, this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardController::control(const Transfer_t *transfer)
|
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)
|
void KeyboardController::callback(const Transfer_t *transfer)
|
||||||
|
Loading…
Reference in New Issue
Block a user