usb: short control IN might need a ZLP
Control transfers can transfer less than was requested by the host in the wLength field. if this short transfer is a multiple of the endpoint's packet size, a zero length packet must be sent. Adds tests for a range of control transfer IN requests, and properly supports this in the core. Based heavily on work by Kuldeep Dhaka. See https://github.com/libopencm3/libopencm3/pull/505 and https://github.com/libopencm3/libopencm3/pull/194 for original discussion. Tested with stm32f4, stm32f103 and stm32l053.
This commit is contained in:
@@ -74,6 +74,7 @@ struct _usbd_device {
|
||||
uint8_t *ctrl_buf;
|
||||
uint16_t ctrl_len;
|
||||
usbd_control_complete_callback complete;
|
||||
bool needs_zlp;
|
||||
} control_state;
|
||||
|
||||
struct user_control_callback {
|
||||
|
||||
Reference in New Issue
Block a user