Skip to content

Commit 87a66c7

Browse files
authored
Merge pull request #523 from sparkfun/pcUpdates
Better STATE_TESTING support for mosaic-X5
2 parents f107635 + af81f62 commit 87a66c7

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,15 +2387,31 @@ void paintSystemTest()
23872387
drawFrame(); // Outside edge
23882388

23892389
oled->setFont(QW_FONT_5X7); // Set font to smallest
2390-
oled->setCursor(xOffset, yOffset); // x, y
2391-
oled->print("SD:");
23922390

2393-
if (online.microSD == false)
2394-
beginSD(); // Test if SD is present
2395-
if (online.microSD == true)
2396-
oled->print("OK");
2397-
else
2398-
oled->print("FAIL");
2391+
if (present.microSd)
2392+
{
2393+
oled->setCursor(xOffset, yOffset); // x, y
2394+
oled->print("SD:");
2395+
2396+
if (online.microSD == false)
2397+
beginSD(); // Test if SD is present
2398+
if (online.microSD == true)
2399+
oled->print("OK");
2400+
else
2401+
oled->print("FAIL");
2402+
}
2403+
else if (present.gnss_mosaicX5)
2404+
{
2405+
// Facet mosaic has an SD card, but it is connected directly to the mosaic-X5
2406+
// Calling gnss->update() during the GNSS check will cause sdCardSize to be updated
2407+
oled->setCursor(xOffset, yOffset); // x, y
2408+
oled->print("SD:");
2409+
2410+
if (sdCardSize > 0)
2411+
oled->print("OK");
2412+
else
2413+
oled->print("FAIL");
2414+
}
23992415

24002416
if (present.fuelgauge_max17048 || present.fuelgauge_bq40z50)
24012417
{
@@ -2517,7 +2533,7 @@ void paintSystemTest()
25172533

25182534
oled->setCursor(xOffset, yOffset + (2 * charHeight)); // x, y
25192535
oled->print("LBand:");
2520-
if (online.lband_neo == true)
2536+
if ((online.lband_neo == true) || (present.gnss_mosaicX5))
25212537
oled->print("OK");
25222538
else
25232539
oled->print("FAIL");

Firmware/RTK_Everywhere/GNSS_Mosaic.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,8 @@ void GNSS_MOSAIC::storeBlock4007(SEMP_PARSE_STATE *parse)
23752375
_altitude = (float)sempSbfGetF8(parse, 32);
23762376
_horizontalAccuracy = ((float)sempSbfGetU2(parse, 90)) / 100.0; // Convert from cm to m
23772377
_satellitesInView = sempSbfGetU1(parse, 74);
2378+
if (_satellitesInView == 255) // 255 indicates "Do-Not-Use"
2379+
_satellitesInView = 0;
23782380
_fixType = sempSbfGetU1(parse, 14) & 0x0F;
23792381
_determiningFixedPosition = (sempSbfGetU1(parse, 14) >> 6) & 0x01;
23802382
_clkBias_ms = sempSbfGetF8(parse, 60);
@@ -2646,9 +2648,17 @@ void processSBFReceiverSetup(SEMP_PARSE_STATE *parse, uint16_t type)
26462648
if (sempSbfGetBlockNumber(parse) == 5902)
26472649
{
26482650
snprintf(gnssUniqueId, sizeof(gnssUniqueId), "%s", sempSbfGetString(parse, 156)); // Extract RxSerialNumber
2651+
26492652
snprintf(gnssFirmwareVersion, sizeof(gnssFirmwareVersion), "%s",
26502653
sempSbfGetString(parse, 196)); // Extract RXVersion
26512654

2655+
// gnssFirmwareVersion is 4.14.4, 4.14.10.1, etc.
2656+
// Create gnssFirmwareVersionInt from the first two fields only, so it will fit on the OLED
2657+
int verMajor = 0;
2658+
int verMinor = 0;
2659+
sscanf(gnssFirmwareVersion, "%d.%d.", &verMajor, &verMinor); // Do we care if this fails?
2660+
gnssFirmwareVersionInt = (verMajor * 100) + verMinor;
2661+
26522662
GNSS_MOSAIC *mosaic = (GNSS_MOSAIC *)gnss;
26532663
mosaic->_receiverSetupSeen = true;
26542664
}

Firmware/RTK_Everywhere/System.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void updateBattery()
9898
((uint8_t)readAnalogPinAsDigital(pin_chargerLED));
9999
systemPrint("MCP73833 Charger: ");
100100
if (combinedStat == 3)
101-
systemPrintln("standby / fault");
101+
systemPrintln("standby");
102102
else if (combinedStat == 2)
103103
systemPrintln("battery is charging");
104104
else if (combinedStat == 1)

0 commit comments

Comments
 (0)