aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/include/usb.h3
-rw-r--r--os/hal/platforms/Rx62n/usb_lld.c1
-rw-r--r--os/hal/platforms/Rx62n/usb_lld.h2
-rw-r--r--os/hal/platforms/STM32/OTGv1/usb_lld.h5
-rw-r--r--os/hal/platforms/STM32/USBv1/usb_lld.h5
-rw-r--r--os/hal/src/usb.c11
6 files changed, 16 insertions, 11 deletions
diff --git a/os/hal/include/usb.h b/os/hal/include/usb.h
index 9cfc0fb00..3d34708eb 100644
--- a/os/hal/include/usb.h
+++ b/os/hal/include/usb.h
@@ -451,9 +451,6 @@ typedef const USBDescriptor * (*usbgetdescriptor_t)(USBDriver *usbp,
(usbp)->ep0endcb = (endcb); \
}
-#define usbSetupEnd(usbp, ep) \
- usb_lld_end_transaction(usbp, ep)
-
/**
* @brief Reads a setup packet from the dedicated packet buffer.
* @details This function must be invoked in the context of the @p setup_cb
diff --git a/os/hal/platforms/Rx62n/usb_lld.c b/os/hal/platforms/Rx62n/usb_lld.c
index f5b7a965f..d80e2e766 100644
--- a/os/hal/platforms/Rx62n/usb_lld.c
+++ b/os/hal/platforms/Rx62n/usb_lld.c
@@ -25,7 +25,6 @@
#include "ch.h"
#include "hal.h"
-
#if HAL_USE_USB || defined(__DOXYGEN__)
/*===========================================================================*/
diff --git a/os/hal/platforms/Rx62n/usb_lld.h b/os/hal/platforms/Rx62n/usb_lld.h
index 5482fab50..20f0e130c 100644
--- a/os/hal/platforms/Rx62n/usb_lld.h
+++ b/os/hal/platforms/Rx62n/usb_lld.h
@@ -457,7 +457,7 @@ struct USBDriver {
*
* @notapi
*/
-#define usb_lld_end_transaction(usbp, ep) \
+#define usb_lld_end_setup(usbp, ep) \
((usbp)->usb->DCPCTR.BIT.CCPL=1)
/**
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.h b/os/hal/platforms/STM32/OTGv1/usb_lld.h
index 570309750..5be12e66e 100644
--- a/os/hal/platforms/STM32/OTGv1/usb_lld.h
+++ b/os/hal/platforms/STM32/OTGv1/usb_lld.h
@@ -43,6 +43,11 @@
#endif
/**
+ * @brief Status stage handling method.
+ */
+#define USB_EP0_STATUS_STAGE USB_EP0_STATUS_STAGE_SW
+
+/**
* @brief The address can be changed immediately upon packet reception.
*/
#define USB_SET_ADDRESS_MODE USB_EARLY_SET_ADDRESS
diff --git a/os/hal/platforms/STM32/USBv1/usb_lld.h b/os/hal/platforms/STM32/USBv1/usb_lld.h
index a0092a334..74618900f 100644
--- a/os/hal/platforms/STM32/USBv1/usb_lld.h
+++ b/os/hal/platforms/STM32/USBv1/usb_lld.h
@@ -39,6 +39,11 @@
#define USB_MAX_ENDPOINTS USB_ENDOPOINTS_NUMBER
/**
+ * @brief Status stage handling method.
+ */
+#define USB_EP0_STATUS_STAGE USB_EP0_STATUS_STAGE_SW
+
+/**
* @brief This device requires the address change after the status packet.
*/
#define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS
diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c
index 55ae89d84..b0a6390e7 100644
--- a/os/hal/src/usb.c
+++ b/os/hal/src/usb.c
@@ -628,8 +628,7 @@ void _usb_ep0setup(USBDriver *usbp, usbep_t ep) {
}
}
#if (USB_SET_ADDRESS_ACK_HANDLING == USB_SET_ADDRESS_ACK_HW)
- if (usbp->setup[1] == USB_REQ_SET_ADDRESS)
- {
+ if (usbp->setup[1] == USB_REQ_SET_ADDRESS) {
/* Zero-length packet sent by hardware */
return;
}
@@ -661,7 +660,7 @@ void _usb_ep0setup(USBDriver *usbp, usbep_t ep) {
usbStartReceiveI(usbp, 0);
chSysUnlockFromIsr();
#else
- usbSetupEnd(usbp, ep);
+ usb_lld_end_setup(usbp, ep);
#endif
}
}
@@ -685,7 +684,7 @@ void _usb_ep0setup(USBDriver *usbp, usbep_t ep) {
usbStartTransmitI(usbp, 0);
chSysUnlockFromIsr();
#else
- usbSetupEnd(usbp, ep);
+ usb_lld_end_setup(usbp, ep);
#endif
}
}
@@ -729,7 +728,7 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) {
usbStartReceiveI(usbp, 0);
chSysUnlockFromIsr();
#else
- usbSetupEnd(usbp, ep);
+ usb_lld_end_setup(usbp, ep);
#endif
return;
case USB_EP0_SENDING_STS:
@@ -773,7 +772,7 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) {
usbStartTransmitI(usbp, 0);
chSysUnlockFromIsr();
#else
- usbSetupEnd(usbp, ep);
+ usb_lld_end_setup(usbp, ep);
#endif
return;
case USB_EP0_WAITING_STS: