You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
--- Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src/usbd_msc_scsi.c (date 1511202099000)
|
|
+++ Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src/usbd_msc_scsi.c (revision )
|
|
@@ -190,14 +190,27 @@
|
|
INVALID_CDB);
|
|
return -1;
|
|
}
|
|
-
|
|
- if(((USBD_StorageTypeDef *)pdev->pUserData)->IsReady(lun) !=0 )
|
|
+
|
|
+ // XXX THIS SECTION IS MODIFIED FOR NOTIFY!
|
|
+ // https://www.microchip.com/forums/m401735.aspx
|
|
+ int8_t changeStatus = ((USBD_StorageTypeDef *)pdev->pUserData)->IsReady(lun);
|
|
+ if(changeStatus != 0)
|
|
{
|
|
- SCSI_SenseCode(pdev,
|
|
- lun,
|
|
- NOT_READY,
|
|
- MEDIUM_NOT_PRESENT);
|
|
-
|
|
+ if (changeStatus == -1)
|
|
+ {
|
|
+ SCSI_SenseCode(pdev,
|
|
+ lun,
|
|
+ UNIT_ATTENTION,
|
|
+ MEDIUM_HAVE_CHANGED);
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ SCSI_SenseCode(pdev,
|
|
+ lun,
|
|
+ NOT_READY,
|
|
+ MEDIUM_NOT_PRESENT);
|
|
+ }
|
|
+
|
|
hmsc->bot_state = USBD_BOT_NO_DATA;
|
|
return -1;
|
|
}
|
|
|