aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-12-26 16:54:26 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-12-26 16:54:26 +0000
commite74213d5c3646e173d323c8d0f6033c6ea4ed57a (patch)
treeff0ca057220160f6cfa03e84cfeb2cf1430a696e /os/hal/ports/STM32
parenteb0c1ac0c3a3544366b7be5014a23d96ec4e9c9e (diff)
downloadChibiOS-e74213d5c3646e173d323c8d0f6033c6ea4ed57a.tar.gz
ChibiOS-e74213d5c3646e173d323c8d0f6033c6ea4ed57a.tar.bz2
ChibiOS-e74213d5c3646e173d323c8d0f6033c6ea4ed57a.zip
Synchronous USB API ready for testing, OTGv1 only so far.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8649 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/usb_lld.c4
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/usb_lld.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
index ab735b903..00ada1203 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
+++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c
@@ -1005,7 +1005,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) {
/* OUT endpoint activation or deactivation.*/
otgp->oe[ep].DOEPTSIZ = 0;
- if (usbp->epc[ep]->out_maxsize != 0) {
+ if (usbp->epc[ep]->out_state != NULL) {
otgp->oe[ep].DOEPCTL = ctl | DOEPCTL_MPSIZ(usbp->epc[ep]->out_maxsize);
otgp->DAINTMSK |= DAINTMSK_OEPM(ep);
}
@@ -1016,7 +1016,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) {
/* IN endpoint activation or deactivation.*/
otgp->ie[ep].DIEPTSIZ = 0;
- if (usbp->epc[ep]->in_maxsize != 0) {
+ if (usbp->epc[ep]->in_state != NULL) {
/* FIFO allocation for the IN endpoint.*/
fsize = usbp->epc[ep]->in_maxsize / 4;
if (usbp->epc[ep]->in_multiplier > 1)
diff --git a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h
index f59685c43..c90424c36 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h
+++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h
@@ -314,12 +314,14 @@ typedef struct {
uint16_t out_maxsize;
/**
* @brief @p USBEndpointState associated to the IN endpoint.
- * @details This structure maintains the state of the IN endpoint.
+ * @details This structure maintains the state of the IN endpoint,
+ * set to @p NULL if the IN endpoint is not used.
*/
USBInEndpointState *in_state;
/**
* @brief @p USBEndpointState associated to the OUT endpoint.
- * @details This structure maintains the state of the OUT endpoint.
+ * @details This structure maintains the state of the OUT endpoint,
+ * set to @p NULL if the OUT endpoint is not used.
*/
USBOutEndpointState *out_state;
/* End of the mandatory fields.*/