Skip to content

Commit a4d69ef

Browse files
committed
Fix #356
1 parent fcaf7ca commit a4d69ef

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

Firmware/RTK_Everywhere/System.ino

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,20 @@ void printReports()
365365
// If we are in rover mode, display HPA and SIV
366366
if (inRoverMode() == true)
367367
{
368+
systemPrintf("Rover: ");
369+
368370
float hpa = gnssGetHorizontalAccuracy();
369371

370-
char modifiedHpa[20];
371-
const char *hpaUnits =
372-
getHpaUnits(hpa, modifiedHpa, sizeof(modifiedHpa), 3); // Returns string of the HPA units
372+
if (hpa <= 30.)
373+
{
374+
char modifiedHpa[20];
375+
const char *hpaUnits =
376+
getHpaUnits(hpa, modifiedHpa, sizeof(modifiedHpa), 3); // Returns string of the HPA units
373377

374-
systemPrintf("Rover Accuracy (%s): %s, SIV: %d GNSS State: ", hpaUnits, modifiedHpa,
375-
gnssGetSatellitesInView());
378+
systemPrintf("Accuracy (%s): %s, ", hpaUnits, modifiedHpa);
379+
}
380+
381+
systemPrintf("SIV: %d GNSS State: ", gnssGetSatellitesInView());
376382

377383
if (gnssIsRTKFix() == true)
378384
systemPrint("RTK Fix");
@@ -721,11 +727,14 @@ const char *getHpaUnits(double hpa, char *buffer, int length, int decimals)
721727
{
722728
const char *units;
723729

730+
static const char unknown[] = "Unknown";
731+
static const char inch[] = "in";
732+
724733
// Return the units
725734
if (settings.measurementScale >= MEASUREMENT_SCALE_MAX)
726735
{
727-
units = "Unknown";
728-
strcpy(buffer, "Unknown");
736+
units = unknown;
737+
strncpy(buffer, unknown, length);
729738
}
730739
else
731740
{
@@ -747,7 +756,7 @@ const char *getHpaUnits(double hpa, char *buffer, int length, int decimals)
747756
snprintf(buffer, length, "%.*f", decimals, feet);
748757
else
749758
{
750-
units = "in";
759+
units = inch;
751760
snprintf(buffer, length, "%.*f", decimals, inches);
752761
}
753762
break;

0 commit comments

Comments
 (0)