Skip to content

Commit

Permalink
Merge pull request #635 from jbaudoux/fix-20240323-logging
Browse files Browse the repository at this point in the history
Fix LoggingMode detection
  • Loading branch information
fredlcore authored Mar 23, 2024
2 parents 2142581 + 4cd589f commit 1f89830
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions BSB_LAN/BSB_LAN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6852,7 +6852,7 @@ next_parameter:
lastAvgTime = millis() / 60000;

// write averages to SD card to protect from power off
if ((LoggingMode && CF_LOGMODE_SD_CARD) && avg_parameters[0].number > 0) { //write averages if at least one value is set
if ((LoggingMode & CF_LOGMODE_SD_CARD) && avg_parameters[0].number > 0) { //write averages if at least one value is set
File avgfile = SDCard.open(averagesFileName, FILE_WRITE);
if (avgfile) {
avgfile.seek(0);
Expand Down Expand Up @@ -7629,7 +7629,7 @@ void setup() {
pps_values[PPS_RTI] = 0;
}

if (LoggingMode && CF_LOGMODE_SD_CARD) {
if (LoggingMode & CF_LOGMODE_SD_CARD) {
startLoggingDevice();
} else {
#ifndef ESP32
Expand Down Expand Up @@ -7772,7 +7772,7 @@ void setup() {
if (save_debug_mode == 2) telnetServer = new ComServer(23);

#ifndef ESP32
if (!(LoggingMode && CF_LOGMODE_SD_CARD)) {
if (!(LoggingMode & CF_LOGMODE_SD_CARD)) {
digitalWrite(10,HIGH);
}
#endif
Expand Down Expand Up @@ -7805,7 +7805,7 @@ void setup() {
}
}

if (LoggingMode && CF_LOGMODE_SD_CARD) {
if (LoggingMode & CF_LOGMODE_SD_CARD) {
printToDebug(PSTR("Calculating free space on SDCard..."));
uint32_t m = millis();
#if !defined(ESP32)
Expand Down Expand Up @@ -7896,7 +7896,7 @@ void setup() {
#endif

// restore average
if (LoggingMode && CF_LOGMODE_24AVG && CF_LOGMODE_SD_CARD) {
if (LoggingMode & CF_LOGMODE_24AVG || LoggingMode & CF_LOGMODE_SD_CARD) {
if (SDCard.exists(averagesFileName)) {
File avgfile = SDCard.open(averagesFileName, FILE_READ);
if (avgfile) {
Expand Down

0 comments on commit 1f89830

Please sign in to comment.