summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-01-29 17:12:09 +0100
committerHiFiPhile <[email protected]>2025-01-29 17:21:11 +0100
commita40722b221f878f0d182c602f6d6db8d35031e19 (patch)
tree744739276da6168ec59e8048a0449c17800959d6 /examples
parentf43100bdfd5611c2ba463a05960ea5569a53a20b (diff)
Enable SIM_IO_TIME_MS for normal operation.
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_freertos/src/msc_disk.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/device/cdc_msc_freertos/src/msc_disk.c b/examples/device/cdc_msc_freertos/src/msc_disk.c
index b0324911c..2f3a1c30b 100644
--- a/examples/device/cdc_msc_freertos/src/msc_disk.c
+++ b/examples/device/cdc_msc_freertos/src/msc_disk.c
@@ -28,10 +28,10 @@
#if CFG_TUD_MSC
-#if CFG_TUD_MSC_ASYNC_IO
// Simulate read/write operation time
-#define SIM_IO_TIME_MS 20
+#define SIM_IO_TIME_MS 0
+#if CFG_TUD_MSC_ASYNC_IO
TimerHandle_t sim_io_ops_timer;
static int32_t bytes_processed;
#if configSUPPORT_STATIC_ALLOCATION
@@ -238,9 +238,12 @@ int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buff
}
#if CFG_TUD_MSC_ASYNC_IO
- // Simulate read operation
+ // Simulate background read operation
bytes_processed = ret;
xTimerStart(sim_io_ops_timer, 0);
+#elif SIM_IO_TIME_MS > 0
+ // Simulate read operation
+ tusb_time_delay_ms_api(SIM_IO_TIME_MS);
#endif
return ret;
@@ -284,9 +287,12 @@ int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t*
#endif
#if CFG_TUD_MSC_ASYNC_IO
- // Simulate read operation
+ // Simulate background write operation
bytes_processed = ret;
xTimerStart(sim_io_ops_timer, 0);
+#elif SIM_IO_TIME_MS > 0
+ // Simulate write operation
+ tusb_time_delay_ms_api(SIM_IO_TIME_MS);
#endif
return ret;