aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/usb.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-03 09:18:38 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-03 09:18:38 +0000
commit2e56d8e14eb9ffbcc533e5cb2484a6448ccb439a (patch)
tree320d1aa612741a7f0090ed083d2714ac58ccb057 /os/hal/src/usb.c
parentb8d35693b4c7b88a746abb646dde8a7e09cf7bd4 (diff)
downloadChibiOS-2e56d8e14eb9ffbcc533e5cb2484a6448ccb439a.tar.gz
ChibiOS-2e56d8e14eb9ffbcc533e5cb2484a6448ccb439a.tar.bz2
ChibiOS-2e56d8e14eb9ffbcc533e5cb2484a6448ccb439a.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4258 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/usb.c')
-rw-r--r--os/hal/src/usb.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/os/hal/src/usb.c b/os/hal/src/usb.c
index cbd009483..1927581f1 100644
--- a/os/hal/src/usb.c
+++ b/os/hal/src/usb.c
@@ -571,20 +571,20 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) {
switch (usbp->ep0state) {
case USB_EP0_TX:
max = usb_lld_fetch_word(&usbp->setup[6]);
- /* 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)) {
- usb_lld_prepare_transmit(usbp, 0, NULL, 0);
- usb_lld_start_in(usbp, 0);
- return;
- }
-
- /* Transmit phase over, receiving the zero sized status packet.*/
- usbp->ep0state = USB_EP0_WAITING_STS;
- usb_lld_prepare_receive(usbp, 0, NULL, 0);
- usb_lld_start_out(usbp, 0);
+ /* 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)) {
+ usb_lld_prepare_transmit(usbp, 0, NULL, 0);
+ usb_lld_start_in(usbp, 0);
+ return;
+ }
+
+ /* Transmit phase over, receiving the zero sized status packet.*/
+ usbp->ep0state = USB_EP0_WAITING_STS;
+ usb_lld_prepare_receive(usbp, 0, NULL, 0);
+ usb_lld_start_out(usbp, 0);
return;
case USB_EP0_SENDING_STS:
/* Status packet sent, invoking the callback if defined.*/