summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-09 23:31:18 +0700
committerhathach <[email protected]>2019-05-09 23:31:18 +0700
commit77bc421359845c2fe4591b0ae19e513b9a84c05b (patch)
treee5d54acbfcd594025edf7b107ddfc0066fff0919 /src/portable
parent81cb1c9510e4b4ccb03d165b4248fdf5688dd8ba (diff)
fix clear stall usage, fix reset data toggle with dcd_clear_stall for nrf52
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/nordic/nrf5x/dcd_nrf5x.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/portable/nordic/nrf5x/dcd_nrf5x.c b/src/portable/nordic/nrf5x/dcd_nrf5x.c
index 3e5f69f79..53f92bb19 100644
--- a/src/portable/nordic/nrf5x/dcd_nrf5x.c
+++ b/src/portable/nordic/nrf5x/dcd_nrf5x.c
@@ -322,7 +322,12 @@ void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
if ( tu_edpt_number(ep_addr) )
{
+ // clear stall
NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_UnStall << USBD_EPSTALL_STALL_Pos) | ep_addr;
+
+ // reset data toggle to DATA0
+ NRF_USBD->DTOGGLE = (USBD_DTOGGLE_VALUE_Data0 << USBD_DTOGGLE_VALUE_Pos) | ep_addr;
+
__ISB(); __DSB();
}
}