LPC17 USB host: Direction bit being set wrong from allocated control endpoints

This commit is contained in:
Gregory Nutt 2015-04-24 19:46:00 -06:00
parent 64fe226669
commit ed5287855f
2 changed files with 17 additions and 11 deletions

View File

@ -2059,9 +2059,15 @@ static int lpc17_epalloc(struct usbhost_driver_s *drvr,
(uint32_t)(epdesc->addr) << ED_CONTROL_EN_SHIFT | (uint32_t)(epdesc->addr) << ED_CONTROL_EN_SHIFT |
(uint32_t)(epdesc->mxpacketsize) << ED_CONTROL_MPS_SHIFT; (uint32_t)(epdesc->mxpacketsize) << ED_CONTROL_MPS_SHIFT;
/* Get the direction of the endpoint */ /* Get the direction of the endpoint. For control endpoints, the
* direction is in the TD.
*/
if (epdesc->in) if (epdesc->xfrtype == USB_EP_ATTR_XFER_CONTROL)
{
ed->hw.ctrl |= ED_CONTROL_D_TD1;
}
else if (epdesc->in)
{ {
ed->hw.ctrl |= ED_CONTROL_D_IN; ed->hw.ctrl |= ED_CONTROL_D_IN;
} }