summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-17 21:38:46 +0700
committerhathach <[email protected]>2026-03-17 21:38:46 +0700
commit45e80a1042ea802b74ebe97db350f9da17cb2fe4 (patch)
treee8f9352a4e8d241a37a4125fcdf297ea49e3cc2c /examples
parenta3b2b4217630eea3f514ee042ee399e9ee397b8a (diff)
add hil test for host msc and cdc
Diffstat (limited to 'examples')
-rw-r--r--examples/host/msc_file_explorer/src/msc_app.c11
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);