Plane: use battery.has_current

This commit is contained in:
Randy Mackay 2014-12-04 15:51:51 +09:00
parent fe8730497a
commit 5cdb8a4c2a
1 changed files with 1 additions and 1 deletions

View File

@ -254,7 +254,7 @@ static NOINLINE void send_extended_status1(mavlink_channel_t chan)
int16_t battery_current = -1; int16_t battery_current = -1;
int8_t battery_remaining = -1; int8_t battery_remaining = -1;
if (battery.monitoring() == AP_BATT_MONITOR_VOLTAGE_AND_CURRENT) { if (battery.has_current()) {
battery_remaining = battery.capacity_remaining_pct(); battery_remaining = battery.capacity_remaining_pct();
battery_current = battery.current_amps() * 100; battery_current = battery.current_amps() * 100;
} }