libopencm3/libopencm3 — pull request #194 by nagasakihacky (2013-08-18 23:30:31+00:00)
Title: Fix handling of control transfers where size is a multiple of bMaxPacket...

...Size0

End of transfer is indicated by a "short" packet where packet size is less than MaxPacketSize. If the transfer has a length that is a multiple of MaxPacketSize, a zero length packet must be sent to indicate the end of the transfer.

By calling the "normal transmission" section rather than the "end of transmission" section for the last packet of data, the state is not prematurely set to LAST_DATA_IN, so usb_control_send_chunk() gets called again and sends a ZLP