summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/m66591.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/drivers/m66591.c b/firmware/drivers/m66591.c
index 000e4582e1..d09b269f33 100644
--- a/firmware/drivers/m66591.c
+++ b/firmware/drivers/m66591.c
@@ -659,13 +659,13 @@ int usb_drv_request_endpoint(int type, int dir) {
659 } 659 }
660 } else if (type == USB_ENDPOINT_XFER_INT) { 660 } else if (type == USB_ENDPOINT_XFER_INT) {
661 ep=5; 661 ep=5;
662 662
663 pipecfg |= 1<<13; 663 pipecfg |= 1<<13;
664 664
665 while(M66591_eps[ep].busy && ep++<7); 665 while(M66591_eps[ep].busy && ++ep<USB_NUM_ENDPOINTS);
666 666
667 /* If this reached 7 the endpoints were all busy */ 667 /* If this reached USB_NUM_ENDPOINTS the endpoints were all busy */
668 if(ep==7) { 668 if(ep==USB_NUM_ENDPOINTS) {
669 logf("mxx: ep %d busy", ep); 669 logf("mxx: ep %d busy", ep);
670 return -1; 670 return -1;
671 } 671 }