diff options
| author | uestczyh222 <[email protected]> | 2017-12-04 01:58:59 +0800 |
|---|---|---|
| committer | uestczyh222 <[email protected]> | 2017-12-04 01:58:59 +0800 |
| commit | f3a96e2073a02885382d7c7d0cf3b8920a3bf1ae (patch) | |
| tree | 728a1bbc17c184d1fdb07f7962d579598819a97a | |
| parent | d8de70397e3ad78c073817a073e074db0118f25b (diff) | |
[Components][Deivers][USB][HID]fix bug and add send callback
| -rw-r--r-- | components/drivers/usb/usbdevice/class/hid.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/drivers/usb/usbdevice/class/hid.c b/components/drivers/usb/usbdevice/class/hid.c index 4c338f3b1f..05d4a1878d 100644 --- a/components/drivers/usb/usbdevice/class/hid.c +++ b/components/drivers/usb/usbdevice/class/hid.c @@ -372,7 +372,10 @@ static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size) RT_ASSERT(func->device != RT_NULL); data = (struct hid_s *) func->user_data; - + if(data->parent.tx_complete != RT_NULL) + { + data->parent.tx_complete(&data->parent,RT_NULL); + } return RT_EOK; } @@ -590,7 +593,7 @@ static void rt_usb_hid_init(struct ufunction *func) hiddev = (struct hid_s *)func->user_data; rt_memset(&hiddev->parent, 0, sizeof(hiddev->parent)); hiddev->parent.write = _hid_write; - + hiddev->func = func; rt_device_register(&hiddev->parent, "hidd", RT_DEVICE_FLAG_RDWR); rt_mq_init(&hiddev->hid_mq, "hiddmq", hid_mq_pool, sizeof(struct hid_report), sizeof(hid_mq_pool), RT_IPC_FLAG_FIFO); |
