MDX-20用の改造

Dependencies:   FatFileSystemCpp

Revision:
8:6e23bf867e38
Parent:
7:a6b950d25e29
Child:
9:280ae971e7cb
--- a/MSCFileSystem.cpp	Mon Dec 12 02:02:11 2016 +0000
+++ b/MSCFileSystem.cpp	Sun Dec 18 08:29:59 2016 +0000
@@ -78,7 +78,7 @@
 
     //print_clock();
     Host_Init();               /* Initialize the  host controller                                    */
-    rc = Host_EnumDev();       /* Enumerate the device connected                                            */
+    rc = Host_EnumDev();       /* Enumerate the device connected    ベースでは、USB memoryがつながるまで待っている (HOST_RhscIntr 1:deviceあり 0:なし)                                        */
     if (rc != OK) {
         fprintf(stderr, "Could not enumerate device: %d\n", rc);
         return rc;
@@ -97,19 +97,25 @@
     return _blkSize == 512 ? OK : 1;
 }
 
-int MSCFileSystem::disk_initialize()
+/** USBの存在確認
+ * @return 1:ない 0:ない 
+ */
+int MSCFileSystem::disk_usbCheck()
 {
-    if(MS_TestUnitReady == OK) {
+    if(Host_Check() != OK){
         return 1;
-    } else {
+        }
         return 0;
+
     }
-    /*
+
+
+int MSCFileSystem::disk_initialize()    // 元からある関数。複
+{
         if ( initialise_msc() != OK )
             return 1;
 
         return 0;
-    */
 }
 
 int MSCFileSystem::disk_write(const char *buffer, int block_number)