浏览代码

Merge pull request #21 from KurtE/gigabyte_keyboard

Fix/workaround for Gigabyte keyboard
main
Paul Stoffregen 6 年前
父节点
当前提交
207ffd7682
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. +12
    -1
      keyboard.cpp

+ 12
- 1
keyboard.cpp 查看文件

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)

正在加载...
取消
保存