[F7][LIB] Fix MacOS on-board flash MSC mode for F7 (HAL)
Equivalent to a3d4048
(#7266)
This commit is contained in:
parent
d99c53c86f
commit
713783c76b
|
@ -349,6 +349,12 @@ static int8_t SCSI_ModeSense6 (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *
|
||||||
len--;
|
len--;
|
||||||
hmsc->bot_data[len] = MSC_Mode_Sense6_data[len];
|
hmsc->bot_data[len] = MSC_Mode_Sense6_data[len];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set bit 7 of the device configuration byte to indicate write protection
|
||||||
|
if (((USBD_StorageTypeDef *)pdev->pMSC_UserData)->IsWriteProtected(lun) != 0) {
|
||||||
|
hmsc->bot_data[2] = hmsc->bot_data[2] | (1 << 7);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,6 +381,11 @@ static int8_t SCSI_ModeSense10 (USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t
|
||||||
hmsc->bot_data[len] = MSC_Mode_Sense10_data[len];
|
hmsc->bot_data[len] = MSC_Mode_Sense10_data[len];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set bit 7 of the device configuration byte to indicate write protection
|
||||||
|
if (((USBD_StorageTypeDef *)pdev->pMSC_UserData)->IsWriteProtected(lun) != 0) {
|
||||||
|
hmsc->bot_data[3] = hmsc->bot_data[3] | (1 << 7);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue