Skip to content

Commit e1f0319

Browse files
committed
msc PREVENT_ALLOW_MEDIUM_REMOVAL is responded as
1 parent 9e4b77d commit e1f0319

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/arduino/msc/Adafruit_USBD_MSC.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,9 @@ void tud_msc_capacity_cb(uint8_t lun, uint32_t *block_count,
200200
int32_t tud_msc_scsi_cb(uint8_t lun, const uint8_t scsi_cmd[16], void *buffer,
201201
uint16_t bufsize) {
202202
const void *response = NULL;
203-
uint16_t resplen = 0;
203+
int32_t resplen = 0;
204204

205205
switch (scsi_cmd[0]) {
206-
case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
207-
// Host is about to read/write etc ... better not to disconnect disk
208-
resplen = 0;
209-
break;
210206

211207
default:
212208
// Set Sense = Invalid Command Operation
@@ -224,7 +220,7 @@ int32_t tud_msc_scsi_cb(uint8_t lun, const uint8_t scsi_cmd[16], void *buffer,
224220
}
225221

226222
// copy response to stack's buffer if any
227-
if (response && resplen) {
223+
if (response && (resplen > 0) ) {
228224
memcpy(buffer, response, resplen);
229225
}
230226

0 commit comments

Comments
 (0)