aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-28 13:27:37 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-28 13:27:37 +0000
commit30a552991b81cef1eb5eae1aa3937b960b6e0f08 (patch)
treed5e7e0996484eeec92dd88b96540e820a58baeda /os/hal/src
parent53ebb098cb632593656bba3a28730ca2bb3de1ce (diff)
downloadChibiOS-30a552991b81cef1eb5eae1aa3937b960b6e0f08.tar.gz
ChibiOS-30a552991b81cef1eb5eae1aa3937b960b6e0f08.tar.bz2
ChibiOS-30a552991b81cef1eb5eae1aa3937b960b6e0f08.zip
Fixed bug #406.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5638 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/usb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c
index 9c3825910..745b2d436 100644
--- a/os/hal/src/usb.c
+++ b/os/hal/src/usb.c
@@ -693,15 +693,16 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) {
/* If the transmitted size is less than the requested size and it is a
multiple of the maximum packet size then a zero size packet must be
transmitted.*/
- if ((usbp->ep0n < max) &&
- ((usbp->ep0n % usbp->epc[0]->in_maxsize) == 0)) {
+ if ((usbp->ep0n < max) && ((usbp->ep0n % usbp->epc[0]->in_maxsize) == 0)) {
usbPrepareTransmit(usbp, 0, NULL, 0);
chSysLockFromIsr();
usbStartTransmitI(usbp, 0);
chSysUnlockFromIsr();
+ usbp->ep0state = USB_EP0_WAITING_TX0;
return;
}
-
+ /* Falls into, it is intentional.*/
+ case USB_EP0_WAITING_TX0:
/* Transmit phase over, receiving the zero sized status packet.*/
usbp->ep0state = USB_EP0_WAITING_STS;
usbPrepareReceive(usbp, 0, NULL, 0);