aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-05 09:27:20 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-05 09:27:20 +0000
commit200f020df922ac84ffc0e0c98c97a193e3180b1f (patch)
treec0be7c7ff21bcd04fad5cacfb30109a0dffad4c4 /testhal/STM32
parentb920ab090fca4c5ccb7142e8332b5ae77f082a79 (diff)
downloadChibiOS-200f020df922ac84ffc0e0c98c97a193e3180b1f.tar.gz
ChibiOS-200f020df922ac84ffc0e0c98c97a193e3180b1f.tar.bz2
ChibiOS-200f020df922ac84ffc0e0c98c97a193e3180b1f.zip
USB rework, step 1.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2708 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32')
-rw-r--r--testhal/STM32/USB_CDC/main.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/testhal/STM32/USB_CDC/main.c b/testhal/STM32/USB_CDC/main.c
index 943edbb05..70a27a8f2 100644
--- a/testhal/STM32/USB_CDC/main.c
+++ b/testhal/STM32/USB_CDC/main.c
@@ -233,6 +233,21 @@ static const USBDescriptor *get_descriptor(USBDriver *usbp,
}
/**
+ * @brief EP1 state.
+ */
+USBEndpointState ep1state;
+
+/**
+ * @brief EP2 state.
+ */
+USBEndpointState ep2state;
+
+/**
+ * @brief EP3 state.
+ */
+USBEndpointState ep3state;
+
+/**
* @brief EP1 initialization structure (IN only).
*/
static const USBEndpointConfig ep1config = {
@@ -284,9 +299,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
case USB_EVENT_CONFIGURED:
/* Enables the endpoints specified into the configuration.*/
chSysLock();
- usbEnableEndpointI(usbp, DATA_REQUEST_EP, &ep1config);
- usbEnableEndpointI(usbp, INTERRUPT_REQUEST_EP, &ep2config);
- usbEnableEndpointI(usbp, DATA_AVAILABLE_EP, &ep3config);
+ usbInitEndpointI(usbp, DATA_REQUEST_EP, &ep1state, &ep1config);
+ usbInitEndpointI(usbp, INTERRUPT_REQUEST_EP, &ep2state, &ep2config);
+ usbInitEndpointI(usbp, DATA_AVAILABLE_EP, &ep3state, &ep3config);
chSysUnlock();
return;
case USB_EVENT_SUSPEND: