mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
Battery: address two comments from #2242
- use a constant instead of magic number - fix code comment typo
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user