diff --git a/USBDrive_Airplane_Data_Logger/USBDrive_Airplane_Data_Logger.ino b/USBDrive_Airplane_Data_Logger/USBDrive_Airplane_Data_Logger.ino index d65dfbd..b23e746 100644 --- a/USBDrive_Airplane_Data_Logger/USBDrive_Airplane_Data_Logger.ino +++ b/USBDrive_Airplane_Data_Logger/USBDrive_Airplane_Data_Logger.ino @@ -258,8 +258,8 @@ time_t getdatetime(){ // loop is called repeatedly // static vars to persist between calls void loop(void) { - int i; static int t=0; + int i; char fname[16]; // these buffers are used for message processing @@ -316,6 +316,7 @@ void loop(void) { if (msg1>0) { myFile.print("G:"); myFile.write(GPSRx,msg1); + // extract GPS time for RTC adjust msg1=0; i1=0; if (MSG_OVFL) { @@ -357,7 +358,10 @@ void loop(void) { } t=t+1; } - + + // closing myFile requires starting a new FS + // then opening a new FS (myFiles) + // then opening a new file (myFile) if (!myFile) { /* open a new file */ myDrive1.begin(); myDrive1.startFilesystems();