summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-07-25 22:35:02 +0700
committerhathach <[email protected]>2018-07-25 22:35:02 +0700
commit93db46292a2e9446c8d5be53279dcc6c91613755 (patch)
treec86866bc883d1133c354874d4dc300b41d3b7ebf /examples
parent8fc1d151fc4b47e3d91b683caedf220adee8a630 (diff)
update msc example
Diffstat (limited to 'examples')
-rw-r--r--examples/device/nrf52840/src/msc_device_app.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/device/nrf52840/src/msc_device_app.c b/examples/device/nrf52840/src/msc_device_app.c
index 836dd2d48..1dfce5e16 100644
--- a/examples/device/nrf52840/src/msc_device_app.c
+++ b/examples/device/nrf52840/src/msc_device_app.c
@@ -97,12 +97,18 @@ int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer,
break;
case SCSI_CMD_TEST_UNIT_READY:
- ptr = NULL;
+ // Command that host uses to check our readiness before sending other commands
len = 0;
break;
case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
- ptr = NULL;
+ // Host is about to read/write etc ... better not to disconnect disk
+ len = 0;
+ break;
+
+ case SCSI_CMD_START_STOP_UNIT:
+ // Host try to eject/safe remove/powerof us. We could safely disconnect with disk storage, or go into lower power
+ // scsi_start_stop_unit_t const * cmd_start_stop = (scsi_start_stop_unit_t const *) scsi_cmd
len = 0;
break;