rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
engine.cpp File Reference

Detailed Description

This might be a http://en.wikipedia.org/wiki/God_object but that's best way I can express myself in C/C++. I am open for suggestions :)

Date
May 21, 2014
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file engine.cpp.

Functions

trigger_type_e getVvtTriggerType (vvt_mode_e vvtMode)
 
bool getClutchDownState ()
 
static bool getClutchUpState ()
 
bool getBrakePedalState ()
 
static void assertTimeIsLinear ()
 
injection_mode_e getCurrentInjectionMode ()
 
EngineRotationStategetEngineRotationState ()
 
EngineStategetEngineState ()
 
TunerStudioOutputChannelsgetTunerStudioOutputChannels ()
 
SchedulergetScheduler ()
 
TriggerCentralgetTriggerCentral ()
 
LimpManagergetLimpManager ()
 
FuelSchedulegetFuelSchedule ()
 
IgnitionEventListgetIgnitionEvents ()
 

Variables

int waveChartUsedSize
 
WaveChart waveChart
 

Function Documentation

◆ assertTimeIsLinear()

static void assertTimeIsLinear ( )
static

This code asserts that we do not have unexpected gaps in time flow with the exception of internal flash burn.

Definition at line 400 of file engine.cpp.

400 {
401#if ! EFI_UNIT_TEST
402 static efitimems_t mostRecentMs = 0;
403 efitimems_t msNow = getTimeNowMs();
405 if (mostRecentMs != 0) {
406 efitimems_t gapInMs = msNow - mostRecentMs;
407 // todo: lower gapInMs threshold?
408 if (gapInMs > 200) {
409 firmwareError(ObdCode::RUNTIME_CRITICAL_WATCH_DOG_SECONDS, "gap in time: mostRecentMs %lumS, now=%lumS, gap=%lumS",
410 mostRecentMs, msNow, gapInMs);
411 }
412 }
413 }
414 mostRecentMs = msNow;
415#endif
416}
Timer configBurnTimer
Definition engine.h:289
efitimems_t getTimeNowMs()
Returns the 32 bit number of milliseconds since the board initialization.
Definition efitime.cpp:34
static Engine *const engine
Definition engine.h:389
static constexpr engine_configuration_s * engineConfiguration
void firmwareError(ObdCode code, const char *fmt,...)
@ RUNTIME_CRITICAL_WATCH_DOG_SECONDS
uint32_t efitimems_t

Referenced by Engine::efiWatchdog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBrakePedalState()

bool getBrakePedalState ( )

Definition at line 228 of file engine.cpp.

228 {
229#if EFI_GPIO_HARDWARE
232 }
233#endif // EFI_GPIO_HARDWARE
234 // todo: boolean sensors should leverage sensor framework #6342
236}
EngineState engineState
Definition engine.h:325
bool efiReadPin(brain_pin_e pin)
Definition io_pins.cpp:89
bool isBrainPinValid(brain_pin_e brainPin)

Referenced by LaunchControlBase::isInsideSwitchCondition(), and Engine::updateSwitchInputs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClutchDownState()

bool getClutchDownState ( )

Definition at line 208 of file engine.cpp.

208 {
209#if EFI_GPIO_HARDWARE
212 }
213#endif // EFI_GPIO_HARDWARE
214 // todo: boolean sensors should leverage sensor framework #6342
216}

Referenced by LaunchControlBase::isInsideSwitchCondition(), and Engine::updateSwitchInputs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClutchUpState()

static bool getClutchUpState ( )
static

Definition at line 218 of file engine.cpp.

218 {
219#if EFI_GPIO_HARDWARE
222 }
223#endif // EFI_GPIO_HARDWARE
224 // todo: boolean sensors should leverage sensor framework #6342
226}

Referenced by Engine::updateSwitchInputs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentInjectionMode()

injection_mode_e getCurrentInjectionMode ( )

Definition at line 539 of file engine.cpp.

Referenced by getInjectionModeDurationMultiplier(), and InjectionEvent::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEngineRotationState()

EngineRotationState * getEngineRotationState ( )

◆ getEngineState()

EngineState * getEngineState ( )

◆ getFuelSchedule()

FuelSchedule * getFuelSchedule ( )

Definition at line 589 of file engine.cpp.

589 {
590 return &engine->injectionEvents;
591}
FuelSchedule injectionEvents
Definition engine.h:269

Referenced by handleFuel(), and mainTriggerCallback().

Here is the caller graph for this function:

◆ getIgnitionEvents()

IgnitionEventList * getIgnitionEvents ( )

Definition at line 593 of file engine.cpp.

593 {
594 return &engine->ignitionEvents;
595}
IgnitionEventList ignitionEvents
Definition engine.h:270

Referenced by mainTriggerCallback().

Here is the caller graph for this function:

◆ getLimpManager()

LimpManager * getLimpManager ( )

◆ getScheduler()

Scheduler * getScheduler ( )

Definition at line 574 of file engine.cpp.

574 {
575 return &engine->scheduler;
576}
SingleTimerExecutor scheduler
Definition engine.h:252

Referenced by handleShaftSignal(), logVvtFront(), PrimeController::onIgnitionStateChanged(), PrimeController::onPrimeStart(), and InjectionEvent::onTriggerTooth().

Here is the caller graph for this function:

◆ getTriggerCentral()

TriggerCentral * getTriggerCentral ( )

◆ getTunerStudioOutputChannels()

TunerStudioOutputChannels * getTunerStudioOutputChannels ( )

◆ getVvtTriggerType()

trigger_type_e getVvtTriggerType ( vvt_mode_e  vvtMode)

VVT decoding delegates to universal trigger decoder. Here we map vvt_mode_e into corresponding trigger_type_e

Definition at line 70 of file engine.cpp.

70 {
71 switch (vvtMode) {
72 case VVT_INACTIVE:
74 case VVT_TOYOTA_3_TOOTH:
76 case VVT_MIATA_NB:
78 case VVT_BOSCH_QUICK_START:
80 case VVT_HONDA_K_EXHAUST:
82 case VVT_HONDA_K_INTAKE:
83 case VVT_SINGLE_TOOTH:
84 case VVT_MAP_V_TWIN:
86 case VVT_FORD_ST170:
88 case VVT_BARRA_3_PLUS_1:
90 case VVT_FORD_COYOTE:
92 case VVT_DEV:
94 case VVT_MAZDA_SKYACTIV:
96 case VVT_MAZDA_L:
98 case VVT_NISSAN_VQ:
100 case VVT_TOYOTA_4_1:
102 case VVT_MITSUBISHI_4G69:
104 case VVT_MITSUBISHI_3A92:
106 case VVT_MITSUBISHI_6G72:
108 case VVT_HONDA_CBR_600:
110 case VVT_MITSUBISHI_6G75:
111 case VVT_NISSAN_MR:
113 case VVT_MITSUBISHI_4G9x:
115 case VVT_MITSUBISHI_4G63:
117 case VVT_HR12DDR_IN:
119 default:
120 criticalError("Broken VVT mode maybe corrupted calibration %d: %s", vvtMode, getVvt_mode_e(vvtMode));
121 return trigger_type_e::TT_HALF_MOON; // we have to return something for the sake of -Werror=return-type
122 }
123}
const char * getVvt_mode_e(vvt_mode_e value)

Referenced by VvtTriggerConfiguration::getType().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ waveChart

WaveChart waveChart
extern

Definition at line 33 of file trigger_central.cpp.

◆ waveChartUsedSize

int waveChartUsedSize
extern

Definition at line 60 of file engine_sniffer.cpp.

Referenced by WaveChart::publish().

Go to the source code of this file.