You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A negative value is sometimes used for current while discharging.
In "measurement/sysfs.cpp" at line 83 (v2.15) the rate becomes negative leading to the specified failure.
bool sysfs_power_meter::set_rate_from_current(double voltage)
{
int current;
if (!get_sysfs_attr("current_now", ¤t))
return false;
/* current: µA
* voltage: V
* rate: W */
rate = (current / 1000000.0) * voltage;
return true;
}
To fix the issue, use the absolute current value in the rate calculation as below: rate = (abs(current) / 1000000.0) * voltage;
The text was updated successfully, but these errors were encountered:
A negative value is sometimes used for current while discharging.
In "measurement/sysfs.cpp" at line 83 (v2.15) the rate becomes negative leading to the specified failure.
To fix the issue, use the absolute current value in the rate calculation as below:
rate = (abs(current) / 1000000.0) * voltage;
The text was updated successfully, but these errors were encountered: