yei

Dependencies:   interface mbed enc_1multi calPID motorout KondoServoLibrary

Fork of cat18_operate by Catch the GIANT Caplico!

Revision:
23:f45eb02433a5
Parent:
22:4f1f8dc1705a
diff -r 4f1f8dc1705a -r f45eb02433a5 filesystem/filesystem.cpp
--- a/filesystem/filesystem.cpp	Tue Aug 28 03:09:39 2018 +0000
+++ b/filesystem/filesystem.cpp	Sun Sep 02 07:53:06 2018 +0000
@@ -11,7 +11,7 @@
     FILE *fp;
     DEBUG("FileSave() start\r\n");
     if((fp = fopen(kFileName, "w")) == NULL) {
-        DEBUG("error : FileSave()");
+        DEBUG("error : FileSave()\r\n");
         return;
     }
     fprintf(fp, "%s\r\n", kComment[0]);
@@ -33,6 +33,7 @@
     DEBUG("FileLoad() start\r\n");
     FILE *fp;
     if((fp = fopen(kFileName, "r")) == NULL) {
+        DEBUG("There is no file\r\n");
         return;
     }
     int old_num = 0;
@@ -42,6 +43,7 @@
         char *error;
         if(fscanf(fp,"%s",comment) == -1) {
             DEBUG("FileLoad() finish\r\n");
+            fclose(fp);
             return;
         }
         int num = strtod(comment, &error);
@@ -63,7 +65,7 @@
                 case 2:
                     static int is_boxnum = 0;
                     is_boxnum = !is_boxnum;
-                    if(is_boxnum == 1) shootingbox[num].is_exist = 0;
+                    if(is_boxnum == 1) shootingbox[num].is_exist = 1;
                     else shootingbox[old_num].color = (Color)num;
             }
         }