X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fao_usb.c;h=b4e3f1fe6aa3364bd7925458d6e58af28f4922e8;hp=f6e0fcf91b54e83e643b46eeec599f5dacce06db;hb=c7ba92317ac55272acbde12416448ebd17b983a6;hpb=05111d5be4d37bedaaee6415d6ee27347e6a112c diff --git a/src/ao_usb.c b/src/ao_usb.c index f6e0fcf9..b4e3f1fe 100644 --- a/src/ao_usb.c +++ b/src/ao_usb.c @@ -43,7 +43,7 @@ ao_usb_set_interrupts(void) * so when we hook that up, fix this */ void -ao_usb_isr(void) interrupt 6 +ao_usb_isr(void) __interrupt 6 { USBIF = 0; ao_usb_iif |= USBIIF; @@ -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];