Martin,
I couldn't get the code sample to toggle the Num Lock LED on my system - it was causing a stall. It started working after setting the Report Type to 0x02 (output) instead of the Report ID.
Here is the sample code:
else if (0x53 == code) { /* Num Lock */
ucOutReport ^= 0x01; /* toggle NumLock bit */
usbstat = usb_class_hid_set_report(
&hid_com,
0x02, 0x00,
&ucOutReport,
1);
if(USB_STATUS_TRANSFER_QUEUED != usbstat)
{
printf("Error during SET_REPORT 0x%08x\n", usbstat);
}
}
Here is what I changed:
else if (0x53 == code) { /* Num Lock */
ucOutReport ^= 0x01; /* toggle NumLock bit */
usbstat = usb_class_hid_set_report(
&hid_com,
0x00, 0x02, // here is where I made the change
&ucOutReport,
1);
if(USB_STATUS_TRANSFER_QUEUED != usbstat)
{
printf("Error during SET_REPORT 0x%08x\n", usbstat);
}
}
Does this look correct? Or could there be some other issue that I am not seeing?
Regards,
Allen