Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Tools/AP_Periph/battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void AP_Periph_FW::can_battery_update(void)
pkt.state_of_health_pct = state_of_health_pct;
}

pkt.state_of_charge_pct = UAVCAN_EQUIPMENT_POWER_BATTERYINFO_STATE_OF_CHARGE_UNKNOWN;
Comment thread
lgarciaos marked this conversation as resolved.
Outdated
uint8_t percentage = 0;
Comment on lines +65 to 66
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pkt.state_of_charge_pct = battery_lib.capacity_remaining_pct(percentage, i) ? percentage : UAVCAN_EQUIPMENT_POWER_BATTERYINFO_STATE_OF_CHARGE_UNKNOWN;
uint8_t percentage = 0;
uint8_t percentage = UAVCAN_EQUIPMENT_POWER_BATTERYINFO_STATE_OF_CHARGE_UNKNOWN;

if (battery_lib.capacity_remaining_pct(percentage, i)) {
pkt.state_of_charge_pct = percentage;
Expand Down
Loading