Hi All,
I am working on LPC1837 based development board, with "lpcopen_2_18_lpcxpresso_nxp_lpcxpresso_1837" SDK as start point. I am working on examples "usbd_rom_hid_keyboard" & "usbd_rom_hid_mouse" they work fine as USB keyboard/mouse device to host machine.
I see from the below logic of the code
even if the g_keyBoard.report is empty it is still writing to endpoint, this is creating a continuous stream of packets to host machine, I observed this using Bus-Hound software. Please give your inputs and how to fix this. I would like to send report only if valid data is present.
Thanks & Regards,
Vamshi G.
Hi vamshi krishna,
You can add the function to detect whether report changes between the Keyboard_UpdateReport() and USBD_API->hw->WriteEP(g_keyBoard.hUsb, HID_EP_IN, &g_keyBoard.report[0], KEYBOARD_REPORT_SIZE), if report keep same you can ignore the USBD_API->hw->WriteEP(g_keyBoard.hUsb, HID_EP_IN, &g_keyBoard.report[0], KEYBOARD_REPORT_SIZE), otherwise, execute it.
Hope it helps.
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi jeremyzhou,
I tried the mechanism as you mentioned, I believe there is some issue in USB ROM driver. once key is pressed, a report with key event is sent, after that I see its keep on sending the same event even if the keyboard report entries (g_keyBoard.report[]) are zero.
Please give your inputs.
Thanks & Regards,
Vamshi G.