mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-26 02:28:29 -04:00
AP_LeakDetector: Simplify boolean expression
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
parent
d749fce378
commit
4f81aa82e2
@ -14,7 +14,7 @@ void AP_LeakDetector_Analog::read()
|
||||
if (source != NULL && leak_detector._pin[state.instance] >= 0) {
|
||||
source->set_pin(leak_detector._pin[state.instance]);
|
||||
state.status = source->voltage_average() > 2.0f;
|
||||
state.status = state.status==leak_detector._default_reading[state.instance]?false:true;
|
||||
state.status = state.status != leak_detector._default_reading[state.instance];
|
||||
} else {
|
||||
state.status = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user