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 @@ -512,6 +512,9 @@ uint16_t failedParserMessages_NMEA = 0;
512512unsigned long btLastByteReceived = 0 ; // Track when last BT transmission was received.
513513const long btMinEscapeTime = 2000 ; // Bluetooth serial traffic must stop this amount before an escape char is recognized
514514uint8_t btEscapeCharsReceived = 0 ; // Used to enter command mode
515+
516+ bool externalPowerConnected = false ; // Goes true when a high voltage is seen on power control pin
517+
515518// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
516519/*
517520 +---------------------------------------+ +----------+
Original file line number Diff line number Diff line change @@ -250,10 +250,17 @@ void checkBatteryLevels()
250250 systemPrintf (" Batt (%d%%): Voltage: %0.02fV" , battLevel, battVoltage);
251251
252252 char tempStr[25 ];
253- if (battChangeRate > 0 )
253+ if (battChangeRate >= -0.01 )
254+ {
254255 sprintf (tempStr, " C" );
256+ externalPowerConnected = true ;
257+ }
255258 else
259+ {
256260 sprintf (tempStr, " Disc" );
261+ externalPowerConnected = false ;
262+ }
263+
257264 systemPrintf (" %sharging: %0.02f%%/hr " , tempStr, battChangeRate);
258265
259266 if (battLevel < 10 )
@@ -333,7 +340,7 @@ bool createTestFile()
333340 {
334341 if (SD_MMC.exists (testFileName))
335342 SD_MMC.remove (testFileName);
336- return (!SD_MMC.exists (testFileName));
343+ return (!SD_MMC.exists (testFileName));
337344 }
338345#endif
339346}
You can’t perform that action at this time.
0 commit comments