From 200f020df922ac84ffc0e0c98c97a193e3180b1f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 5 Feb 2011 09:27:20 +0000 Subject: USB rework, step 1. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2708 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/USB_CDC/main.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'testhal') 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 @@ -232,6 +232,21 @@ static const USBDescriptor *get_descriptor(USBDriver *usbp, return NULL; } +/** + * @brief EP1 state. + */ +USBEndpointState ep1state; + +/** + * @brief EP2 state. + */ +USBEndpointState ep2state; + +/** + * @brief EP3 state. + */ +USBEndpointState ep3state; + /** * @brief EP1 initialization structure (IN only). */ @@ -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: -- cgit v1.2.3