Skip to content

Commit

Permalink
Enable SIM_IO_TIME_MS for normal operation.
Browse files Browse the repository at this point in the history
Signed-off-by: HiFiPhile <admin@hifiphile.com>
  • Loading branch information
HiFiPhile committed Jan 29, 2025
1 parent f43100b commit 5197c1a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions examples/device/cdc_msc_freertos/src/msc_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@

#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
Expand Down Expand Up @@ -238,9 +239,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;
Expand Down Expand Up @@ -284,9 +288,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;
Expand Down

0 comments on commit 5197c1a

Please sign in to comment.