diff --git a/src/Power.cpp b/src/Power.cpp index 7de82b8d6..bb5d16d10 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -828,8 +828,11 @@ void Power::readPowerStatus() // Notify any status instances that are observing us const PowerStatus powerStatus2 = PowerStatus(hasBattery, usbPowered, isChargingNow, batteryVoltageMv, batteryChargePercent); - LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d", powerStatus2.getHasUSB(), powerStatus2.getIsCharging(), - powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent()); + if (millis() > lastLogTime + 50 * 1000) { + LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d", powerStatus2.getHasUSB(), + powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent()); + lastLogTime = millis(); + } newStatus.notifyObservers(&powerStatus2); #ifdef DEBUG_HEAP if (lastheap != memGet.getFreeHeap()) { diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 0487d1fea..36ec7c580 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1589,8 +1589,12 @@ bool GPS::lookForLocation() #ifndef TINYGPS_OPTION_NO_STATISTICS if (reader.failedChecksum() > lastChecksumFailCount) { - LOG_WARN("%u new GPS checksum failures, for a total of %u", reader.failedChecksum() - lastChecksumFailCount, - reader.failedChecksum()); +// In a GPS_DEBUG build we want to log all of these. In production, we only care if there are many of them. +#ifndef GPS_DEBUG + if (reader.failedChecksum() > 4) +#endif + LOG_WARN("%u new GPS checksum failures, for a total of %u", reader.failedChecksum() - lastChecksumFailCount, + reader.failedChecksum()); lastChecksumFailCount = reader.failedChecksum(); } #endif diff --git a/src/power.h b/src/power.h index 23eb95064..cdbdd3ea0 100644 --- a/src/power.h +++ b/src/power.h @@ -138,6 +138,7 @@ class Power : private concurrency::OSThread void reboot(); // open circuit voltage lookup table uint8_t low_voltage_counter; + int32_t lastLogTime = 0; #ifdef DEBUG_HEAP uint32_t lastheap; #endif