Skip to content

Commit 0f0c6b9

Browse files
author
JLJu
committed
Merge remote-tracking branch 'refs/remotes/BasicAirData/master'
2 parents fd80cc1 + cb97b2a commit 0f0c6b9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Software/Microcontroller/Firmware/AsgardADC/AsgardADC.ino

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,8 @@ endread:
691691
// --------------------------------------------------
692692
// #11 - LCS - LOG_CURRENTFILE_SET --> Reply LCA - LOG_CURRENTFILE_ASSERT
693693
// --------------------------------------------------
694-
// Set the current log file to the LOG.CSV
695-
// $LCS,LOG1.CSV
694+
// Set the current log file to the LOG-01.CSV
695+
// $LCS,LOG-01.CSV
696696

697697
if (!strcmp(command, "$LCS"))
698698
{
@@ -930,8 +930,11 @@ endread:
930930
{
931931
strcpy (Answer, "$FMA,DEL");
932932
if (!isSDCardPresent) goto endeval;
933-
if (strcmp(param, AirDataComputer._logfile)) { // The file must not be the default log file
934-
SD.remove(param);
933+
if (!strcmp(param, AirDataComputer._logfile) && (sendtosd_freq == 0)) { // current file
934+
dataFile.close(); // Close the current file (if is not recording)
935+
}
936+
if ((!strcmp(param, AirDataComputer._logfile) && (sendtosd_freq == 0)) || strcmp(param, AirDataComputer._logfile)) {
937+
SD.remove(param); // Delete the file
935938
if (!(SD.exists(param)))
936939
{
937940
strcat (Answer, SEPARATOR);

0 commit comments

Comments
 (0)