From 3616b41afc46778140a4dc29181c2747584ae037 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Wed, 15 Feb 2023 19:06:54 +0200 Subject: [PATCH] AP_EFI: use is_zero for fuel pressure This is clearer than pragma shenanigans, and makes this consistent with the the newly-added ignition_voltage handling above. --- libraries/AP_EFI/AP_EFI.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/AP_EFI/AP_EFI.cpp b/libraries/AP_EFI/AP_EFI.cpp index f4a29de1d5..5fd3f8a590 100644 --- a/libraries/AP_EFI/AP_EFI.cpp +++ b/libraries/AP_EFI/AP_EFI.cpp @@ -263,12 +263,10 @@ void AP_EFI::send_mavlink_status(mavlink_channel_t chan) // If fuel pressure is supported, but is exactly zero, shift it to 0.0001 // to indicate that it is supported. float fuel_pressure = state.fuel_pressure; - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wfloat-equal" // suppress -Wfloat-equal as we only care about exact zero here - if (fuel_pressure == 0.0 && state.fuel_pressure_status != Fuel_Pressure_Status::NOT_SUPPORTED) { + if (is_zero(fuel_pressure) && state.fuel_pressure_status != Fuel_Pressure_Status::NOT_SUPPORTED) { fuel_pressure = 0.0001; } - #pragma GCC diagnostic pop + mavlink_msg_efi_status_send( chan, AP_EFI::is_healthy(),