diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-26 13:29:09 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-26 13:29:09 +0000 |
commit | eb0c1ac0c3a3544366b7be5014a23d96ec4e9c9e (patch) | |
tree | bab95b57ba0de647a19fdd35d920922d6db3160a /os/hal/ports | |
parent | ae70b0edcea8b466894e140839371fb122a4aa92 (diff) | |
download | ChibiOS-eb0c1ac0c3a3544366b7be5014a23d96ec4e9c9e.tar.gz ChibiOS-eb0c1ac0c3a3544366b7be5014a23d96ec4e9c9e.tar.bz2 ChibiOS-eb0c1ac0c3a3544366b7be5014a23d96ec4e9c9e.zip |
USB synchronous API, to be completed.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8648 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports')
-rw-r--r-- | os/hal/ports/STM32/LLD/OTGv1/usb_lld.c | 8 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/OTGv1/usb_lld.h | 20 |
2 files changed, 20 insertions, 8 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c index 4ec8fd976..ab735b903 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c +++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c @@ -422,9 +422,9 @@ static void otg_epout_handler(USBDriver *usbp, usbep_t ep) { osp->rxsize = osp->totsize - osp->rxsize;
osp->rxcnt = 0;
usb_lld_prepare_receive(usbp, ep);
- chSysLockFromISR();
+ osalSysLockFromISR();
usb_lld_start_out(usbp, ep);
- chSysUnlockFromISR();
+ osalSysUnlockFromISR();
}
else {
/* End on OUT transfer.*/
@@ -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_cb != NULL) {
+ if (usbp->epc[ep]->out_maxsize != 0) {
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_cb != NULL) {
+ if (usbp->epc[ep]->in_maxsize != 0) {
/* 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 544d5aecd..f59685c43 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h +++ b/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h @@ -226,6 +226,12 @@ typedef struct { * @brief Pointer to the transmission linear buffer.
*/
const uint8_t *txbuf;
+#if (USB_USE_WAIT == TRUE) || defined(__DOXYGEN__)
+ /**
+ * @brief Waiting thread.
+ */
+ thread_reference_t thread;
+#endif
/* End of the mandatory fields.*/
/**
* @brief Total transmit transfer size.
@@ -249,6 +255,12 @@ typedef struct { * @brief Pointer to the receive linear buffer.
*/
uint8_t *rxbuf;
+#if (USB_USE_WAIT == TRUE) || defined(__DOXYGEN__)
+ /**
+ * @brief Waiting thread.
+ */
+ thread_reference_t thread;
+#endif
/* End of the mandatory fields.*/
/**
* @brief Total transmit transfer size.
@@ -278,14 +290,14 @@ typedef struct { usbepcallback_t setup_cb;
/**
* @brief IN endpoint notification callback.
- * @details This field must be set to @p NULL if the IN endpoint is not
- * used.
+ * @details This field must can be set to @p NULL if callback is not
+ * required.
*/
usbepcallback_t in_cb;
/**
* @brief OUT endpoint notification callback.
- * @details This field must be set to @p NULL if the OUT endpoint is not
- * used.
+ * @details This field must can be set to @p NULL if callback is not
+ * required.
*/
usbepcallback_t out_cb;
/**
|