aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-13 17:07:30 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-13 17:07:30 +0000
commit25d731ed0b6a4beb1a3b01c20f8e150dc12a8848 (patch)
treec1babeae2f25e4bfe45e9b1e87a718a15d42420a
parentf620f29e0a803ed942134ac8a801d5204cebe034 (diff)
downloadChibiOS-25d731ed0b6a4beb1a3b01c20f8e150dc12a8848.tar.gz
ChibiOS-25d731ed0b6a4beb1a3b01c20f8e150dc12a8848.tar.bz2
ChibiOS-25d731ed0b6a4beb1a3b01c20f8e150dc12a8848.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4274 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c
index 5dc5a1052..d8e0f138d 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.c
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c
@@ -775,6 +775,9 @@ void usb_lld_reset(USBDriver *usbp) {
OTG->GRXFSIZ = STM32_USB_OTG1_RX_FIFO_SIZE / 4;
otg_rxfifo_flush();
+ /* Resets the device address to zero.*/
+ OTG->DCFG = (OTG->DCFG & ~DCFG_DAD_MASK) | DCFG_DAD(0);
+
/* Enables also EP-related interrupt sources.*/
OTG->GINTMSK |= GINTMSK_RXFLVLM | GINTMSK_OEPM | GINTMSK_IEPM;
OTG->DIEPMSK = DIEPMSK_TOCM | DIEPMSK_XFRCM;