#include "pch.h" #include "live_data.h" #include "tunerstudio.h" #include "wideband_state_generated.h" #include "electronic_throttle_impl.h" #include "knock_controller_generated.h" #include "fuel_computer.h" template<> const output_channels_s* getLiveDataAddr() { return &engine->outputChannels; } template<> const knock_controller_s* getLiveDataAddr() { return &engine->module().unmock(); } template<> const high_pressure_fuel_pump_s* getLiveDataAddr() { #if EFI_HPFP return &engine->module().unmock(); #else return nullptr; // explicit null to confirm that this struct is handled #endif // EFI_HPFP } template<> const launch_control_state_s* getLiveDataAddr() { #if EFI_LAUNCH_CONTROL return &engine->launchController; #else return nullptr; #endif } template<> const injector_model_s* getLiveDataAddr() { return &engine->module().unmock(); } template<> const boost_control_s* getLiveDataAddr() { #if EFI_BOOST_CONTROL return &engine->boostController; #else return nullptr; #endif } template<> const ac_control_s* getLiveDataAddr() { return &engine->module().unmock(); } template<> const fuel_computer_s* getLiveDataAddr() { return &engine->fuelComputer; } template<> const fan_control_s* getLiveDataAddr(size_t idx) { switch (idx) { case 0: return &engine->fan1; case 1: return &engine->fan2; default: return nullptr; } } template<> const fuel_pump_control_s* getLiveDataAddr() { return &engine->module().unmock(); } template<> const main_relay_s* getLiveDataAddr() { return &engine->module().unmock(); } template<> const engine_state_s* getLiveDataAddr() { return &engine->engineState; } template<> const tps_accel_state_s* getLiveDataAddr() { return &engine->tpsAccelEnrichment; } template<> const trigger_central_s* getLiveDataAddr() { return &engine->triggerCentral; } template<> const trigger_state_s* getLiveDataAddr(size_t idx) { #if EFI_SHAFT_POSITION_INPUT switch (idx) { case 0: return &engine->triggerCentral.triggerState; case 1: return &engine->triggerCentral.vvtState[0][0]; case 2: return &engine->triggerCentral.vvtState[0][1]; case 3: return &engine->triggerCentral.vvtState[1][0]; case 4: return &engine->triggerCentral.vvtState[1][1]; default: return nullptr; } #else return nullptr; #endif } template<> const trigger_state_primary_s* getLiveDataAddr() { #if EFI_SHAFT_POSITION_INPUT return &engine->triggerCentral.triggerState; #else return nullptr; #endif } template<> const wall_fuel_state_s* getLiveDataAddr() { return &engine->injectionEvents.elements[0].wallFuel; } template<> const idle_state_s* getLiveDataAddr() { return &engine->module().unmock(); } template<> const ignition_state_s* getLiveDataAddr() { return &engine->ignitionState; } template<> const electronic_throttle_s* getLiveDataAddr(size_t) { EtbController *etb = (EtbController *)engine->etbControllers[0]; return etb; } FragmentList getLiveDataFragments() { // 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" }; return { fragments, efi::size(fragments) }; }