You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Check if we are inside the max time window for logging
130
-
if ((systemTime_minutes - startLogTime_minutes) < settings.maxLogTime_minutes)
131
-
{
132
-
while (i2cGNSS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer
133
-
{
134
-
//Attempt to write to file system. This avoids collisions with file writing in F9PSerialReadTask()
135
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait) == pdPASS)
136
-
{
137
-
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
138
-
139
-
i2cGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
140
-
141
-
int bytesWritten = ubxFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card
142
-
143
-
//Force sync every 1000ms
144
-
if (millis() - lastUBXLogSyncTime > 1000)
145
-
{
146
-
lastUBXLogSyncTime = millis();
147
-
digitalWrite(baseStatusLED, !digitalRead(baseStatusLED)); //Blink LED to indicate logging activity
148
-
ubxFile.sync();
149
-
digitalWrite(baseStatusLED, !digitalRead(baseStatusLED)); //Return LED to previous state
150
-
}
151
-
152
-
xSemaphoreGive(xFATSemaphore);
153
-
}
154
-
155
-
// In case the SD writing is slow or there is a lot of data to write, keep checking for the arrival of new data
156
-
i2cGNSS.checkUblox(); // Check for the arrival of new data and process it.
157
-
}
158
-
}
159
-
}
160
-
161
-
//Report file sizes to show recording is working
162
-
if (online.nmeaLogging == true || online.ubxLogging == true)
163
-
{
164
-
if (millis() - lastFileReport > 5000)
165
-
{
166
-
lastFileReport = millis();
167
-
if (online.nmeaLogging == true && online.ubxLogging == true)
168
-
Serial.printf("UBX and NMEA file size: %d / %d", ubxFile.fileSize(), nmeaFile.fileSize());
//Check if we are inside the max time window for logging
355
+
if ((systemTime_minutes - startLogTime_minutes) < settings.maxLogTime_minutes)
356
+
{
357
+
while (i2cGNSS.fileBufferAvailable() >= sdWriteSize) // Check to see if we have at least sdWriteSize waiting in the buffer
358
+
{
359
+
//Attempt to write to file system. This avoids collisions with file writing in F9PSerialReadTask()
360
+
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait) == pdPASS)
361
+
{
362
+
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
363
+
364
+
i2cGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
365
+
366
+
int bytesWritten = ubxFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card
367
+
368
+
//Force sync every 1000ms
369
+
if (millis() - lastUBXLogSyncTime > 1000)
370
+
{
371
+
lastUBXLogSyncTime = millis();
372
+
digitalWrite(baseStatusLED, !digitalRead(baseStatusLED)); //Blink LED to indicate logging activity
373
+
ubxFile.sync();
374
+
digitalWrite(baseStatusLED, !digitalRead(baseStatusLED)); //Return LED to previous state
375
+
}
376
+
377
+
xSemaphoreGive(xFATSemaphore);
378
+
}
379
+
380
+
// In case the SD writing is slow or there is a lot of data to write, keep checking for the arrival of new data
381
+
i2cGNSS.checkUblox(); // Check for the arrival of new data and process it.
382
+
}
383
+
}
384
+
}
385
+
386
+
//Report file sizes to show recording is working
387
+
if (online.nmeaLogging == true || online.ubxLogging == true)
388
+
{
389
+
if (millis() - lastFileReport > 5000)
390
+
{
391
+
lastFileReport = millis();
392
+
if (online.nmeaLogging == true && online.ubxLogging == true)
393
+
Serial.printf("UBX and NMEA file size: %d / %d", ubxFile.fileSize(), nmeaFile.fileSize());
0 commit comments