mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 02:02:23 +00:00
Log antispam (#8241)
* less power spam * Don't warn about the first 4 GPS checksum failures
This commit is contained in:
@@ -828,8 +828,11 @@ void Power::readPowerStatus()
|
|||||||
|
|
||||||
// Notify any status instances that are observing us
|
// Notify any status instances that are observing us
|
||||||
const PowerStatus powerStatus2 = PowerStatus(hasBattery, usbPowered, isChargingNow, batteryVoltageMv, batteryChargePercent);
|
const PowerStatus powerStatus2 = PowerStatus(hasBattery, usbPowered, isChargingNow, batteryVoltageMv, batteryChargePercent);
|
||||||
LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d", powerStatus2.getHasUSB(), powerStatus2.getIsCharging(),
|
if (millis() > lastLogTime + 50 * 1000) {
|
||||||
powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d", powerStatus2.getHasUSB(),
|
||||||
|
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
||||||
|
lastLogTime = millis();
|
||||||
|
}
|
||||||
newStatus.notifyObservers(&powerStatus2);
|
newStatus.notifyObservers(&powerStatus2);
|
||||||
#ifdef DEBUG_HEAP
|
#ifdef DEBUG_HEAP
|
||||||
if (lastheap != memGet.getFreeHeap()) {
|
if (lastheap != memGet.getFreeHeap()) {
|
||||||
|
|||||||
@@ -1589,6 +1589,10 @@ bool GPS::lookForLocation()
|
|||||||
|
|
||||||
#ifndef TINYGPS_OPTION_NO_STATISTICS
|
#ifndef TINYGPS_OPTION_NO_STATISTICS
|
||||||
if (reader.failedChecksum() > lastChecksumFailCount) {
|
if (reader.failedChecksum() > lastChecksumFailCount) {
|
||||||
|
// 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,
|
LOG_WARN("%u new GPS checksum failures, for a total of %u", reader.failedChecksum() - lastChecksumFailCount,
|
||||||
reader.failedChecksum());
|
reader.failedChecksum());
|
||||||
lastChecksumFailCount = reader.failedChecksum();
|
lastChecksumFailCount = reader.failedChecksum();
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class Power : private concurrency::OSThread
|
|||||||
void reboot();
|
void reboot();
|
||||||
// open circuit voltage lookup table
|
// open circuit voltage lookup table
|
||||||
uint8_t low_voltage_counter;
|
uint8_t low_voltage_counter;
|
||||||
|
int32_t lastLogTime = 0;
|
||||||
#ifdef DEBUG_HEAP
|
#ifdef DEBUG_HEAP
|
||||||
uint32_t lastheap;
|
uint32_t lastheap;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user