aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-11 19:43:14 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-11 19:43:14 +0000
commit41eb1a7e7ec33ee7abd62fa954be6b995d6e9707 (patch)
treebcbf580082029a5eb25177ab2d466ecbce708604
parent467af68aa0cee886e76025952705bfe73ae477b2 (diff)
downloadChibiOS-41eb1a7e7ec33ee7abd62fa954be6b995d6e9707.tar.gz
ChibiOS-41eb1a7e7ec33ee7abd62fa954be6b995d6e9707.tar.bz2
ChibiOS-41eb1a7e7ec33ee7abd62fa954be6b995d6e9707.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4271 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/src/serial_usb.c4
-rw-r--r--testhal/STM32F4xx/USB_CDC/main.c21
2 files changed, 20 insertions, 5 deletions
diff --git a/os/hal/src/serial_usb.c b/os/hal/src/serial_usb.c
index 5fec52a68..52be6e975 100644
--- a/os/hal/src/serial_usb.c
+++ b/os/hal/src/serial_usb.c
@@ -288,8 +288,8 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) {
(void)ep;
- chnAddFlagsI(sdup, CHN_OUTPUT_EMPTY);
chSysLockFromIsr();
+ chnAddFlagsI(sdup, CHN_OUTPUT_EMPTY);
if ((n = chOQGetFullI(&sdup->oqueue)) > 0) {
/* The endpoint cannot be busy, we are in the context of the callback,
@@ -321,8 +321,8 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) {
(void)ep;
- chnAddFlagsI(sdup, CHN_INPUT_AVAILABLE);
chSysLockFromIsr();
+ chnAddFlagsI(sdup, CHN_INPUT_AVAILABLE);
/* Writes to the input queue can only happen when there is enough space
to hold at least one packet.*/
diff --git a/testhal/STM32F4xx/USB_CDC/main.c b/testhal/STM32F4xx/USB_CDC/main.c
index e36ce3dc9..0ae9c81e0 100644
--- a/testhal/STM32F4xx/USB_CDC/main.c
+++ b/testhal/STM32F4xx/USB_CDC/main.c
@@ -226,6 +226,11 @@ static const USBDescriptor *get_descriptor(USBDriver *usbp,
}
/**
+ * @brief IN EP1 state.
+ */
+static USBInEndpointState ep1instate;
+
+/**
* @brief EP1 initialization structure (IN only).
*/
static const USBEndpointConfig ep1config = {
@@ -235,12 +240,17 @@ static const USBEndpointConfig ep1config = {
NULL,
0x0040,
0x0000,
- NULL,
+ &ep1instate,
NULL,
NULL
};
/**
+ * @brief OUT EP1 state.
+ */
+USBOutEndpointState ep1outstate;
+
+/**
* @brief EP2 initialization structure (IN only).
*/
static const USBEndpointConfig ep2config = {
@@ -251,11 +261,16 @@ static const USBEndpointConfig ep2config = {
0x0010,
0x0000,
NULL,
- NULL,
+ &ep1outstate,
NULL
};
/**
+ * @brief OUT EP2 state.
+ */
+USBOutEndpointState ep2outstate;
+
+/**
* @brief EP3 initialization structure (OUT only).
*/
static const USBEndpointConfig ep3config = {
@@ -266,7 +281,7 @@ static const USBEndpointConfig ep3config = {
0x0000,
0x0040,
NULL,
- NULL,
+ &ep2outstate,
NULL
};