usb: replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS
Replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
parent
5b74fb4f23
commit
c13e201b18
8 changed files with 10 additions and 10 deletions
|
@ -747,8 +747,8 @@ int usb_dc_ep_write(const u8_t ep, const u8_t *const data,
|
|||
irq_disable(DT_USB_IRQ);
|
||||
}
|
||||
|
||||
if (ep == EP0_IN && len > MAX_PACKET_SIZE0) {
|
||||
len = MAX_PACKET_SIZE0;
|
||||
if (ep == EP0_IN && len > USB_MAX_CTRL_MPS) {
|
||||
len = USB_MAX_CTRL_MPS;
|
||||
}
|
||||
|
||||
status = HAL_PCD_EP_Transmit(&usb_dc_stm32_state.pcd, ep,
|
||||
|
|
|
@ -72,7 +72,7 @@ extern "C" {
|
|||
* USB configuration
|
||||
**************************************************************************/
|
||||
|
||||
#define MAX_PACKET_SIZE0 64 /**< maximum packet size for EP 0 */
|
||||
#define USB_MAX_CTRL_MPS 64 /**< maximum packet size (MPS) for EP 0 */
|
||||
|
||||
/*************************************************************************
|
||||
* USB application interface
|
||||
|
|
|
@ -64,7 +64,7 @@ static const struct dev_common_descriptor {
|
|||
.bDeviceClass = CUSTOM_CLASS,
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = MAX_PACKET_SIZE0,
|
||||
.bMaxPacketSize0 = USB_MAX_CTRL_MPS,
|
||||
.idVendor = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_VID),
|
||||
.idProduct = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_PID),
|
||||
.bcdDevice = sys_cpu_to_le16(BCDDEVICE_RELNUM),
|
||||
|
|
|
@ -109,7 +109,7 @@ static struct dev_common_descriptor webusb_serial_usb_description = {
|
|||
.bDeviceClass = 0,
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = MAX_PACKET_SIZE0,
|
||||
.bMaxPacketSize0 = USB_MAX_CTRL_MPS,
|
||||
.idVendor = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_VID),
|
||||
.idProduct = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_PID),
|
||||
.bcdDevice = sys_cpu_to_le16(BCDDEVICE_RELNUM),
|
||||
|
|
|
@ -143,7 +143,7 @@ struct dev_dfu_mode_descriptor dfu_mode_desc = {
|
|||
.bDeviceClass = 0,
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = MAX_PACKET_SIZE0,
|
||||
.bMaxPacketSize0 = USB_MAX_CTRL_MPS,
|
||||
.idVendor = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_VID),
|
||||
.idProduct = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_PID),
|
||||
.bcdDevice = sys_cpu_to_le16(BCDDEVICE_RELNUM),
|
||||
|
|
|
@ -69,7 +69,7 @@ USBD_DEVICE_DESCR_DEFINE(primary) struct common_descriptor common_desc = {
|
|||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
#endif
|
||||
.bMaxPacketSize0 = MAX_PACKET_SIZE0,
|
||||
.bMaxPacketSize0 = USB_MAX_CTRL_MPS,
|
||||
.idVendor = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_VID),
|
||||
.idProduct = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_PID),
|
||||
.bcdDevice = sys_cpu_to_le16(BCDDEVICE_RELNUM),
|
||||
|
|
|
@ -1059,7 +1059,7 @@ int usb_enable(struct usb_cfg_data *config)
|
|||
return ret;
|
||||
|
||||
/* Configure control EP */
|
||||
ep0_cfg.ep_mps = MAX_PACKET_SIZE0;
|
||||
ep0_cfg.ep_mps = USB_MAX_CTRL_MPS;
|
||||
ep0_cfg.ep_type = USB_DC_EP_CONTROL;
|
||||
|
||||
ep0_cfg.ep_addr = USB_CONTROL_OUT_EP0;
|
||||
|
@ -1587,7 +1587,7 @@ static int usb_composite_init(struct device *dev)
|
|||
}
|
||||
|
||||
/* Configure control EP */
|
||||
ep0_cfg.ep_mps = MAX_PACKET_SIZE0;
|
||||
ep0_cfg.ep_mps = USB_MAX_CTRL_MPS;
|
||||
ep0_cfg.ep_type = USB_DC_EP_CONTROL;
|
||||
|
||||
ep0_cfg.ep_addr = USB_CONTROL_OUT_EP0;
|
||||
|
|
|
@ -36,7 +36,7 @@ static const struct dev_common_descriptor {
|
|||
.bDeviceClass = CUSTOM_CLASS,
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = MAX_PACKET_SIZE0,
|
||||
.bMaxPacketSize0 = USB_MAX_CTRL_MPS,
|
||||
.idVendor = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_VID),
|
||||
.idProduct = sys_cpu_to_le16((u16_t)CONFIG_USB_DEVICE_PID),
|
||||
.bcdDevice = sys_cpu_to_le16(BCDDEVICE_RELNUM),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue