From 4cf2b307593837b9a71dca3ab5b4a3e17aa9ef1b Mon Sep 17 00:00:00 2001 From: Nathan Conrad Date: Wed, 11 Sep 2019 09:43:57 -0400 Subject: [PATCH] Fix bug where the EPREGs were not being initialized as expected. --- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 11 ++++++----- src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index 1681d641..b8353b7c 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -216,10 +216,11 @@ void dcd_init (uint8_t rhport) USB->ISTR &= ~(USB_ISTR_ALL_EVENTS); // Clear pending interrupts - // Clear all EPREG - for(uint16_t i=0; i<8; i++) + // Reset endpoints to disabled + for(uint i=0; iDADDR = 0u; // disable USB peripheral by clearing the EF flag // Clear all EPREG (or maybe this is automatic? I'm not sure) - for(uint16_t i=0; i<8; i++) + for(uint i=0; i