aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/usb.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-15 09:16:17 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-02-15 09:16:17 +0000
commit35ff7323526f5225d1a00c7812291e9fcdbfafac (patch)
treed2fd2eb98544de7e6e2eafae015e8afe33c721b6 /os/hal/src/usb.c
parent20a4b38126be234c5f946df9254c7d64502ff855 (diff)
downloadChibiOS-35ff7323526f5225d1a00c7812291e9fcdbfafac.tar.gz
ChibiOS-35ff7323526f5225d1a00c7812291e9fcdbfafac.tar.bz2
ChibiOS-35ff7323526f5225d1a00c7812291e9fcdbfafac.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2740 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/usb.c')
-rw-r--r--os/hal/src/usb.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c
index 34e9a14fd..0dbe4b39d 100644
--- a/os/hal/src/usb.c
+++ b/os/hal/src/usb.c
@@ -335,6 +335,8 @@ void usbDisableEndpointsI(USBDriver *usbp) {
chDbgAssert(usbp->state == USB_SELECTED,
"usbDisableEndpointsI(), #1", "invalid state");
+ usbp->transmitting &= ~1;
+ usbp->receiving &= ~1;
for (i = 1; i <= USB_MAX_ENDPOINTS; i++)
usbp->epc[i] = NULL;
@@ -399,7 +401,7 @@ size_t usbWritePacketI(USBDriver *usbp, usbep_t ep,
}
/**
- * @brief Starts a receive operation on an OUT endpoint.
+ * @brief Starts a receive transaction on an OUT endpoint.
* @pre In order to use this function he endpoint must have been
* initialized in transaction mode.
* @post The endpoint callback is invoked when the transfer has been
@@ -410,8 +412,8 @@ size_t usbWritePacketI(USBDriver *usbp, usbep_t ep,
* @param[out] buf buffer where to copy the received data
* @param[in] n maximum number of bytes to copy
* @return The operation status.
- * @retval FALSE Operation complete.
- * @retval TRUE Endpoint busy receiving.
+ * @retval FALSE Operation started successfully.
+ * @retval TRUE Endpoint busy, operation not started.
*
* @iclass
*/
@@ -427,7 +429,7 @@ bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep,
}
/**
- * @brief Starts a transmit operation on an IN endpoint.
+ * @brief Starts a transmit transaction on an IN endpoint.
* @pre In order to use this function he endpoint must have been
* initialized in transaction mode.
* @post The endpoint callback is invoked when the transfer has been
@@ -438,8 +440,8 @@ bool_t usbStartReceiveI(USBDriver *usbp, usbep_t ep,
* @param[in] buf buffer where to fetch the data to be transmitted
* @param[in] n maximum number of bytes to copy
* @return The operation status.
- * @retval FALSE Operation complete.
- * @retval TRUE Endpoint busy transmitting.
+ * @retval FALSE Operation started successfully.
+ * @retval TRUE Endpoint busy, operation not started.
*
* @iclass
*/
@@ -461,7 +463,7 @@ bool_t usbStartTransmitI(USBDriver *usbp, usbep_t ep,
* @param[in] ep endpoint number
* @return The operation status.
* @retval FALSE Endpoint stalled.
- * @retval TRUE The endpoint was within a transaction, not stalled.
+ * @retval TRUE Endpoint busy, not stalled.
*
* @iclass
*/
@@ -481,7 +483,7 @@ bool_t usbStallReceiveI(USBDriver *usbp, usbep_t ep) {
* @param[in] ep endpoint number
* @return The operation status.
* @retval FALSE Endpoint stalled.
- * @retval TRUE The endpoint was within a transaction, not stalled.
+ * @retval TRUE Endpoint busy, not stalled.
*
* @iclass
*/
@@ -510,6 +512,8 @@ void _usb_reset(USBDriver *usbp) {
usbp->status = 0;
usbp->address = 0;
usbp->configuration = 0;
+ usbp->transmitting = 0;
+ usbp->receiving = 0;
/* Invalidates all endpoints into the USBDriver structure.*/
for (i = 0; i <= USB_MAX_ENDPOINTS; i++)