diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-15 09:53:25 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-15 09:53:25 +0000 |
commit | b42882d13952219febf49029771939df3fc6210f (patch) | |
tree | 6303321ce8aa218052522bbfde2094b75dc2917a | |
parent | 0d927aae48e9e84af8df0376c7520b0f4abc0f10 (diff) | |
download | ChibiOS-b42882d13952219febf49029771939df3fc6210f.tar.gz ChibiOS-b42882d13952219febf49029771939df3fc6210f.tar.bz2 ChibiOS-b42882d13952219febf49029771939df3fc6210f.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4094 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/platforms/STM32/OTGv1/usb_lld.c | 8 | ||||
-rw-r--r-- | testhal/STM32F4xx/USB_CDC/main.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c index 36ef53298..a33f7810d 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.c +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c @@ -479,6 +479,9 @@ void usb_lld_start(USBDriver *usbp) { /* Soft core reset.*/
otg_core_reset();
+ /* Internal FS PHY activation.*/
+ OTG->GCCFG = GCCFG_PWRDWN;
+
/* - Forced device mode.
- USB turn-around time = TRDT_VALUE.
- Full Speed 1.1 PHY.*/
@@ -528,6 +531,7 @@ void usb_lld_stop(USBDriver *usbp) { }
#endif
}
+ OTG->GCCFG = 0;
}
/**
@@ -720,9 +724,7 @@ usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { */
void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf) {
- (void)usbp;
- (void)ep;
- (void)buf;
+ memcpy(buf, usbp->epc[ep]->setup_buf, 8);
}
/**
diff --git a/testhal/STM32F4xx/USB_CDC/main.c b/testhal/STM32F4xx/USB_CDC/main.c index 3ca3b70d0..ff6b2e15b 100644 --- a/testhal/STM32F4xx/USB_CDC/main.c +++ b/testhal/STM32F4xx/USB_CDC/main.c @@ -421,6 +421,8 @@ int main(void) { */
sduObjectInit(&SDU1);
sduStart(&SDU1, &serusbcfg);
+ usbDisconnectBus(serusbcfg.usbp);
+ chThdSleepMilliseconds(100);
usbConnectBus(serusbcfg.usbp);
/*
|