From 4938a6bb4228caf9209a37ae810b52c6108979df Mon Sep 17 00:00:00 2001 From: Valentin Berman Date: Thu, 27 Jun 2024 12:50:06 +0200 Subject: [PATCH] AP_EFI: DroneCAN: set the last_updated_ms field of efi_state The last_update_ms variable was never set in the DroneCAN implementation of the Electronic Fuel Injector sensor. This causes the function bool AP_EFI::is_healthy to always return false. Solved by adding one line of code to set the variable to the correct value. --- libraries/AP_EFI/AP_EFI_DroneCAN.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_EFI/AP_EFI_DroneCAN.cpp b/libraries/AP_EFI/AP_EFI_DroneCAN.cpp index d917cb6599bc9..90f33cac5da8e 100644 --- a/libraries/AP_EFI/AP_EFI_DroneCAN.cpp +++ b/libraries/AP_EFI/AP_EFI_DroneCAN.cpp @@ -151,6 +151,9 @@ void AP_EFI_DroneCAN::handle_status(const uavcan_equipment_ice_reciprocating_Sta c.lambda_coefficient = cs.lambda_coefficient; } + // Required for healthy message + istate.last_updated_ms = AP_HAL::millis(); + copy_to_frontend(); }