2022-06-18 06:23:44 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2022-06-23 17:04:26 -07:00
|
|
|
#include "live_data.h"
|
2022-06-18 06:23:44 -07:00
|
|
|
|
2022-06-23 17:04:26 -07:00
|
|
|
#include "tunerstudio.h"
|
|
|
|
#include "wideband_state_generated.h"
|
2022-11-29 13:05:36 -08:00
|
|
|
#include "electronic_throttle_impl.h"
|
2022-07-06 21:35:11 -07:00
|
|
|
#include "knock_controller_generated.h"
|
2024-01-02 18:49:28 -08:00
|
|
|
#include "tcu_controller_generated.h"
|
2022-09-01 16:24:19 -07:00
|
|
|
#include "fuel_computer.h"
|
2022-12-16 17:32:37 -08:00
|
|
|
#include "antilag_system_state_generated.h"
|
2023-07-03 09:33:19 -07:00
|
|
|
#include "vvt_generated.h"
|
2024-05-15 19:25:48 -07:00
|
|
|
#include <livedata_board_extra.h>
|
2022-06-18 06:23:44 -07:00
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const output_channels_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->outputChannels;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const knock_controller_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->module<KnockController>().unmock();
|
|
|
|
}
|
|
|
|
|
2024-01-02 18:49:28 -08:00
|
|
|
template<>
|
|
|
|
const tcu_controller_s* getLiveData(size_t) {
|
|
|
|
#if EFI_TCU
|
2024-05-24 18:06:56 -07:00
|
|
|
GearControllerBase *gearController = engine->gearController;
|
|
|
|
return gearController == nullptr ? nullptr : gearController->transmissionController;
|
2024-01-02 18:49:28 -08:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif // EFI_TCU
|
|
|
|
}
|
|
|
|
|
2022-06-18 06:23:44 -07:00
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const high_pressure_fuel_pump_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
#if EFI_HPFP
|
|
|
|
return &engine->module<HpfpController>().unmock();
|
|
|
|
#else
|
|
|
|
return nullptr; // explicit null to confirm that this struct is handled
|
|
|
|
#endif // EFI_HPFP
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const launch_control_state_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
#if EFI_LAUNCH_CONTROL
|
|
|
|
return &engine->launchController;
|
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-12-16 17:38:13 -08:00
|
|
|
template<>
|
|
|
|
const antilag_system_state_s* getLiveData(size_t) {
|
|
|
|
#if EFI_ANTILAG_SYSTEM
|
2022-12-16 20:31:51 -08:00
|
|
|
return &engine->antilagController;
|
2022-12-16 17:38:13 -08:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-06-18 06:23:44 -07:00
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const injector_model_s* getLiveData(size_t) {
|
2024-01-07 17:41:52 -08:00
|
|
|
return &engine->module<InjectorModelPrimary>().unmock();
|
2022-06-18 06:23:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const boost_control_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
#if EFI_BOOST_CONTROL
|
2023-09-26 10:39:43 -07:00
|
|
|
return &engine->module<BoostController>().unmock();
|
2022-06-18 06:23:44 -07:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const ac_control_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->module<AcController>().unmock();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const fuel_computer_s* getLiveData(size_t) {
|
2023-05-24 16:58:22 -07:00
|
|
|
#if EFI_ENGINE_CONTROL
|
2022-11-26 09:25:04 -08:00
|
|
|
return &engine->fuelComputer;
|
2023-05-24 16:58:22 -07:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2022-09-01 16:24:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const fan_control_s* getLiveData(size_t idx) {
|
2022-06-19 06:52:23 -07:00
|
|
|
switch (idx) {
|
2023-09-26 04:12:11 -07:00
|
|
|
case 0: return &engine->module<FanControl1>().unmock();
|
|
|
|
case 1: return &engine->module<FanControl2>().unmock();
|
2022-06-19 06:52:23 -07:00
|
|
|
default: return nullptr;
|
|
|
|
}
|
2022-06-18 06:23:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const fuel_pump_control_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->module<FuelPumpController>().unmock();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const main_relay_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->module<MainRelayController>().unmock();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const engine_state_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->engineState;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const tps_accel_state_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->tpsAccelEnrichment;
|
|
|
|
}
|
|
|
|
|
2023-02-13 15:10:39 -08:00
|
|
|
template<>
|
|
|
|
const dc_motors_s* getLiveData(size_t) {
|
|
|
|
return &engine->dc_motors;
|
|
|
|
}
|
|
|
|
|
2022-06-18 06:23:44 -07:00
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const trigger_central_s* getLiveData(size_t) {
|
2022-12-17 11:36:27 -08:00
|
|
|
#if EFI_SHAFT_POSITION_INPUT
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->triggerCentral;
|
2022-12-17 11:36:27 -08:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2022-06-18 06:23:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const trigger_state_s* getLiveData(size_t idx) {
|
2022-06-18 06:23:44 -07:00
|
|
|
#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
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:16:29 -07:00
|
|
|
template<>
|
|
|
|
const vvt_s* getLiveData(size_t idx) {
|
|
|
|
#if EFI_VVT_PID
|
|
|
|
switch (idx) {
|
|
|
|
case 0: return &engine->module<VvtController1>().unmock();
|
|
|
|
case 1: return &engine->module<VvtController2>().unmock();
|
|
|
|
case 2: return &engine->module<VvtController3>().unmock();
|
|
|
|
case 3: return &engine->module<VvtController4>().unmock();
|
|
|
|
default: return nullptr;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-08-24 15:11:05 -07:00
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const trigger_state_primary_s* getLiveData(size_t) {
|
2022-08-24 15:11:05 -07:00
|
|
|
#if EFI_SHAFT_POSITION_INPUT
|
|
|
|
return &engine->triggerCentral.triggerState;
|
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2022-06-18 06:23:44 -07:00
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const wall_fuel_state_s* getLiveData(size_t) {
|
2023-05-23 21:03:48 -07:00
|
|
|
#if EFI_ENGINE_CONTROL
|
2023-10-12 20:15:54 -07:00
|
|
|
return &engine->injectionEvents.elements[0].getWallFuel();
|
2023-05-23 21:03:48 -07:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2022-06-18 06:23:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const idle_state_s* getLiveData(size_t) {
|
2022-12-17 15:04:54 -08:00
|
|
|
#if EFI_IDLE_CONTROL
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->module<IdleController>().unmock();
|
2022-12-17 15:04:54 -08:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2022-06-18 06:23:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2022-11-30 16:29:22 -08:00
|
|
|
const ignition_state_s* getLiveData(size_t) {
|
2022-06-18 06:23:44 -07:00
|
|
|
return &engine->ignitionState;
|
|
|
|
}
|
|
|
|
|
2023-02-14 17:39:25 -08:00
|
|
|
template<>
|
|
|
|
const sent_state_s* getLiveData(size_t) {
|
|
|
|
return &engine->sent_state;
|
|
|
|
}
|
|
|
|
|
2023-03-14 20:12:35 -07:00
|
|
|
template<>
|
|
|
|
const throttle_model_s* getLiveData(size_t) {
|
2023-05-24 07:54:14 -07:00
|
|
|
#if EFI_IDLE_CONTROL
|
2023-03-14 20:12:35 -07:00
|
|
|
return &engine->module<ThrottleModel>().unmock();
|
2023-05-24 07:54:14 -07:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2023-03-14 20:12:35 -07:00
|
|
|
}
|
|
|
|
|
2023-07-26 05:58:08 -07:00
|
|
|
template<>
|
|
|
|
const lambda_monitor_s* getLiveData(size_t) {
|
2023-11-05 10:54:06 -08:00
|
|
|
#if EFI_SHAFT_POSITION_INPUT
|
2023-07-26 05:58:08 -07:00
|
|
|
return &engine->lambdaMonitor;
|
2023-11-05 10:54:06 -08:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2023-07-26 05:58:08 -07:00
|
|
|
}
|
|
|
|
|
2022-11-30 16:29:22 -08:00
|
|
|
static const FragmentEntry fragments[] = {
|
|
|
|
// This header is generated - do not edit by hand!
|
|
|
|
#include "live_data_fragments.h"
|
|
|
|
};
|
2022-06-18 06:23:44 -07:00
|
|
|
|
2022-11-26 14:36:27 -08:00
|
|
|
FragmentList getLiveDataFragments() {
|
|
|
|
return { fragments, efi::size(fragments) };
|
|
|
|
}
|