mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-31 04:58:30 -04:00
GCS_MAVLink: add default instance to get_battery_remaining_percentage, make it const
This commit is contained in:
parent
e482651c0b
commit
d583d157e7
@ -40,7 +40,7 @@ protected:
|
||||
|
||||
uint64_t capabilities() const override;
|
||||
|
||||
uint8_t get_battery_remaining_percentage() override { return -1; };
|
||||
uint8_t get_battery_remaining_percentage(uint8_t instance) const override { return -1; };
|
||||
|
||||
private:
|
||||
|
||||
|
@ -431,7 +431,7 @@ protected:
|
||||
virtual float vfr_hud_airspeed() const;
|
||||
virtual int16_t vfr_hud_throttle() const { return 0; }
|
||||
virtual float vfr_hud_alt() const;
|
||||
virtual uint8_t get_battery_remaining_percentage();
|
||||
virtual uint8_t get_battery_remaining_percentage(uint8_t instance=0) const;
|
||||
|
||||
static constexpr const float magic_force_arm_value = 2989.0f;
|
||||
static constexpr const float magic_force_disarm_value = 21196.0f;
|
||||
|
@ -4662,9 +4662,9 @@ void GCS_MAVLINK::manual_override(RC_Channel *c, int16_t value_in, const uint16_
|
||||
c->set_override(override_value, tnow);
|
||||
}
|
||||
|
||||
uint8_t GCS_MAVLINK::get_battery_remaining_percentage() {
|
||||
uint8_t GCS_MAVLINK::get_battery_remaining_percentage(uint8_t instance) const {
|
||||
const AP_BattMonitor &battery = AP::battery();
|
||||
return battery.capacity_remaining_pct();
|
||||
return battery.capacity_remaining_pct(instance);
|
||||
}
|
||||
|
||||
GCS &gcs()
|
||||
|
Loading…
Reference in New Issue
Block a user