mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 15:33:33 +08:00
Battery: move member initialization values to class declaration
This commit is contained in:
committed by
Lorenz Meier
parent
3917eb2d00
commit
83ac74367c
@@ -53,13 +53,6 @@ Battery::Battery() :
|
|||||||
_low_thr(this, "LOW_THR"),
|
_low_thr(this, "LOW_THR"),
|
||||||
_crit_thr(this, "CRIT_THR"),
|
_crit_thr(this, "CRIT_THR"),
|
||||||
_emergency_thr(this, "EMERGEN_THR"),
|
_emergency_thr(this, "EMERGEN_THR"),
|
||||||
_voltage_filtered_v(-1.f),
|
|
||||||
_current_filtered_a(-1.f),
|
|
||||||
_discharged_mah(0.f),
|
|
||||||
_discharged_mah_loop(0.f),
|
|
||||||
_remaining_voltage(1.f),
|
|
||||||
_remaining(2.f),
|
|
||||||
_scale(1.f),
|
|
||||||
_warning(battery_status_s::BATTERY_WARNING_NONE),
|
_warning(battery_status_s::BATTERY_WARNING_NONE),
|
||||||
_last_timestamp(0)
|
_last_timestamp(0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -113,13 +113,13 @@ private:
|
|||||||
control::BlockParamFloat _crit_thr;
|
control::BlockParamFloat _crit_thr;
|
||||||
control::BlockParamFloat _emergency_thr;
|
control::BlockParamFloat _emergency_thr;
|
||||||
|
|
||||||
float _voltage_filtered_v;
|
float _voltage_filtered_v = -1.f;
|
||||||
float _current_filtered_a;
|
float _current_filtered_a = -1.f;
|
||||||
float _discharged_mah;
|
float _discharged_mah = 0.f;
|
||||||
float _discharged_mah_loop;
|
float _discharged_mah_loop = 0.f;
|
||||||
float _remaining_voltage; ///< normalized battery charge level remaining based on voltage
|
float _remaining_voltage = 1.f; ///< normalized battery charge level remaining based on voltage
|
||||||
float _remaining; ///< normalized battery charge level, selected based on config param
|
float _remaining = 2.f; ///< normalized battery charge level, selected based on config param
|
||||||
float _scale;
|
float _scale = 1.f;
|
||||||
uint8_t _warning;
|
uint8_t _warning;
|
||||||
hrt_abstime _last_timestamp;
|
hrt_abstime _last_timestamp;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user