| 399 | } |
| 400 | |
| 401 | static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size) |
| 402 | { |
| 403 | struct hid_s *data; |
| 404 | struct hid_report report; |
| 405 | RT_ASSERT(func != RT_NULL); |
| 406 | RT_ASSERT(func->device != RT_NULL); |
| 407 | data = (struct hid_s *) func->user_data; |
| 408 | |
| 409 | if(size != 0) |
| 410 | { |
| 411 | rt_memcpy((void *)&report,(void*)data->ep_out->buffer,size); |
| 412 | report.size = size-1; |
| 413 | rt_mq_send(&data->hid_mq,(void *)&report,sizeof(report)); |
| 414 | } |
| 415 | |
| 416 | data->ep_out->request.buffer = data->ep_out->buffer; |
| 417 | data->ep_out->request.size = EP_MAXPACKET(data->ep_out); |
| 418 | data->ep_out->request.req_type = UIO_REQUEST_READ_BEST; |
| 419 | rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request); |
| 420 | return RT_EOK; |
| 421 | } |
| 422 | |
| 423 | static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size) |
| 424 | { |
nothing calls this directly
no test coverage detected