From 13704396bffc3ef2c405234f6904d4612f9503a8 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 26 Nov 2021 21:21:46 -0500 Subject: [PATCH] automation around outputs section #197 --- firmware/console/binary/output_channels.txt | 8 ++++++ .../console/binary/ts_outputs_generated.h | 28 +++++++++++++++++-- firmware/console/binary/tunerstudio_outputs.h | 20 +++---------- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index 378757f2f1..cbf7901b93 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -230,4 +230,12 @@ uint16_t rpmAcceleration;;"",1, 0, 0, 0, 0 uint16_t autoscale accelerationZ;;"",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 uint16_t autoscale accelerationRoll;;"",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 + uint16_t autoscale accelerationYaw;;"",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 + + uint8_t[4] autoscale vvtTargets;;"",1, 0, 0, 0, 0 + uint16_t autoscale turboSpeed;;"",1, 0, 0, 0, 0 + +! we have some unused bytes to allow compatible TS changes + uint8_t[18] autoscale unusedAtTheEnd;;"",1, 0, 0, 0, 0 + end_struct diff --git a/firmware/console/binary/ts_outputs_generated.h b/firmware/console/binary/ts_outputs_generated.h index 680a02c37c..4a11a248a9 100644 --- a/firmware/console/binary/ts_outputs_generated.h +++ b/firmware/console/binary/ts_outputs_generated.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Fri Nov 26 21:09:57 EST 2021 +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Fri Nov 26 21:15:07 EST 2021 // by class com.rusefi.output.CHeaderConsumer // begin #pragma once @@ -594,8 +594,30 @@ struct ts_outputs_s { * offset 310 */ scaled_channel accelerationRoll = (uint16_t)0; - /** total size 312*/ + /** + * offset 312 + */ + scaled_channel accelerationYaw = (uint16_t)0; + /** + * offset 314 + */ + scaled_channel vvtTargets[4]; + /** + * offset 318 + */ + scaled_channel turboSpeed = (uint16_t)0; + /** + * offset 320 + */ + scaled_channel unusedAtTheEnd[18]; + /** + * need 4 byte alignment + units + * offset 338 + */ + uint8_t alignmentFill_at_338[2]; + /** total size 340*/ }; // end -// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Fri Nov 26 21:09:57 EST 2021 +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Fri Nov 26 21:15:07 EST 2021 diff --git a/firmware/console/binary/tunerstudio_outputs.h b/firmware/console/binary/tunerstudio_outputs.h index 14ca9e2267..c7bd0ae943 100644 --- a/firmware/console/binary/tunerstudio_outputs.h +++ b/firmware/console/binary/tunerstudio_outputs.h @@ -32,32 +32,20 @@ enum class TsCalMode : uint8_t { /** * todo https://github.com/rusefi/rusefi/issues/197 - * At the moment rusEFI does NOT have any code generation around TS output channels, three locations have to be changed manually - * 1) this TunerStudioOutputChannels firmware version of the structure + * three locations have to be changed manually + * 1) we inherit from generated ts_outputs_s based on output_channels.txt * 2) '[OutputChannels]' block in rusefi.input * 3) com.rusefi.core.Sensor enum in rusEFI console source code * - * status update: there is progress, a portion of this struct is now generated! we inherit from generated - * ts_outputs_s and eventually the whole thing would be generated - * + * see also [OutputChannels] in rusefi.input + * see also TS_OUTPUT_SIZE in rusefi_config.txt */ struct TunerStudioOutputChannels : ts_outputs_s { - /* see also [OutputChannels] in rusefi.input */ - - scaled_percent accelerationYaw; // 312 - - scaled_channel vvtTargets[4]; // 314 - scaled_channel turboSpeed; // 318 - - uint8_t unusedAtTheEnd[18]; // we have some unused bytes to allow compatible TS changes - // Temporary - will remove soon TsDebugChannels* getDebugChannels() { return reinterpret_cast(&debugFloatField1); } - /* see also [OutputChannels] in rusefi.input */ - /* see also TS_OUTPUT_SIZE in rusefi_config.txt */ }; extern TunerStudioOutputChannels tsOutputChannels;