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

PUBLIC_API_WEAK trigger_type_e getCustomVvtTriggerType (vvt_mode_e vvtMode)
 
trigger_type_e getVvtTriggerType (vvt_mode_e vvtMode)
 
PUBLIC_API_WEAK void boardPeriodicSlowCallback ()
 
PUBLIC_API_WEAK void boardPeriodicFastCallback ()
 
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 409 of file engine.cpp.

409 {
410#if ! EFI_UNIT_TEST
411 static efitimems_t mostRecentMs = 0;
412 efitimems_t msNow = getTimeNowMs();
414 if (mostRecentMs != 0) {
415 efitimems_t gapInMs = msNow - mostRecentMs;
416 // todo: lower gapInMs threshold?
417 if (gapInMs > 200) {
418 firmwareError(ObdCode::RUNTIME_CRITICAL_WATCH_DOG_SECONDS, "gap in time: mostRecentMs %lumS, now=%lumS, gap=%lumS",
419 mostRecentMs, msNow, gapInMs);
420 }
421 }
422 }
423 mostRecentMs = msNow;
424#endif
425}
Timer configBurnTimer
Definition engine.h:308
efitimems_t getTimeNowMs()
Returns the 32 bit number of milliseconds since the board initialization.
Definition efitime.cpp:34
static EngineAccessor engine
Definition engine.h:413
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:

◆ boardPeriodicFastCallback()

PUBLIC_API_WEAK void boardPeriodicFastCallback ( )

Definition at line 148 of file engine.cpp.

148{ }

Referenced by Engine::periodicFastCallback().

Here is the caller graph for this function:

◆ boardPeriodicSlowCallback()

PUBLIC_API_WEAK void boardPeriodicSlowCallback ( )

Definition at line 146 of file engine.cpp.

146{ }

Referenced by Engine::periodicSlowCallback().

Here is the caller graph for this function:

◆ getBrakePedalState()

bool getBrakePedalState ( )

Definition at line 243 of file engine.cpp.

243 {
244#if EFI_GPIO_HARDWARE
247 }
248#endif // EFI_GPIO_HARDWARE
249 // todo: boolean sensors should leverage sensor framework #6342
251}
EngineState engineState
Definition engine.h:344
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 223 of file engine.cpp.

223 {
224#if EFI_GPIO_HARDWARE
227 }
228#endif // EFI_GPIO_HARDWARE
229 // todo: boolean sensors should leverage sensor framework #6342
231}

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 233 of file engine.cpp.

233 {
234#if EFI_GPIO_HARDWARE
237 }
238#endif // EFI_GPIO_HARDWARE
239 // todo: boolean sensors should leverage sensor framework #6342
241}

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 548 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:

◆ getCustomVvtTriggerType()

PUBLIC_API_WEAK trigger_type_e getCustomVvtTriggerType ( vvt_mode_e  vvtMode)

Definition at line 63 of file engine.cpp.

63 {
64 criticalError("Broken VVT mode maybe corrupted calibration %d: %s", vvtMode, getVvt_mode_e(vvtMode));
65 return trigger_type_e::TT_HALF_MOON; // we have to return something for the sake of -Werror=return-type
66}
const char * getVvt_mode_e(vvt_mode_e value)

Referenced by getVvtTriggerType().

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 600 of file engine.cpp.

600 {
601 return &engine->injectionEvents;
602}
FuelSchedule injectionEvents
Definition engine.h:288

Referenced by handleFuel(), and mainTriggerCallback().

Here is the caller graph for this function:

◆ getIgnitionEvents()

IgnitionEventList * getIgnitionEvents ( )

Definition at line 604 of file engine.cpp.

604 {
605 return &engine->ignitionEvents;
606}
IgnitionEventList ignitionEvents
Definition engine.h:289

Referenced by mainTriggerCallback().

Here is the caller graph for this function:

◆ getLimpManager()

LimpManager * getLimpManager ( )

◆ getScheduler()

Scheduler * getScheduler ( )

Definition at line 585 of file engine.cpp.

585 {
586 return &engine->scheduler;
587}
SingleTimerExecutor scheduler
Definition engine.h:271

Referenced by 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 72 of file engine.cpp.

72 {
73 switch (vvtMode) {
74 case VVT_CUSTOM_1:
75 case VVT_CUSTOM_2:
76 case VVT_INACTIVE:
77 // hold on, what? 'VVT_INACTIVE' means TT_HALF_MOON?!
79 case VVT_TOYOTA_3_TOOTH:
81 case VVT_MIATA_NB:
83 case VVT_BOSCH_QUICK_START:
85 case VVT_HONDA_K_EXHAUST:
87 case VVT_HONDA_K_INTAKE:
88 case VVT_SINGLE_TOOTH:
89 case VVT_MAP_V_TWIN:
91 case VVT_FORD_ST170:
93 case VVT_BARRA_3_PLUS_1:
95 case VVT_FORD_COYOTE:
97 case VVT_DEV:
99 case VVT_MAZDA_SKYACTIV:
101 case VVT_MAZDA_L:
103 case VVT_NISSAN_VQ:
105 case VVT_TOYOTA_4_1:
107 case VVT_MITSUBISHI_4G69:
109 case VVT_MITSUBISHI_3A92:
111 case VVT_MITSUBISHI_6G72:
113 case VVT_HONDA_CBR_600:
115 case VVT_CHRYSLER_PHASER:
117 case VVT_TOYOTA_3TOOTH_UZ:
119 case VVT_NISSAN_MR:
121 case VVT_UNUSED_17:
122 case VVT_MITSUBISHI_4G63:
124 case VVT_HR12DDR_IN:
126 case VVT_SUBARU_7TOOTH:
128 default:
129 return getCustomVvtTriggerType(vvtMode);
130 }
131}
PUBLIC_API_WEAK trigger_type_e getCustomVvtTriggerType(vvt_mode_e vvtMode)
Definition engine.cpp:63

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 32 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.