summaryrefslogtreecommitdiff
path: root/examples/device/cdc_msc/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-07-01 22:43:58 +0700
committerGitHub <[email protected]>2025-07-01 22:43:58 +0700
commit0d6cb38163692fa8795d75b8eda9454c579bea4a (patch)
treed1c4c18b039f89fecbe9bb69442ef3a32357aca6 /examples/device/cdc_msc/src
parentcd96277bdc7ec83fd414a7a5aa8e61fa14d28a45 (diff)
parentc96cc4369f1b97efe85575f3e5633e38598e9fc2 (diff)
Merge pull request #2967 from HiFiPhile/async_io
MSC Device: Add asynchronous IO support
Diffstat (limited to 'examples/device/cdc_msc/src')
-rw-r--r--examples/device/cdc_msc/src/msc_disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/device/cdc_msc/src/msc_disk.c b/examples/device/cdc_msc/src/msc_disk.c
index 9645f4bfc..458681f58 100644
--- a/examples/device/cdc_msc/src/msc_disk.c
+++ b/examples/device/cdc_msc/src/msc_disk.c
@@ -184,7 +184,7 @@ int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void *buff
}
// Check for overflow of offset + bufsize
- if (offset + bufsize > DISK_BLOCK_SIZE) {
+ if (lba * DISK_BLOCK_SIZE + offset + bufsize > DISK_BLOCK_NUM * DISK_BLOCK_SIZE) {
return -1;
}