From 2baae2adc0a44510044cf3d145759877785b5f53 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Tue, 23 Aug 2022 22:25:08 -0400 Subject: [PATCH] docs --- firmware/console/binary/output_channels.txt | 7 +++++++ firmware/console/status_loop.cpp | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index a1bc674a88..16e86b628e 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -1,5 +1,12 @@ ! units,scale,offset,min,max,digits +! +! this https://en.wikipedia.org/wiki/God_object is DEPRECATED +! the dream is to move many or most of the state out into smaller structures/classes +! See also LiveData.yaml +! + + struct_no_prefix output_channels_s bit sd_present diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 603cb52cf8..05b4f81794 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -689,8 +689,10 @@ static void updateFlags() { engine->outputChannels.isFanOn = enginePins.fanRelay.getLogicValue(); engine->outputChannels.isFan2On = enginePins.fanRelay2.getLogicValue(); engine->outputChannels.isO2HeaterOn = enginePins.o2heater.getLogicValue(); + // todo: eliminate state copy logic by giving limpManager it's owm limp_manager.txt and leveraging LiveData engine->outputChannels.isIgnitionEnabledIndicator = engine->limpManager.allowIgnition().value; engine->outputChannels.isInjectionEnabledIndicator = engine->limpManager.allowInjection().value; + // todo: eliminate state copy logic by giving DfcoController it's owm xxx.txt and leveraging LiveData engine->outputChannels.dfcoActive = engine->module()->cutFuel(); #if EFI_LAUNCH_CONTROL @@ -714,6 +716,8 @@ static void updateTpsDebug() { } // sensor state for EFI Analytics Tuner Studio +// todo: the 'let's copy internal state for external consumers' approach is DEPRECATED +// As of 2022 it's preferred to leverage LiveData where all state is exposed void updateTunerStudioState() { TunerStudioOutputChannels *tsOutputChannels = &engine->outputChannels; #if EFI_SHAFT_POSITION_INPUT