summaryrefslogtreecommitdiff
path: root/examples/device/dynamic_configuration/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-05 23:24:14 +0700
committerhathach <[email protected]>2026-03-05 23:24:14 +0700
commit61e4b9ce3fba2fea731396c56eee1c7b5a2f5338 (patch)
tree8a9e326a544a34f7a0999a8c5b11bee4307314e2 /examples/device/dynamic_configuration/src
parent97476872aa841fcd9cd622e4082d6c57b183c67f (diff)
add IAR warning flags to cmake build and fix them
Diffstat (limited to 'examples/device/dynamic_configuration/src')
-rw-r--r--examples/device/dynamic_configuration/src/msc_disk.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/examples/device/dynamic_configuration/src/msc_disk.c b/examples/device/dynamic_configuration/src/msc_disk.c
index e95b2e197..b545e4652 100644
--- a/examples/device/dynamic_configuration/src/msc_disk.c
+++ b/examples/device/dynamic_configuration/src/msc_disk.c
@@ -215,20 +215,17 @@ int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t*
// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
// - READ10 and WRITE10 has their own callbacks
int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize) {
- // read10 & write10 has their own callback and MUST not be handled here
+ (void) lun;
+ (void) scsi_cmd;
(void) buffer;
(void) bufsize;
- switch (scsi_cmd[0]) {
- default:
- // Set Sense = Invalid Command Operation
- tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
+ // currently no other commands are supported
- // negative means error -> tinyusb could stall and/or response with failed status
- return -1;
- }
+ // Set Sense = Invalid Command Operation
+ (void) tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
- return -1;
+ return -1; // stall/failed command request;
}
#endif