Skip to content

Commit ee35cfb

Browse files
committed
Enable/disable printing of battery status messages
1 parent d869176 commit ee35cfb

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

Firmware/RTK_Surveyor/System.ino

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -346,25 +346,28 @@ void checkBatteryLevels()
346346
battVoltage = lipo.getVoltage();
347347
battChangeRate = lipo.getChangeRate();
348348

349-
Serial.printf("Batt (%d%%): Voltage: %0.02fV", battLevel, battVoltage);
349+
if (settings.enablePrintBatteryMessages)
350+
{
351+
Serial.printf("Batt (%d%%): Voltage: %0.02fV", battLevel, battVoltage);
350352

351-
char tempStr[25];
352-
if (battChangeRate > 0)
353-
sprintf(tempStr, "C");
354-
else
355-
sprintf(tempStr, "Disc");
356-
Serial.printf(" %sharging: %0.02f%%/hr ", tempStr, battChangeRate);
357-
358-
if (battLevel < 10)
359-
sprintf(tempStr, "Red");
360-
else if (battLevel < 50)
361-
sprintf(tempStr, "Yellow");
362-
else if (battLevel >= 50)
363-
sprintf(tempStr, "Green");
364-
else
365-
sprintf(tempStr, "No batt");
353+
char tempStr[25];
354+
if (battChangeRate > 0)
355+
sprintf(tempStr, "C");
356+
else
357+
sprintf(tempStr, "Disc");
358+
Serial.printf(" %sharging: %0.02f%%/hr ", tempStr, battChangeRate);
359+
360+
if (battLevel < 10)
361+
sprintf(tempStr, "Red");
362+
else if (battLevel < 50)
363+
sprintf(tempStr, "Yellow");
364+
else if (battLevel >= 50)
365+
sprintf(tempStr, "Green");
366+
else
367+
sprintf(tempStr, "No batt");
366368

367-
Serial.printf("%s\n\r", tempStr);
369+
Serial.printf("%s\n\r", tempStr);
370+
}
368371

369372
if (productVariant == RTK_SURVEYOR)
370373
{

0 commit comments

Comments
 (0)