AP_OSD: add and use AP_BATTERY_ENABLED

This commit is contained in:
Peter Barker 2024-01-31 19:38:50 +11:00 committed by Andrew Tridgell
parent 10a815d3a2
commit c7678042da
1 changed files with 2 additions and 0 deletions

View File

@ -446,6 +446,7 @@ void AP_OSD::update_stats()
// maximum altitude
alt = -alt;
_stats.max_alt_m = fmaxf(_stats.max_alt_m, alt);
#if AP_BATTERY_ENABLED
// maximum current
AP_BattMonitor &battery = AP::battery();
float amps;
@ -457,6 +458,7 @@ void AP_OSD::update_stats()
if (voltage > 0) {
_stats.min_voltage_v = fminf(_stats.min_voltage_v, voltage);
}
#endif
#if AP_RSSI_ENABLED
// minimum rssi
AP_RSSI *ap_rssi = AP_RSSI::get_singleton();