PICO I2C FW

Dependencies:   USBDevice

Revision:
14:480f2398fe6a
Parent:
13:674c647d12dd
Child:
15:61dce4bef44f
--- a/main.cpp	Tue Jul 03 16:48:14 2018 +0000
+++ b/main.cpp	Fri Jul 06 20:27:39 2018 +0000
@@ -916,6 +916,32 @@
     return p - bufptr - 1;
 }
 
+bool print_settings_file_2()
+{
+    char * line = NULL;
+    int len = 0;
+    
+    FILE *fp = fopen(settings_file, "r");
+    if (fp != NULL) 
+    {
+        pc.printf("*\r\n");
+        
+        // Read contents from file
+        while ((getline(&line, &len, fp)) != -1) 
+        {
+            pc.printf("%s", line);
+        }
+        pc.printf("*\r\n");
+        
+        fclose(fp);  
+    }
+    else
+    {
+        return false;
+    }
+    return true;
+}
+
 //returns true if settings file exists and is in the proper format
 bool apply_settings_file(bool (&logged_devices)[MAX_DEVICES], int& interval)
 {
@@ -1195,6 +1221,7 @@
                                         if(device == 0)//get config
                                         {
                                             fileExists = print_settings_file();
+                                            //fileExists = print_settings_file_2();
                                         }
                                         if(device == 1)//get log
                                         {