diff --git a/firmware/console/binary/live_data.cpp b/firmware/console/binary/live_data.cpp index a7422b918e..cdf0db973e 100644 --- a/firmware/console/binary/live_data.cpp +++ b/firmware/console/binary/live_data.cpp @@ -162,6 +162,11 @@ const sent_state_s* getLiveData(size_t) { return &engine->sent_state; } +template<> +const throttle_model_s* getLiveData(size_t) { + return &engine->module().unmock(); +} + static const FragmentEntry fragments[] = { // This header is generated - do not edit by hand! #include "live_data_fragments.h" diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index f8988553c5..4b97f0ba64 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -48,6 +48,7 @@ #include "sensor_checker.h" #include "fuel_schedule.h" #include "prime_injection.h" +#include "throttle_model.h" #ifndef EFI_UNIT_TEST #error EFI_UNIT_TEST must be defined! @@ -131,6 +132,7 @@ public: #if EFI_HPFP && EFI_ENGINE_CONTROL HpfpController, #endif // EFI_HPFP && EFI_ENGINE_CONTROL + ThrottleModel, #if EFI_ALTERNATOR_CONTROL AlternatorController, #endif /* EFI_ALTERNATOR_CONTROL */ diff --git a/firmware/controllers/math/throttle_model.h b/firmware/controllers/math/throttle_model.h index ef028f728d..b189c1afb3 100644 --- a/firmware/controllers/math/throttle_model.h +++ b/firmware/controllers/math/throttle_model.h @@ -1,6 +1,8 @@ #pragma once -struct ThrottleModelBase { +#include "throttle_model_generated.h" + +struct ThrottleModelBase : public throttle_model_s { public: float estimateThrottleFlow(float tip, float tps, float map, float iat); expected estimateThrottleFlow(float map, float tps); diff --git a/firmware/controllers/math/throttle_model.txt b/firmware/controllers/math/throttle_model.txt new file mode 100644 index 0000000000..d9edd109a2 --- /dev/null +++ b/firmware/controllers/math/throttle_model.txt @@ -0,0 +1,3 @@ +struct_no_prefix throttle_model_s + +end_struct diff --git a/firmware/controllers/math/throttle_model_generated.h b/firmware/controllers/math/throttle_model_generated.h new file mode 100644 index 0000000000..c97a14ff01 --- /dev/null +++ b/firmware/controllers/math/throttle_model_generated.h @@ -0,0 +1,12 @@ +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/math/throttle_model.txt Tue Mar 14 20:09:59 PDT 2023 +// by class com.rusefi.output.CHeaderConsumer +// begin +#pragma once +#include "rusefi_types.h" +// start of throttle_model_s +struct throttle_model_s { +}; +static_assert(sizeof(throttle_model_s) == 0); + +// end +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/math/throttle_model.txt Tue Mar 14 20:09:59 PDT 2023 diff --git a/firmware/integration/LiveData.yaml b/firmware/integration/LiveData.yaml index 475a4db42a..fa49ae5696 100644 --- a/firmware/integration/LiveData.yaml +++ b/firmware/integration/LiveData.yaml @@ -37,6 +37,11 @@ Usages: folder: controllers/engine_cycle output_name: knock + - name: throttle_model + java: ThrottleModel.java + folder: controllers/math + output_name: throttle_model + - name: high_pressure_fuel_pump java: HighPressureFuelPump.java folder: controllers/engine_cycle