aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-12-25 08:59:10 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-12-25 08:59:10 +0000
commit4b601a5d0fd06f8e238c17fb96633100ecc59503 (patch)
tree0ed28cfc2e87f0a346850c49a9343df30604f218 /os/hal/src
parent6a20a7107a016a4cb43c3f98362b447f883db8c8 (diff)
downloadChibiOS-4b601a5d0fd06f8e238c17fb96633100ecc59503.tar.gz
ChibiOS-4b601a5d0fd06f8e238c17fb96633100ecc59503.tar.bz2
ChibiOS-4b601a5d0fd06f8e238c17fb96633100ecc59503.zip
USB upgrade.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8641 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/usb.c69
1 files changed, 6 insertions, 63 deletions
diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c
index c4f612d0f..cea90b32e 100644
--- a/os/hal/src/usb.c
+++ b/os/hal/src/usb.c
@@ -401,10 +401,9 @@ void usbDisableEndpointsI(USBDriver *usbp) {
void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) {
USBOutEndpointState *osp = usbp->epc[ep]->out_state;
- osp->rxqueued = false;
- osp->mode.linear.rxbuf = buf;
- osp->rxsize = n;
- osp->rxcnt = 0;
+ osp->rxbuf = buf;
+ osp->rxsize = n;
+ osp->rxcnt = 0;
usb_lld_prepare_receive(usbp, ep);
}
@@ -427,65 +426,9 @@ void usbPrepareTransmit(USBDriver *usbp, usbep_t ep,
const uint8_t *buf, size_t n) {
USBInEndpointState *isp = usbp->epc[ep]->in_state;
- isp->txqueued = false;
- isp->mode.linear.txbuf = buf;
- isp->txsize = n;
- isp->txcnt = 0;
-
- usb_lld_prepare_transmit(usbp, ep);
-}
-
-/**
- * @brief Prepares for a receive transaction on an OUT endpoint.
- * @post The endpoint is ready for @p usbStartReceiveI().
- * @note This function can be called both in ISR and thread context.
- * @note The queue must have enough free space to accommodate the
- * specified transaction size rounded to the next packet size
- * boundary. For example if the transaction size is 1 and the
- * packet size is 64 then the queue must have space for at least
- * 64 bytes.
- *
- * @param[in] usbp pointer to the @p USBDriver object
- * @param[in] ep endpoint number
- * @param[in] iqp input queue to be filled with incoming data
- * @param[in] n transaction size
- *
- * @special
- */
-void usbPrepareQueuedReceive(USBDriver *usbp, usbep_t ep,
- input_queue_t *iqp, size_t n) {
- USBOutEndpointState *osp = usbp->epc[ep]->out_state;
-
- osp->rxqueued = true;
- osp->mode.queue.rxqueue = iqp;
- osp->rxsize = n;
- osp->rxcnt = 0;
-
- usb_lld_prepare_receive(usbp, ep);
-}
-
-/**
- * @brief Prepares for a transmit transaction on an IN endpoint.
- * @post The endpoint is ready for @p usbStartTransmitI().
- * @note This function can be called both in ISR and thread context.
- * @note The transmit transaction size is equal to the data contained
- * in the queue.
- *
- * @param[in] usbp pointer to the @p USBDriver object
- * @param[in] ep endpoint number
- * @param[in] oqp output queue to be fetched for outgoing data
- * @param[in] n transaction size
- *
- * @special
- */
-void usbPrepareQueuedTransmit(USBDriver *usbp, usbep_t ep,
- output_queue_t *oqp, size_t n) {
- USBInEndpointState *isp = usbp->epc[ep]->in_state;
-
- isp->txqueued = true;
- isp->mode.queue.txqueue = oqp;
- isp->txsize = n;
- isp->txcnt = 0;
+ isp->txbuf = buf;
+ isp->txsize = n;
+ isp->txcnt = 0;
usb_lld_prepare_transmit(usbp, ep);
}