优化代码

hdrplus
Matthew 1 year ago
parent 41d2206956
commit 42ddd38bab

@ -602,13 +602,6 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
{
it->second = std::to_string(android_os_Process_getTotalMemory()); // Unit: M
}
else if (it->first == (PROP_CHARGING_VOLTAGE))
{
double val = GpioControl::getChargingVoltage() / 200.0; // ChargeVol *5/1000
char str[32] = { 0 };
snprintf(str, sizeof(str), "%.1f", val);
it->second = str;
}
else if (it->first == (PROP_LIGHTDEPENDENT_RESISTOR))
{
int val = GpioControl::getLightAdc();
@ -622,7 +615,7 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
{
it->second = std::to_string(GpioControl::getChargingPower());
}
else if (it->first == (PROP_CHARGING_BUS_VOL))
else if (it->first == (PROP_CHARGING_BUS_VOL) || it->first == (PROP_CHARGING_VOLTAGE))
{
double val = -1;
char str[32] = { 0 };

Loading…
Cancel
Save