summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-04-01 16:34:36 +0700
committerhathach <[email protected]>2022-04-01 16:34:36 +0700
commite6e3dfedc815007d07ea455df04569604d87a856 (patch)
treef012de203db61466a187604f6feb7ce187359639
parent75bca96bc630b98723c9f4bbb4958dac22ac594d (diff)
hid example work well
m---------lib/Pico-PIO-USB0
-rw-r--r--src/class/hid/hid_host.c2
-rw-r--r--src/host/usbh.c2
-rw-r--r--src/portable/raspberrypi/pio/hcd_pio.c42
4 files changed, 2 insertions, 44 deletions
diff --git a/lib/Pico-PIO-USB b/lib/Pico-PIO-USB
-Subproject 4220c05dc6b7ab7b4db33e5e05bb66be7b6c715
+Subproject 650130ab312e0dc9337dc52cccf34d35875abdf
diff --git a/src/class/hid/hid_host.c b/src/class/hid/hid_host.c
index ce3d1598c..2573f5a6b 100644
--- a/src/class/hid/hid_host.c
+++ b/src/class/hid/hid_host.c
@@ -329,7 +329,7 @@ bool hidh_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *de
TU_VERIFY(TUSB_CLASS_HID == desc_itf->bInterfaceClass);
- TU_LOG2("HID opening Interface %u (addr = %u)\r\n", desc_itf->bInterfaceNumber, dev_addr);
+ TU_LOG2("[%u] HID opening Interface %u\r\n", dev_addr, desc_itf->bInterfaceNumber);
// len = interface + hid + n*endpoints
uint16_t const drv_len = sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + desc_itf->bNumEndpoints*sizeof(tusb_desc_endpoint_t);
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 520ef4c7d..c127ef310 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -792,7 +792,7 @@ bool usbh_edpt_xfer_with_callback(uint8_t dev_addr, uint8_t ep_addr, uint8_t * b
static bool usbh_edpt_control_open(uint8_t dev_addr, uint8_t max_packet_size)
{
- TU_LOG2("Open EP0 with Size = %u (addr = %u)\r\n", max_packet_size, dev_addr);
+ TU_LOG2("[%u] Open EP0 with Size = %u\r\n", dev_addr, max_packet_size);
tusb_desc_endpoint_t ep0_desc =
{
diff --git a/src/portable/raspberrypi/pio/hcd_pio.c b/src/portable/raspberrypi/pio/hcd_pio.c
index 4eff490c8..037ebc132 100644
--- a/src/portable/raspberrypi/pio/hcd_pio.c
+++ b/src/portable/raspberrypi/pio/hcd_pio.c
@@ -155,48 +155,6 @@ bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const
usb_device_t *device = &usb_device[0];
return pio_usb_endpoint_open(rhport, dev_addr, (uint8_t const*) desc_ep);
-
-#if 0
- static uint8_t ep_id_idx; // TODO remove later
-
- if (ep_desc->bEndpointAddress == 0)
- {
- device->event = EVENT_NONE;
- device->address = dev_addr;
-
- ep_id_idx = 0;
- }else if (ep_desc->bmAttributes.xfer == TUSB_XFER_INTERRUPT) // only support interrupt endpoint
- {
- endpoint_t *ep = NULL;
- for ( int ep_pool_idx = 0; ep_pool_idx < PIO_USB_EP_POOL_CNT; ep_pool_idx++ )
- {
- if ( ep_pool[ep_pool_idx].ep_num == 0 )
- {
- ep = &ep_pool[ep_pool_idx];
- device->endpoint_id[ep_id_idx] = ep_pool_idx + 1;
- ep_id_idx++;
-
- ep->data_id = 0;
- ep->ep_num = ep_desc->bEndpointAddress;
- ep->interval = ep_desc->bInterval;
- ep->interval_counter = 0;
- ep->size = (uint8_t) tu_edpt_packet_size(ep_desc);
- ep->attr = EP_ATTR_INTERRUPT;
-
- break;
- }
- }
-
-// TU_LOG1_INT(device->connected);
-// TU_LOG1_INT(device->root);
-// TU_LOG1_INT(device->is_root);
-// TU_LOG1_INT(device->is_fullspeed);
-//
-// TU_LOG1_INT(ep_id_idx);
- }
-
- return true;
-#endif
}
bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t buflen)