mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 02:30:35 +08:00
Code cleanup
This commit is contained in:
committed by
Julian Oes
parent
77cf081925
commit
11bbc8ae34
@@ -58,10 +58,6 @@ AnalogBattery::updateBatteryStatusRawADC(hrt_abstime timestamp, int32_t voltage_
|
||||
selected_source, priority, throttle_normalized, armed, _params.source == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the ADC channel for the voltage of this battery is valid.
|
||||
* Corresponds to BOARD_BRICK_VALID_LIST
|
||||
*/
|
||||
bool AnalogBattery::is_valid()
|
||||
{
|
||||
#ifdef BOARD_BRICK_VALID_LIST
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
class AnalogBattery : public Battery
|
||||
{
|
||||
public:
|
||||
AnalogBattery(int index = 1, ModuleParams *parent = nullptr);
|
||||
AnalogBattery(int index, ModuleParams *parent);
|
||||
|
||||
/**
|
||||
* Update current battery status message.
|
||||
|
||||
@@ -238,10 +238,14 @@ private:
|
||||
hrt_abstime _last_sitl_timestamp{0};
|
||||
hrt_abstime _last_battery_timestamp{0};
|
||||
|
||||
class : public Battery
|
||||
class SimulatorBattery : public Battery
|
||||
{
|
||||
public:
|
||||
SimulatorBattery() : Battery(1, nullptr) {}
|
||||
|
||||
virtual void updateParams() override
|
||||
{
|
||||
Battery::updateParams();
|
||||
_params.v_empty = 3.5f;
|
||||
_params.v_charged = 4.05f;
|
||||
_params.n_cells = 4;
|
||||
|
||||
Reference in New Issue
Block a user