更新充电总线电压的获取

serial
BlueMatthew 1 year ago
parent d779ee5c29
commit 23e0df27c3

@ -422,7 +422,19 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
}
else if (it->first == (PROP_CHARGING_BUS_VOL))
{
it->second = std::to_string(GpioControl::getChargingBusVoltage());
double val = -1;
char str[32] = { 0 };
for (int idx = 0; idx < 3; idx++)
{
val = GpioControl::getChargingBusVoltage();
if (val < 0)
{
continue;
}
snprintf(str, sizeof(str), "%.1f", (val / 1000.0));
it->second = str;
break;
}
}
else if (it->first == (PROP_BATTERY_VOLTAGE))
{

Loading…
Cancel
Save