From ae4cc77c75f0384fd4187a71889588b4f49d75e1 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 30 Nov 2022 11:23:01 -0500 Subject: [PATCH] ETB fragment is null in fragments #4856 --- firmware/console/binary/live_data.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/firmware/console/binary/live_data.cpp b/firmware/console/binary/live_data.cpp index f80cf4576a..03ac7a36de 100644 --- a/firmware/console/binary/live_data.cpp +++ b/firmware/console/binary/live_data.cpp @@ -140,9 +140,10 @@ const electronic_throttle_s* getLiveDataAddr(size_t) { return etb; } -#if EFI_UNIT_TEST FragmentList getLiveDataFragments() { - // todo: would same runtime be optimized into static during firmware build? + // currently we initialize the array on first invocation + // this is quite a hack in terms of order of execution in real firmware code! + // todo: this still only allows for ONE unit test to work properly?! static FragmentEntry fragments[] = { // This header is generated - do not edit by hand! #include "live_data_fragments.h" @@ -150,15 +151,3 @@ FragmentList getLiveDataFragments() { return { fragments, efi::size(fragments) }; } -#else - -static const FragmentEntry fragments[] = { -// This header is generated - do not edit by hand! -#include "live_data_fragments.h" -}; - -FragmentList getLiveDataFragments() { - return { fragments, efi::size(fragments) }; -} - -#endif