diff options
| author | Ha Thach <[email protected]> | 2026-03-18 18:10:32 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-18 18:10:32 +0700 |
| commit | 766ac4f7a2c223bb85312c8bb99f8c478c211bae (patch) | |
| tree | 795c7b40c1d8567378ae052a783b0d8b28531ec5 /examples/host | |
| parent | 8f7f286ae347ec1adbfd0888d65fb1aeb263b7d2 (diff) | |
| parent | 0521e6698eb0719c27ef7c2473c9152be30ae172 (diff) | |
Merge pull request #3557 from hathach/hil-host-cdc
add more hil tests
Diffstat (limited to 'examples/host')
| -rw-r--r-- | examples/host/msc_file_explorer/src/msc_app.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/host/msc_file_explorer/src/msc_app.c b/examples/host/msc_file_explorer/src/msc_app.c index 6ac63e937..238af5431 100644 --- a/examples/host/msc_file_explorer/src/msc_app.c +++ b/examples/host/msc_file_explorer/src/msc_app.c @@ -130,11 +130,16 @@ static bool inquiry_complete_cb(uint8_t dev_addr, const tuh_msc_complete_data_t drive_path[0] += drive_num; if (f_mount(&fatfs[drive_num], drive_path, 1) != FR_OK) { - puts("mount failed"); + printf("mount failed\r\n"); + return true; } // change to newly mounted drive - f_chdir(drive_path); + f_chdrive(drive_path); + FRESULT rc = f_chdir("/"); + if (rc != FR_OK) { + printf("chdir failed: %d\r\n", rc); + } // print the drive label // char label[34]; @@ -148,7 +153,7 @@ static bool inquiry_complete_cb(uint8_t dev_addr, const tuh_msc_complete_data_t //------------- IMPLEMENTATION -------------// void tuh_msc_mount_cb(uint8_t dev_addr) { - printf("A MassStorage device is mounted\r\n"); + printf("A MassStorage device (addr = %u) is mounted\r\n", dev_addr); const uint8_t lun = 0; tuh_msc_inquiry(dev_addr, lun, &scsi_resp.inquiry, inquiry_complete_cb, 0); |
