Skip to content

Commit 954816e

Browse files
committed
Fix #358
1 parent fcaf7ca commit 954816e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Firmware/RTK_Everywhere/menuSystem.ino

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,13 @@ void menuSystem()
193193
else
194194
systemPrintln("Off");
195195

196-
if (settings.shutdownNoChargeTimeout_s == 0)
197-
systemPrintln("c) Shutdown if not charging: Disabled");
198-
else
199-
systemPrintf("c) Shutdown if not charging after: %d seconds\r\n", settings.shutdownNoChargeTimeout_s);
196+
if (present.fuelgauge_max17048 || present.fuelgauge_bq40z50 || present.charger_mp2762a)
197+
{
198+
if (settings.shutdownNoChargeTimeout_s == 0)
199+
systemPrintln("c) Shutdown if not charging: Disabled");
200+
else
201+
systemPrintf("c) Shutdown if not charging after: %d seconds\r\n", settings.shutdownNoChargeTimeout_s);
202+
}
200203

201204
systemPrintln("d) Debug software");
202205

@@ -254,7 +257,7 @@ void menuSystem()
254257
settings.bluetoothRadioType = BLUETOOTH_RADIO_SPP_AND_BLE;
255258
bluetoothStart();
256259
}
257-
else if (incoming == 'c')
260+
else if ((incoming == 'c') && (present.fuelgauge_max17048 || present.fuelgauge_bq40z50 || present.charger_mp2762a))
258261
{
259262
getNewSetting("Enter time in seconds to shutdown unit if not charging (0 to disable)", 0, 60 * 60 * 24 * 7,
260263
&settings.shutdownNoChargeTimeout_s); // Arbitrary 7 day limit

0 commit comments

Comments
 (0)