summaryrefslogtreecommitdiff
path: root/demos/host/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-09-25 16:20:38 +0700
committerhathach <[email protected]>2013-09-25 16:20:38 +0700
commit1fee50b9fe64c32f62baa8f96e1fa3687fa7da5d (patch)
treedef8c534d35e86c914da89517d6ecd3334a51716 /demos/host/src
parentcf65f859be27d71fb64c1c0bca07585f4df37f75 (diff)
add tusbh_msc_status
reanme PRINTF_TARGET_DEBUG_CONSOLE to PRINTF_TARGET_SEMIHOST add read10 implementation able to read fat root sector
Diffstat (limited to 'demos/host/src')
-rw-r--r--demos/host/src/msc_app.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/demos/host/src/msc_app.c b/demos/host/src/msc_app.c
index 1006ad168..a6a3583d7 100644
--- a/demos/host/src/msc_app.c
+++ b/demos/host/src/msc_app.c
@@ -84,14 +84,37 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr)
printf("LBA 0-0x%X Block Size: %d\n", last_lba, block_size);
//------------- file system (only 1 LUN support) -------------//
- DSTATUS stat = disk_initialize(0);
+ // DSTATUS stat = disk_initialize(0);
+ disk_state = 0;
if ( disk_is_ready(0) )
{
- f_mount(0, &fatfs[dev_addr-1]);
+ if ( f_mount(0, &fatfs[dev_addr-1]) != FR_OK )
+ {
+ puts("mount failed");
+ return;
+ }
+
+ DIR root_dir;
+ if ( f_opendir(&root_dir, "/") != FR_OK )
+ {
+ puts("open root dir failed");
+ return;
+ }
}
}
+void tusbh_msc_unmounted_isr(uint8_t dev_addr)
+{
+ disk_state = STA_NOINIT;
+ puts("--");
+}
+
+void tusbh_msc_isr(uint8_t dev_addr, tusb_event_t event, uint32_t xferred_bytes)
+{
+ putchar('x');
+}
+
//--------------------------------------------------------------------+
// IMPLEMENTATION
//--------------------------------------------------------------------+