summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-08-30 04:52:00 -0700
committerKeith Packard <keithp@keithp.com>2010-08-30 04:52:00 -0700
commitc7ba92317ac55272acbde12416448ebd17b983a6 (patch)
tree38fec34856ddacd28862b935a180d54a733d2f35 /src
parent20a472cfe3369200150ea4ff067ceb28968dbcac (diff)
altos: Windows sends USB Out packets of 0 length. Ack them.
This was an untested case as no other operating system sents 0-length out packets (they're not necessary). The correct response is to ACK them by clearing the OUTPKT_RDY bit so that another packet can be sent. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/ao_usb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ao_usb.c b/src/ao_usb.c
index b55130f2..b4e3f1fe 100644
--- a/src/ao_usb.c
+++ b/src/ao_usb.c
@@ -383,8 +383,11 @@ ao_usb_pollchar(void) __critical
if ((USBCSOL & USBCSOL_OUTPKT_RDY) == 0)
return AO_READ_AGAIN;
ao_usb_out_bytes = (USBCNTH << 8) | USBCNTL;
- if (ao_usb_out_bytes == 0)
+ if (ao_usb_out_bytes == 0) {
+ USBINDEX = AO_USB_OUT_EP;
+ USBCSOL &= ~USBCSOL_OUTPKT_RDY;
return AO_READ_AGAIN;
+ }
}
--ao_usb_out_bytes;
c = USBFIFO[AO_USB_OUT_EP << 1];