Skip to content

Commit 62fe870

Browse files
committed
Add present.mosaicMicroSd, mosaicSdCardSize, mosaicSdFreeSpace
1 parent 108a761 commit 62fe870

File tree

6 files changed

+49
-6
lines changed

6 files changed

+49
-6
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ void beginBoard()
652652
present.invertedFastPowerOff = true;
653653
present.gnss_to_uart = true;
654654
present.gnss_to_uart2 = true;
655+
present.mosaicMicroSd;
655656
present.microSdCardDetectLow = true; // Except microSD is connected to mosaic... present.microSd is false
656657

657658
present.minCno = true;

Firmware/RTK_Everywhere/GNSS.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ void gnssDetectReceiverType()
198198
present.minCno = true;
199199
present.minElevation = true;
200200
present.dynamicModel = true;
201+
present.mosaicMicroSd = true;
201202
// present.needsExternalPpl = true; // Nope. No L-Band support...
202203

203204
#endif // COMPILE_MOSAICX5

Firmware/RTK_Everywhere/GNSS_Mosaic.ino

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,54 @@ GNSS_Mosaic.ino
3131
//----------------------------------------
3232
void menuLogMosaic()
3333
{
34+
if (!present.mosaicMicroSd) // This may be needed for the G5 P3 ?
35+
return;
36+
3437
bool applyChanges = false;
3538

3639
while (1)
3740
{
3841
systemPrintln();
3942
systemPrintln("Menu: Logging");
43+
systemPrintln();
4044

4145
char sdCardSizeChar[20];
4246
String cardSize;
43-
stringHumanReadableSize(cardSize, sdCardSize);
47+
stringHumanReadableSize(cardSize, mosaicSdCardSize);
4448
cardSize.toCharArray(sdCardSizeChar, sizeof(sdCardSizeChar));
4549
char sdFreeSpaceChar[20];
4650
String freeSpace;
47-
stringHumanReadableSize(freeSpace, sdFreeSpace);
51+
stringHumanReadableSize(freeSpace, mosaicSdFreeSpace);
4852
freeSpace.toCharArray(sdFreeSpaceChar, sizeof(sdFreeSpaceChar));
4953

54+
// On Facet mosaic, the SD is connected directly to the X5 and is accessible
55+
// On Facet Flex X5, the internal mosaic SD card is not accessible
5056
char myString[70];
51-
snprintf(myString, sizeof(myString), "SD card size: %s / Free space: %s", sdCardSizeChar, sdFreeSpaceChar);
57+
snprintf(myString, sizeof(myString), "Mosaic SD card size: %s / Free space: %s", sdCardSizeChar, sdFreeSpaceChar);
5258
systemPrintln(myString);
59+
systemPrintln();
60+
61+
if (settings.enableSD && online.microSD)
62+
{
63+
char sdCardSizeChar[20];
64+
String cardSize;
65+
stringHumanReadableSize(cardSize, sdCardSize);
66+
cardSize.toCharArray(sdCardSizeChar, sizeof(sdCardSizeChar));
67+
char sdFreeSpaceChar[20];
68+
String freeSpace;
69+
stringHumanReadableSize(freeSpace, sdFreeSpace);
70+
freeSpace.toCharArray(sdFreeSpaceChar, sizeof(sdFreeSpaceChar));
71+
72+
char myString[70];
73+
snprintf(myString, sizeof(myString), "Accessible SD card size: %s / Free space: %s", sdCardSizeChar, sdFreeSpaceChar);
74+
systemPrintln(myString);
75+
76+
if (online.logging)
77+
{
78+
systemPrintf("Accessible SD current log file name: %s\r\n", logFileName);
79+
}
80+
systemPrintln();
81+
}
5382

5483
systemPrint("1) Log NMEA to microSD: ");
5584
if (settings.enableLogging == true)
@@ -2651,6 +2680,9 @@ void GNSS_MOSAIC::storeBlock4014(SEMP_PARSE_STATE *parse)
26512680
//----------------------------------------
26522681
void GNSS_MOSAIC::storeBlock4059(SEMP_PARSE_STATE *parse)
26532682
{
2683+
if (!present.mosaicMicroSd)
2684+
return;
2685+
26542686
if (sempSbfGetU1(parse, 14) < 1) // Check N is at least 1
26552687
return;
26562688

@@ -2670,9 +2702,15 @@ void GNSS_MOSAIC::storeBlock4059(SEMP_PARSE_STATE *parse)
26702702

26712703
uint64_t diskUsage = (diskUsageMSB * 4294967296) + diskUsageLSB;
26722704

2673-
sdCardSize = diskSizeMB * 1048576; // Convert to bytes
2705+
mosaicSdCardSize = diskSizeMB * 1048576; // Convert to bytes
26742706

2675-
sdFreeSpace = sdCardSize - diskUsage;
2707+
mosaicSdFreeSpace = mosaicSdCardSize - diskUsage;
2708+
2709+
if (!present.microSd) // Overwrite - if this is the only SD card
2710+
{
2711+
sdCardSize = mosaicSdCardSize;
2712+
sdFreeSpace = mosaicSdFreeSpace;
2713+
}
26762714

26772715
_diskStatusSeen = true;
26782716
}

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ const char *ringBufferSemaphoreHolder = "None";
368368
// Display used/free space in menu and config page
369369
uint64_t sdCardSize;
370370
uint64_t sdFreeSpace;
371+
uint64_t mosaicSdCardSize;
372+
uint64_t mosaicSdFreeSpace;
371373
bool outOfSDSpace;
372374
const uint32_t sdMinAvailableSpace = 10000000; // Minimum available bytes before SD is marked as out of space
373375

Firmware/RTK_Everywhere/menuMain.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void menuMain()
235235
else if (incoming == 4)
236236
menuPorts();
237237
#ifdef COMPILE_MOSAICX5
238-
else if (incoming == 5 && productVariant == RTK_FACET_MOSAIC)
238+
else if (incoming == 5 && present.gnss_mosaicX5)
239239
menuLogMosaic();
240240
#endif // COMPILE_MOSAICX5
241241
else if (incoming == 5 && productVariant != RTK_TORCH) // Torch does not have logging

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,7 @@ struct struct_present
18711871
bool imu_zedf9r = false;
18721872

18731873
bool microSd = false;
1874+
bool mosaicMicroSd = false;
18741875
bool microSdCardDetectLow = false; // Card detect low = SD in place
18751876
bool microSdCardDetectHigh = false; // Card detect high = SD in place
18761877
bool microSdCardDetectGpioExpanderHigh = false; // Card detect on GPIO5, high = SD in place

0 commit comments

Comments
 (0)