From 54478aaa2a57e62f946581f492da5792741116f9 Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Tue, 1 Oct 2019 23:28:41 -0400 Subject: [PATCH] dcd_msp430x5xx: Add STALL support for nonzero endpoints. --- src/portable/ti/msp430x5xx/dcd_msp430x5xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c b/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c index 121dd03a..5202f156 100644 --- a/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c +++ b/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c @@ -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); + } } /*------------------------------------------------------------------*/