File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -542,6 +542,9 @@ uint16_t failedParserMessages_NMEA = 0;
542542unsigned long btLastByteReceived = 0 ; // Track when last BT transmission was received.
543543const long btMinEscapeTime = 2000 ; // Bluetooth serial traffic must stop this amount before an escape char is recognized
544544uint8_t btEscapeCharsReceived = 0 ; // Used to enter command mode
545+
546+ bool externalPowerConnected = false ; // Goes true when a high voltage is seen on power control pin
547+
545548// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
546549/*
547550 +---------------------------------------+ +----------+
Original file line number Diff line number Diff line change @@ -311,10 +311,17 @@ void checkBatteryLevels()
311311 systemPrintf (" Batt (%d%%): Voltage: %0.02fV" , battLevel, battVoltage);
312312
313313 char tempStr[25 ];
314- if (battChangeRate > 0 )
314+ if (battChangeRate >= -0.01 )
315+ {
315316 snprintf (tempStr, sizeof (tempStr), " C" );
317+ externalPowerConnected = true ;
318+ }
316319 else
320+ {
317321 snprintf (tempStr, sizeof (tempStr), " Disc" );
322+ externalPowerConnected = false ;
323+ }
324+
318325 systemPrintf (" %sharging: %0.02f%%/hr " , tempStr, battChangeRate);
319326
320327 if (battLevel < 10 )
@@ -394,7 +401,7 @@ bool createTestFile()
394401 {
395402 if (SD_MMC.exists (testFileName))
396403 SD_MMC.remove (testFileName);
397- return (!SD_MMC.exists (testFileName));
404+ return (!SD_MMC.exists (testFileName));
398405 }
399406#endif
400407}
You can’t perform that action at this time.
0 commit comments