From e4f8d47423b88096ab58f9bf8a35c945e216c2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Wed, 30 Sep 2020 10:12:44 -0300 Subject: [PATCH] AP_LeakDetector: AP_LeakDetector_Digital: Improve status logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp b/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp index e32da3fde7..5a1674747f 100644 --- a/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp +++ b/libraries/AP_LeakDetector/AP_LeakDetector_Digital.cpp @@ -11,7 +11,7 @@ void AP_LeakDetector_Digital::read() { if (leak_detector._pin[state.instance] >= 0) { hal.gpio->pinMode(leak_detector._pin[state.instance], HAL_GPIO_INPUT); - state.status = hal.gpio->read(leak_detector._pin[state.instance])==leak_detector._default_reading[state.instance]?false:true; + state.status = hal.gpio->read(leak_detector._pin[state.instance]) != leak_detector._default_reading[state.instance]; } else { state.status = false; }