mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-29 10:20:57 +00:00
house keeping
This commit is contained in:
parent
d3aed01874
commit
8c0bc38713
@ -75,24 +75,33 @@ void tusbh_cdc_unmounted_isr(uint8_t dev_addr)
|
||||
|
||||
void tusbh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
|
||||
{
|
||||
switch(event)
|
||||
if ( pipe_id == CDC_PIPE_DATA_IN )
|
||||
{
|
||||
case TUSB_EVENT_XFER_COMPLETE:
|
||||
for(uint32_t i=0; i<xferred_bytes; i++)
|
||||
{
|
||||
osal_queue_send(queue_hdl, buffer_in+i);
|
||||
}
|
||||
tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true);
|
||||
break;
|
||||
switch(event)
|
||||
{
|
||||
case TUSB_EVENT_XFER_COMPLETE:
|
||||
for(uint32_t i=0; i<xferred_bytes; i++)
|
||||
{
|
||||
osal_queue_send(queue_hdl, buffer_in+i);
|
||||
}
|
||||
tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true);
|
||||
break;
|
||||
|
||||
case TUSB_EVENT_XFER_ERROR:
|
||||
tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); // ignore & continue
|
||||
break;
|
||||
case TUSB_EVENT_XFER_ERROR:
|
||||
tusbh_cdc_receive(dev_addr, buffer_in, sizeof(buffer_in), true); // ignore & continue
|
||||
break;
|
||||
|
||||
case TUSB_EVENT_XFER_STALLED:
|
||||
default :
|
||||
ASSERT(false, (void) 0); // error
|
||||
break;
|
||||
}
|
||||
}else if (pipe_id == CDC_PIPE_DATA_OUT)
|
||||
{
|
||||
|
||||
}else if (pipe_id == CDC_PIPE_NOTIFICATION)
|
||||
{
|
||||
|
||||
case TUSB_EVENT_XFER_STALLED:
|
||||
default :
|
||||
ASSERT(false, (void) 0); // error
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user