uint32_t max_periodic_len = _hc->multi_count * _hc->max_packet;
if (_hc->xfer_len > max_periodic_len)
{
- _hc->xfer_len = max_periodic_len;
+// _hc->xfer_len = max_periodic_len;
}
else
{
break;
case PIPE_INTERRUPT:
DWC_DEBUGPL(DBG_HCDV, " Interrupt transfer complete\n");
- update_urb_state_xfer_comp(_hc, _hc_regs, urb, _qtd);
-
+ urb_xfer_done = update_urb_state_xfer_comp(_hc, _hc_regs, urb, _qtd);
+ if(!urb_xfer_done){
+ save_data_toggle(_hc, _hc_regs, _qtd);
+ halt_channel(_hcd, _hc, _qtd, DWC_OTG_HC_XFER_NAK);
+ break;
+ }
/*
* Interrupt URB is done on the first transfer complete
* interrupt.
break;
case PIPE_INTERRUPT:
_qtd->error_count = 0;
+ update_urb_state_xfer_intr(_hc, _hc_regs, _qtd->urb,_qtd, DWC_OTG_HC_XFER_NAK);
+ save_data_toggle(_hc, _hc_regs, _qtd);
halt_channel(_hcd, _hc, _qtd, DWC_OTG_HC_XFER_NAK);
break;
case PIPE_ISOCHRONOUS: