usb: allow hardware to handle ZLP for Variable-length Data Stage
Allow hardware to handle ZLP for Variable-length Data Stage. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
parent
b98d8cdaa0
commit
51f550cd07
3 changed files with 9 additions and 0 deletions
|
@ -61,6 +61,7 @@ menuconfig USB_NRF52840
|
||||||
depends on SOC_NRF52840
|
depends on SOC_NRF52840
|
||||||
select USB_DEVICE_DRIVER
|
select USB_DEVICE_DRIVER
|
||||||
select NRFX_USBD
|
select NRFX_USBD
|
||||||
|
select USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
|
||||||
help
|
help
|
||||||
nRF52840 USB Device Controller Driver
|
nRF52840 USB Device Controller Driver
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,12 @@ config USB_DEVICE_REMOTE_WAKEUP
|
||||||
help
|
help
|
||||||
This option requires USBD peripheral driver to also support remote wakeup.
|
This option requires USBD peripheral driver to also support remote wakeup.
|
||||||
|
|
||||||
|
config USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Stack should not handle ZLP for Variable-length Data Stage
|
||||||
|
bacause it is taken over by the hardware.
|
||||||
|
|
||||||
config USB_DEVICE_BOS
|
config USB_DEVICE_BOS
|
||||||
bool "Enable USB Binary Device Object Store (BOS)"
|
bool "Enable USB Binary Device Object Store (BOS)"
|
||||||
|
|
||||||
|
|
|
@ -245,6 +245,7 @@ static void usb_data_to_host(u16_t len)
|
||||||
usb_dev.data_buf += chunk;
|
usb_dev.data_buf += chunk;
|
||||||
usb_dev.data_buf_residue -= chunk;
|
usb_dev.data_buf_residue -= chunk;
|
||||||
|
|
||||||
|
#ifndef CONFIG_USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
|
||||||
/*
|
/*
|
||||||
* Set ZLP flag when host asks for a bigger length and the
|
* Set ZLP flag when host asks for a bigger length and the
|
||||||
* last chunk is wMaxPacketSize long, to indicate the last
|
* last chunk is wMaxPacketSize long, to indicate the last
|
||||||
|
@ -259,6 +260,7 @@ static void usb_data_to_host(u16_t len)
|
||||||
usb_dev.zlp_flag = true;
|
usb_dev.zlp_flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
usb_dev.zlp_flag = false;
|
usb_dev.zlp_flag = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue