Quellcode durchsuchen

Clear error code after intentionally ignoring it

In the case of handling a stall on a max lun request, we need to clear the error code in `ret` after ignoring it. This is necessary so the connect function won't fail.

Fix #339
Derek Konigsberg vor 7 Monaten
Ursprung
Commit
7c38af1b04
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      class/msc/usbh_msc.c

+ 1 - 0
class/msc/usbh_msc.c

@@ -284,6 +284,7 @@ static int usbh_msc_connect(struct usbh_hubport *hport, uint8_t intf)
         if (ret == -USB_ERR_STALL) {
             USB_LOG_WRN("Device does not support multiple LUNs\r\n");
             g_msc_buf[msc_class->sdchar - 'a'][0] = 0;
+            ret = 0;
         } else {
             return ret;
         }