diff --git a/src/usb/pipes.c b/src/usb/pipes.c index 5ccf8a8..433acd7 100644 --- a/src/usb/pipes.c +++ b/src/usb/pipes.c @@ -15,7 +15,6 @@ // Operations on pipes //--- -/* usb_pipe_configure(): Configure a pipe when opening the connection */ void usb_pipe_configure(int address, endpoint_t const *ep) { /* Maps USB 2.0 transfer types to SH7305 USB module transfer types */ @@ -57,7 +56,6 @@ void usb_pipe_configure(int address, endpoint_t const *ep) } } -/* usb_pipe_clear(): Clear all data in the pipe */ void usb_pipe_clear(int pipe) { if(pipe <= 0 || pipe > 9) return; diff --git a/src/usb/setup.c b/src/usb/setup.c index 36d4c50..7197a1f 100644 --- a/src/usb/setup.c +++ b/src/usb/setup.c @@ -106,7 +106,7 @@ static void write_configuration_descriptor(int wLength) if(dc[1] == USB_DC_INTERFACE) { usb_dc_interface_t idc = *(usb_dc_interface_t *)dc; - idc.bInterfaceNumber = k; + idc.bInterfaceNumber = i; dcp_write(&idc, idc.bLength); } /* Edit endpoint numbers on-the-fly */ diff --git a/src/usb/usb.c b/src/usb/usb.c index cebee5b..8e25a10 100644 --- a/src/usb/usb.c +++ b/src/usb/usb.c @@ -141,8 +141,8 @@ int usb_open(usb_interface_t const **interfaces, gint_call_t callback) USB.REG_C2 = 0x0020; - /* Disconnect (DPRPU=0) if we were previously connected as a function. Also - drive down DRPR, since both are required for setting DCFM. */ + /* Disconnect (DPRPU=0) if we were previously connected as a function. + Also drive down DRPD, since both are required for setting DCFM. */ USB.SYSCFG.DPRPU = 0; USB.SYSCFG.DRPD = 0; @@ -151,7 +151,7 @@ int usb_open(usb_interface_t const **interfaces, gint_call_t callback) USB.SYSCFG.DCFM = 1; /* Clear registers to prepare for host operation */ USB.SYSCFG.USBE = 0; - /* Do not require high-speed operation; also accept full-speed */ + /* Accept both high-speed and full-speed devices */ USB.SYSCFG.HSE = 0; /* Pull DPRD and eliminate chattering */