mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
ectool: battery: Allow negative present current
Battery interface over host command is different, as it allows negative current values to indicate discharge, let's not fail in that case. BRANCH=none BUG=b:65697620 TEST=ectool battery 1 does not fail when battery is discharging. Change-Id: I89ca750e24706f55a0589201aeaf9fea50f3132f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/869552 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
c10a631026
commit
e71899a573
@@ -5977,9 +5977,8 @@ int get_battery_command(int index)
|
||||
goto cmd_error;
|
||||
printf(" Present voltage %u mV\n", dynamic_r.actual_voltage);
|
||||
|
||||
if (!is_battery_range(dynamic_r.actual_current))
|
||||
goto cmd_error;
|
||||
printf(" Present current %u mA\n", dynamic_r.actual_current);
|
||||
/* current can be negative */
|
||||
printf(" Present current %d mA\n", dynamic_r.actual_current);
|
||||
|
||||
if (!is_battery_range(dynamic_r.remaining_capacity))
|
||||
goto cmd_error;
|
||||
|
||||
Reference in New Issue
Block a user