guard check for open iso pipe
This commit is contained in:
parent
66586ffb08
commit
6d30ae1f32
|
@ -314,7 +314,7 @@ tusb_descriptor_endpoint_t const desc_ept_iso_in =
|
||||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||||
.bEndpointAddress = 0x83,
|
.bEndpointAddress = 0x83,
|
||||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
.bmAttributes = { .xfer = TUSB_XFER_ISOCHRONOUS },
|
||||||
.wMaxPacketSize = 1024,
|
.wMaxPacketSize = 1024,
|
||||||
.bInterval = 1
|
.bInterval = 1
|
||||||
};
|
};
|
||||||
|
|
|
@ -348,6 +348,9 @@ pipe_handle_t hcd_pipe_open(uint8_t dev_addr, tusb_descriptor_endpoint_t const *
|
||||||
{
|
{
|
||||||
pipe_handle_t const null_handle = { .dev_addr = 0, .xfer_type = 0, .index = 0 };
|
pipe_handle_t const null_handle = { .dev_addr = 0, .xfer_type = 0, .index = 0 };
|
||||||
|
|
||||||
|
if (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS)
|
||||||
|
return null_handle; // TODO not support ISO yet
|
||||||
|
|
||||||
//------------- find a free queue head -------------//
|
//------------- find a free queue head -------------//
|
||||||
uint8_t index=0;
|
uint8_t index=0;
|
||||||
while( index<EHCI_MAX_QHD && ehci_data.device[dev_addr].qhd[index].used )
|
while( index<EHCI_MAX_QHD && ehci_data.device[dev_addr].qhd[index].used )
|
||||||
|
@ -378,8 +381,6 @@ pipe_handle_t hcd_pipe_open(uint8_t dev_addr, tusb_descriptor_endpoint_t const *
|
||||||
list_head->next.type = EHCI_QUEUE_ELEMENT_QHD;
|
list_head->next.type = EHCI_QUEUE_ELEMENT_QHD;
|
||||||
|
|
||||||
return (pipe_handle_t) { .dev_addr = dev_addr, .xfer_type = p_endpoint_desc->bmAttributes.xfer, .index = index};
|
return (pipe_handle_t) { .dev_addr = dev_addr, .xfer_type = p_endpoint_desc->bmAttributes.xfer, .index = index};
|
||||||
|
|
||||||
// return null_handle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
Loading…
Reference in New Issue