Fix USB mass storage error responses on windows with no SD card inserted v6.4.2
authorMichael McMaster <michael@codesrc.com>
Mon, 3 May 2021 10:46:23 +0000 (20:46 +1000)
committerMichael McMaster <michael@codesrc.com>
Mon, 3 May 2021 10:46:23 +0000 (20:46 +1000)
src/firmware/usb_device/usbd_msc_bot.c

index 85164a8589266c51d27a82149b492e71ec09060c..6283787352be4964a937644336ca9e4edaab7d84 100755 (executable)
@@ -251,14 +251,14 @@ static void  MSC_BOT_CBW_Decode (USBD_HandleTypeDef  *pdev)
        {
                if(SCSI_ProcessCmd(pdev, hmsc->cbw.bLUN, &hmsc->cbw.CB[0]) < 0)
                {
-               //      if(hmsc->bot_state == USBD_BOT_NO_DATA)
-               //      {
+                       if(hmsc->bot_state == USBD_BOT_NO_DATA)
+                       {
                                MSC_BOT_SendCSW (pdev, USBD_CSW_CMD_FAILED);
-               //      }
-               //      else
-               //      {
-               //              MSC_BOT_Abort(pdev);
-               //      }
+                       }
+                       else
+                       {
+                               MSC_BOT_Abort(pdev);
+                       }
                }
                /*Burst xfer handled internally*/
                else if ((hmsc->bot_state != USBD_BOT_DATA_IN) &&