From 19ff65a4add88e09821a963f41dfe6e6633d0aa8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 13 Jan 2022 09:02:37 +1100 Subject: [PATCH] AP_EFI: make C_TO_KELVIN a function macro; create KELVIN_TO_C --- libraries/AP_EFI/AP_EFI_NWPMU.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_EFI/AP_EFI_NWPMU.cpp b/libraries/AP_EFI/AP_EFI_NWPMU.cpp index 1f5e543ee9..00bc9d33d3 100644 --- a/libraries/AP_EFI/AP_EFI_NWPMU.cpp +++ b/libraries/AP_EFI/AP_EFI_NWPMU.cpp @@ -90,8 +90,8 @@ void AP_EFI_NWPMU::handle_frame(AP_HAL::CANFrame &frame) internal_state.cylinder_status[0].cylinder_head_temperature = C_TO_KELVIN(data.coolant_temp * 0.1f); break; case NWPMU_TEMPERATURE_TYPE::F: - internal_state.coolant_temperature = C_TO_KELVIN(((data.coolant_temp * 0.1f) - 32 * 5/9)); - internal_state.cylinder_status[0].cylinder_head_temperature = C_TO_KELVIN(((data.coolant_temp * 0.1f) - 32 * 5/9)); + internal_state.coolant_temperature = F_TO_KELVIN(data.coolant_temp * 0.1f); + internal_state.cylinder_status[0].cylinder_head_temperature = F_TO_KELVIN(data.coolant_temp * 0.1f); break; default: break;