diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-07 10:37:45 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-07 10:37:45 +0000 |
commit | 44a66d45cedb33599ddb226baf14cfe5372ae8d1 (patch) | |
tree | d54087160bb90010e6e32ee15b836753ef8f6ef2 /os/hal/platforms/STM32/OTGv1 | |
parent | ca05d68dabf77e308edbb7abbf43b1226fd3432d (diff) | |
download | ChibiOS-44a66d45cedb33599ddb226baf14cfe5372ae8d1.tar.gz ChibiOS-44a66d45cedb33599ddb226baf14cfe5372ae8d1.tar.bz2 ChibiOS-44a66d45cedb33599ddb226baf14cfe5372ae8d1.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4079 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/OTGv1')
-rw-r--r-- | os/hal/platforms/STM32/OTGv1/usb_lld.c | 11 | ||||
-rw-r--r-- | os/hal/platforms/STM32/OTGv1/usb_lld.h | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c index b79d17f1c..be2bccee9 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.c +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c @@ -236,12 +236,7 @@ static void otg_rxfifo_handler(USBDriver *usbp) { case GRXSTSP_SETUP_DATA:
cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF;
ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF;
- if (ep == 0)
- otg_fifo_read(usbp->setup, cnt, 8);
- else
- otg_fifo_read(usbp->epc[ep]->out_state->rxbuf, cnt,
- usbp->epc[ep]->out_state->rxsize);
- usbp->epc[ep]->out_state->rxcnt = cnt;
+ otg_fifo_read(usbp->epc[ep]->setup_buf, cnt, 8);
break;
case GRXSTSP_OUT_DATA:
cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF;
@@ -270,6 +265,7 @@ static void otg_rxfifo_handler(USBDriver *usbp) { static void otg_txfifo_handler(USBDriver *usbp, usbep_t ep) {
uint32_t n;
+#if 0
if ((usbp->transmitting & (1 << ep))== 0) {
/* Nothing to transmit.*/
/* ????????????????????? */
@@ -289,6 +285,8 @@ static void otg_txfifo_handler(USBDriver *usbp, usbep_t ep) { OTG->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(pcnt) |
DIEPTSIZ_XFRSIZ(usbp->epc[ep]->in_state->txsize);
}
+#endif
+
n = usbp->epc[ep]->in_state->txsize - usbp->epc[ep]->in_state->txcnt;
if (n > usbp->epc[ep]->in_maxsize)
n = usbp->epc[ep]->in_maxsize;
@@ -298,7 +296,6 @@ static void otg_txfifo_handler(USBDriver *usbp, usbep_t ep) { usbp->epc[ep]->in_state->txcnt += n;
if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) {
/* Transfer finished.*/
- /* ????????????????????? */
OTG->DIEPEMPMSK &= ~DIEPEMPMSK_INEPTXFEM(ep);
}
}
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.h b/os/hal/platforms/STM32/OTGv1/usb_lld.h index 4ef236ea0..752adbfcd 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.h +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.h @@ -206,6 +206,12 @@ typedef struct { */
USBOutEndpointState *out_state;
/* End of the mandatory fields.*/
+ /**
+ * @brief Pointer to a buffer for setup packets.
+ * @details Setup packets require a dedicated 8-bytes buffer, set this
+ * field to @p NULL for non-control endpoints.
+ */
+ uint8_t *setup_buf;
} USBEndpointConfig;
/**
|