dcd_msp430x5xx: Add STALL support for nonzero endpoints.

This commit is contained in:
William D. Jones 2019-10-01 23:28:41 -04:00
parent fad44c03c8
commit 54478aaa2a
1 changed files with 12 additions and 0 deletions

View File

@ -346,6 +346,11 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
USBIEPCNF_0 |= STALL;
}
}
else
{
ep_regs_t ep_regs = EP_REGS(epnum, dir);
ep_regs[CNF] |= STALL;
}
}
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
@ -366,6 +371,13 @@ void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
USBIEPCNT_0 &= ~STALL;
}
}
else
{
ep_regs_t ep_regs = EP_REGS(epnum, dir);
// Required by USB spec to reset DATA toggle bit to DATA0 on interrupt
// and bulk endpoints.
ep_regs[CNF] &= ~(STALL + TOGGLE);
}
}
/*------------------------------------------------------------------*/