forked from Archive/PX4-Autopilot
Battery: address two comments from #2242
- use a constant instead of magic number - fix code comment typo
This commit is contained in:
parent
edb6c635d5
commit
6f4d903f45
|
@ -118,8 +118,8 @@ void Battery::updateBatteryStatus(const hrt_abstime ×tamp)
|
|||
_current_filter_a.reset(_current_a);
|
||||
}
|
||||
|
||||
// Require minimum voltage toherwise override connected status
|
||||
if (_voltage_filter_v.getState() < 2.1f) {
|
||||
// Require minimum voltage otherwise override connected status
|
||||
if (_voltage_filter_v.getState() < LITHIUM_BATTERY_RECOGNITION_VOLTAGE) {
|
||||
_connected = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,6 +110,8 @@ public:
|
|||
void updateAndPublishBatteryStatus(const hrt_abstime ×tamp);
|
||||
|
||||
protected:
|
||||
static constexpr float LITHIUM_BATTERY_RECOGNITION_VOLTAGE = 2.1f;
|
||||
|
||||
struct {
|
||||
param_t v_empty;
|
||||
param_t v_charged;
|
||||
|
|
Loading…
Reference in New Issue