Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem max32630fthr USBDevice
Fork of FTHR_SD_Demo by
Diff: main.cpp
- 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
{
