Esempio n. 1
0
static void mscd_flush(USBD* usbd, MSCD* mscd)
{
    int i;
    usbd_usb_ep_flush(usbd, mscd->ep_num);
    usbd_usb_ep_flush(usbd, USB_EP_IN | mscd->ep_num);
    for (i = 0; i < mscd->lun_count; ++i)
        scsis_reset(MSCD_SCSI(mscd)[i]);
    mscd->io_busy_mask = 0;
    mscd->io_owner = 0xff;
    mscd->state = MSCD_STATE_IDLE;
}
Esempio n. 2
0
void hidd_kbd_class_suspend(USBD* usbd, void* param)
{
    HIDD_KBD* hidd = (HIDD_KBD*)param;
    usbd_usb_ep_flush(usbd, USB_EP_IN | hidd->in_ep);
    hidd->state = USB_HID_KBD_IDLE;
    hidd->suspended = true;
}
Esempio n. 3
0
void cdc_acmd_class_suspend(USBD* usbd, void* param)
{
    CDC_ACMD* cdc_acmd = (CDC_ACMD*)param;
#if (USBD_CDC_ACM_TX_STREAM_SIZE)
    stream_stop_listen(cdc_acmd->tx_stream);
    stream_flush(cdc_acmd->tx_stream);
    usbd_usb_ep_flush(usbd, USB_EP_IN | cdc_acmd->data_ep);
    cdc_acmd->tx_idle = true;
    cdc_acmd->tx_size = 0;
#endif //USBD_CDC_ACM_TX_STREAM_SIZE
#if (USBD_CDC_ACM_RX_STREAM_SIZE)
    stream_flush(cdc_acmd->rx_stream);
    usbd_usb_ep_flush(usbd, cdc_acmd->data_ep);
    cdc_acmd->rx_free = 0;
#endif //USBD_CDC_ACM_RX_STREAM_SIZE

    if (cdc_acmd->control_ep)
    {
        usbd_usb_ep_flush(usbd, USB_EP_IN | cdc_acmd->control_ep);
        cdc_acmd->notify_busy = cdc_acmd->notify_pending = false;
    }
    cdc_acmd->suspended = true;
}