优化日志

lowmem
Matthew 1 month ago
parent 115a22dd47
commit 6e1625b58d

@ -1278,7 +1278,7 @@ int CPhoneDevice::QueryBattaryVoltage(int timesForAvg, int* chargingVoltage)
int totalVals = 0; int totalVals = 0;
int cv = 0; int cv = 0;
int idx = 0; int idx = 0;
XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BusVoltage"); // XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BusVoltage");
int matched = 0; int matched = 0;
for (idx = 0; idx < timesForAvg; idx++) for (idx = 0; idx < timesForAvg; idx++)
{ {
@ -1294,13 +1294,13 @@ int CPhoneDevice::QueryBattaryVoltage(int timesForAvg, int* chargingVoltage)
break; break;
} }
} }
XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BusVoltage end"); // XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BusVoltage end");
if (chargingVoltage != NULL) if (chargingVoltage != NULL)
{ {
*chargingVoltage = matched > 0 ? (cv / matched) : 0; *chargingVoltage = matched > 0 ? (cv / matched) : 0;
} }
XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BatteryVoltage"); // XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BatteryVoltage");
matched = 0; matched = 0;
for (int idx = 0; idx < timesForAvg; idx++) for (int idx = 0; idx < timesForAvg; idx++)
{ {
@ -1315,7 +1315,7 @@ int CPhoneDevice::QueryBattaryVoltage(int timesForAvg, int* chargingVoltage)
matched++; matched++;
} }
} }
XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BatteryVoltage end"); // XYLOG(XYLOG_SEVERITY_DEBUG, "WorkStatus BatteryVoltage end");
return (matched > 0) ? (totalVals / matched) : 0; return (matched > 0) ? (totalVals / matched) : 0;
} }

Loading…
Cancel
Save