This is another problem from above one.
You are enabling boot keyboard on the interface descriptor.
But it is not supported on your code at all.
/* Interface Descriptor */ { sizeof(USB_INTF_DSC), /* Size of this descriptor in bytes */ DSC_INTF, /* INTERFACE descriptor type */ 0, /* Interface Number */ 0, /* Alternate Setting Number */ 2, /* Number of endpoints in this intf */ HID_INTF, /* Class code */ BOOT_INTF_SUBCLASS, /* Subclass code */ <--------// keyboard: HID_PROTOCOL_KEYBOAD, /* Protocol code */ <--------// mouse:// HID_PROTOCOL_MOUSE, /* Protocol code */ 0 /* Interface string index */ }, 1) hid.c handles Get_Protocol and Set_Protocol requests properly, but Current_Active_Protocol is not initialized to report protocol (1) anywhere. Add the initialization to Init_EP_For_HID(), which is called from Set_Configuration handler.
#define HID_PROTOCOL_BOOT 0#define HID_PROTOCOL_REPORT 1void Init_EP_For_HID(void){ ... ... // <-------- add this line Current_Active_Protocol = HID_PROTOCOL_REPORT; // set to default report protocol return;}
2) While Current_Active_Protocol is boot protocol (0), return this "standard" keyboard report. No mouse report is sent to host.
offset (byte) 0 modifier keys 1 padding 2 - 7 keycode array
When Current_Active_Protocol is report protocol (1), both of keyboard and mouse reports are sent back in turn, as described above.
Tsuneo