From 250bd0670e8cf04093a77e8e0bc51ddd04301456 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 1 Aug 2021 12:05:52 -0700 Subject: [PATCH] unit test vss segfault fix (#3090) * enable feature * dynoview Co-authored-by: Matthew Kennedy --- firmware/controllers/algo/dynoview.cpp | 9 +++++---- unit_tests/efifeatures.h | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/algo/dynoview.cpp b/firmware/controllers/algo/dynoview.cpp index 16d2633931..3d78ab24bc 100644 --- a/firmware/controllers/algo/dynoview.cpp +++ b/firmware/controllers/algo/dynoview.cpp @@ -145,10 +145,11 @@ int getDynoviewPower(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * Only updates if we have Vss from input pin. */ void updateDynoView(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - if (isBrainPinValid(CONFIG(vehicleSpeedSensorInputPin)) && - (!CONFIG(enableCanVss))) { - dynoInstance.update(ICU); - } + if (isBrainPinValid(CONFIG(vehicleSpeedSensorInputPin)) && + (!CONFIG(enableCanVss))) { + INJECT_ENGINE_REFERENCE(&dynoInstance); + dynoInstance.update(ICU); + } } /** diff --git a/unit_tests/efifeatures.h b/unit_tests/efifeatures.h index 1cba07c663..c05fd434d4 100644 --- a/unit_tests/efifeatures.h +++ b/unit_tests/efifeatures.h @@ -13,6 +13,8 @@ #define EFI_EMULATE_POSITION_SENSORS TRUE +#define EFI_VEHICLE_SPEED TRUE + #define EFI_ENGINE_SNIFFER TRUE #define EFI_PRINTF_FUEL_DETAILS TRUE