usb: hid: fix write to interrupt IN endpoint

A HID application can no longer write to the default
interrupt IN endpoint because the addresses are assigned
dynamically. Add hid_int_ep_write() function  and leave
it to the hid-core to call the usb_write() with the correct
endpoint address.

fixes: #8424

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2018-06-16 01:35:51 +02:00 committed by Carles Cufí
commit 085a8b75c5
4 changed files with 14 additions and 4 deletions

View file

@ -154,6 +154,9 @@ struct hid_ops {
void usb_hid_register_device(const u8_t *desc, size_t size,
const struct hid_ops *op);
/* Write to hid interrupt endpoint */
int hid_int_ep_write(const u8_t *data, u32_t data_len, u32_t *bytes_ret);
/* Initialize USB HID */
int usb_hid_init(void);