Browse Source

AP_BattMonitor: fixups from peer review

gps-1.3.1
Randy Mackay 3 years ago
parent
commit
1bdfe8ad55
  1. 1
      libraries/AP_BattMonitor/AP_BattMonitor_Torqeedo.cpp
  2. 14
      libraries/AP_BattMonitor/AP_BattMonitor_Torqeedo.h

1
libraries/AP_BattMonitor/AP_BattMonitor_Torqeedo.cpp

@ -65,7 +65,6 @@ void AP_BattMonitor_Torqeedo::read(void) @@ -65,7 +65,6 @@ void AP_BattMonitor_Torqeedo::read(void)
}
// capacity_remaining_pct - returns true if the battery % is available and writes to the percentage argument
// returns false if the battery is unhealthy, does not have current monitoring, or the pack_capacity is too small
bool AP_BattMonitor_Torqeedo::capacity_remaining_pct(uint8_t &percentage) const
{
if (have_info) {

14
libraries/AP_BattMonitor/AP_BattMonitor_Torqeedo.h

@ -14,20 +14,19 @@ @@ -14,20 +14,19 @@
*/
#pragma once
#include <AP_Common/AP_Common.h>
#include <AP_HAL/AP_HAL.h>
#include <AP_Torqeedo/AP_Torqeedo.h>
#include "AP_BattMonitor_Backend.h"
#if HAL_TORQEEDO_ENABLED
#include <AP_Common/AP_Common.h>
#include <AP_HAL/AP_HAL.h>
#include "AP_BattMonitor_Backend.h"
class AP_BattMonitor_Torqeedo: public AP_BattMonitor_Backend
{
public:
// constructor. This incorporates initialisation as well.
AP_BattMonitor_Torqeedo(AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params &params):
AP_BattMonitor_Backend(mon, mon_state, params)
{};
// inherit constructor
using AP_BattMonitor_Backend::AP_BattMonitor_Backend;
// read the latest battery voltage
void read() override;
@ -39,7 +38,6 @@ public: @@ -39,7 +38,6 @@ public:
bool has_temperature() const override { return have_info; };
// capacity_remaining_pct - returns true if the battery % is available and writes to the percentage argument
// returns false if the battery is unhealthy, does not have current monitoring, or the pack_capacity is too small
bool capacity_remaining_pct(uint8_t &percentage) const override WARN_IF_UNUSED;
private:

Loading…
Cancel
Save