![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
basic lightning detector with gps and sd card logging
Dependencies: AS3935 AdafruitGPS SDFileSystem TSI mbed ConfigFile
Diff: main.cpp
- Revision:
- 9:15c9bf86d908
- Parent:
- 8:f8830b6c6d9b
- Child:
- 10:499140eb469b
- Child:
- 11:a4096e656762
--- a/main.cpp Tue Jun 30 21:13:18 2015 +0000 +++ b/main.cpp Wed Jul 01 14:00:03 2015 +0000 @@ -233,7 +233,7 @@ sd.mount(); fp = fopen(fileName.c_str(), "r"); - printf ("\n\rReading configuration file[%s]\n\r", fileName.c_str()); + printf ("\n\rReading configuration file [%s]\n\r", fileName.c_str()); // try to read values from the configuration file if (plCfgFile->read((char *)fileName.c_str())) @@ -248,7 +248,7 @@ } } } - + // copy out the new found values *paSysCfg = lSysCfg; bRetVal = true; @@ -277,7 +277,9 @@ if (plCfgFile) delete plCfgFile; - fclose(fp); + if (fp != NULL) + fclose(fp); + sd.unmount(); return bRetVal; }