File tree Expand file tree Collapse file tree
Software/Microcontroller/Firmware/AsgardADC Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -682,8 +682,8 @@ endread:
682682 // --------------------------------------------------
683683 // #11 - LCS - LOG_CURRENTFILE_SET --> Reply LCA - LOG_CURRENTFILE_ASSERT
684684 // --------------------------------------------------
685- // Set the current log file to the LOG.CSV
686- // $LCS,LOG1 .CSV
685+ // Set the current log file to the LOG-01 .CSV
686+ // $LCS,LOG-01 .CSV
687687
688688 if (!strcmp (command, " $LCS" ))
689689 {
@@ -921,8 +921,11 @@ endread:
921921 {
922922 strcpy (Answer, " $FMA,DEL" );
923923 if (!isSDCardPresent) goto endeval;
924- if (strcmp (param, AirDataComputer._logfile )) { // The file must not be the default log file
925- SD.remove (param);
924+ if (!strcmp (param, AirDataComputer._logfile ) && (sendtosd_freq == 0 )) { // current file
925+ dataFile.close (); // Close the current file (if is not recording)
926+ }
927+ if ((!strcmp (param, AirDataComputer._logfile ) && (sendtosd_freq == 0 )) || strcmp (param, AirDataComputer._logfile )) {
928+ SD.remove (param); // Delete the file
926929 if (!(SD.exists (param)))
927930 {
928931 strcat (Answer, SEPARATOR);
You can’t perform that action at this time.
0 commit comments