Skip to content

Commit 6079733

Browse files
committed
Add HAS_NO_BATTERY - use to disable battery icon on config page
1 parent 379551c commit 6079733

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ void beginLEDs()
848848
//Configure the on board MAX17048 fuel gauge
849849
void beginFuelGauge()
850850
{
851-
if (productVariant == REFERENCE_STATION)
851+
if (HAS_NO_BATTERY)
852852
return; //Reference station does not have a battery
853853

854854
//Set up the MAX17048 LiPo fuel gauge

Firmware/RTK_Surveyor/Form.ino

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,12 @@ void createSettingsString(char* newSettings)
763763

764764
stringRecord(newSettings, "logFileName", logFileName);
765765

766-
if (productVariant != REFERENCE_STATION) //Ref Stn does not have a battery
766+
if (HAS_NO_BATTERY) //Ref Stn does not have a battery
767+
{
768+
stringRecord(newSettings, "batteryIconFileName", "src/BatteryBlank.png");
769+
stringRecord(newSettings, "batteryPercent", " ");
770+
}
771+
else
767772
{
768773
//Determine battery icon
769774
int iconLevel = 0;
@@ -921,7 +926,12 @@ void createDynamicDataString(char* settingsCSV)
921926
stringRecord(settingsCSV, "ecefY", ecefY, 3);
922927
stringRecord(settingsCSV, "ecefZ", ecefZ, 3);
923928

924-
if (productVariant != REFERENCE_STATION) //Ref Stn does not have a battery
929+
if (HAS_NO_BATTERY) //Ref Stn does not have a battery
930+
{
931+
stringRecord(settingsCSV, "batteryIconFileName", "src/BatteryBlank.png");
932+
stringRecord(settingsCSV, "batteryPercent", " ");
933+
}
934+
else
925935
{
926936
//Determine battery icon
927937
int iconLevel = 0;

Firmware/RTK_Surveyor/settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ ProductVariant productVariant = RTK_SURVEYOR;
8181
//The rising edge of the TP signal indicates the true top-of-second
8282
#define HAS_GNSS_TP_INT (productVariant == REFERENCE_STATION)
8383

84+
//Macro to show if the the RTK variant has no battery
85+
#define HAS_NO_BATTERY (productVariant == REFERENCE_STATION)
86+
#define HAS_BATTERY (!HAS_NO_BATTERY)
87+
8488
typedef enum
8589
{
8690
BUTTON_ROVER = 0,

0 commit comments

Comments
 (0)