47#if (BOARD_TLE8888_COUNT > 0)
74 case VVT_TOYOTA_3_TOOTH:
78 case VVT_BOSCH_QUICK_START:
80 case VVT_HONDA_K_EXHAUST:
82 case VVT_HONDA_K_INTAKE:
83 case VVT_SINGLE_TOOTH:
88 case VVT_BARRA_3_PLUS_1:
94 case VVT_MAZDA_SKYACTIV:
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:
113 case VVT_MITSUBISHI_4G9x:
115 case VVT_MITSUBISHI_4G63:
120 criticalError(
"Broken VVT mode maybe corrupted calibration %d: %s", vvtMode,
getVvt_mode_e(vvtMode));
128#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
130 chibios_rt::CriticalSectionLocker csl;
146 static Timer canBusWboSetIndex;
147 if (canBusWboSetIndex.getElapsedSeconds() > 1) {
148 canBusWboSetIndex.reset();
154#if EFI_SHAFT_POSITION_INPUT
157 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
178#if (BOARD_TLE8888_COUNT > 0)
201#if EFI_SHAFT_POSITION_INPUT
273#if EFI_LAUNCH_CONTROL
275 , softSparkLimiter(false), hardSparkLimiter(true)
277#if EFI_ANTILAG_SYSTEM
308 module<BoostController>().unmock().resetLua();
313 module<IdleController>().unmock().luaAdd = 0;
331#if EFI_SHAFT_POSITION_INPUT
355 if (wasSynchronized) {
360 if (isDecodingError) {
363 efiPrintf(
"error: synchronizationPoint @ index %lu expected %d/%d got %d/%d",
380#if EFI_SHAFT_POSITION_INPUT
382 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
405 if (mostRecentMs != 0) {
410 mostRecentMs, msNow, gapInMs);
414 mostRecentMs = msNow;
423#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
447#if EFI_ENGINE_CONTROL
451#if EFI_PROD_CODE || EFI_SIMULATOR
452 efiPrintf(
"Engine has stopped spinning.");
460#if EFI_MAIN_RELAY_CONTROL
495#if 0 && EFI_MAIN_RELAY_CONTROL && EFI_PROD_CODE
497 if (stopEngineRequestTimeNt == 0 && ignitionOnTimeNt > 0) {
498 const float vBattThresholdOff = 5.0f;
506 if (stopEngineRequestTimeNt == 0) {
510 const efitick_t turnOffWaitTimeoutNt = NT_PER_SECOND;
513 if ((
getTimeNowNt() - stopEngineRequestTimeNt) < turnOffWaitTimeoutNt)
516 const efitick_t engineSpinningWaitTimeoutNt = 5 * NT_PER_SECOND;
518 if (isSpinning && (
getTimeNowNt() - stopEngineRequestTimeNt) < engineSpinningWaitTimeoutNt)
523 const efitick_t idleMotorWaitTimeoutNt = 10 * NT_PER_SECOND;
531#if EFI_MAIN_RELAY_CONTROL
578#if EFI_SHAFT_POSITION_INPUT
584#if EFI_ENGINE_CONTROL
const char * getVvt_mode_e(vvt_mode_e value)
Non-volatile backup-RAM registers support.
bool isRunningBenchTest()
Utility methods related to bench testing.
Timer timeSinceStateChange
TriggerCentral triggerCentral
bool isFunctionalTestMode
FuelSchedule injectionEvents
IgnitionEventList ignitionEvents
void onEngineHasStopped()
IgnitionState ignitionState
void periodicFastCallback()
type_list< Mockable< InjectorModelPrimary >, Mockable< InjectorModelSecondary >,#if EFI_IDLE_CONTROL Mockable< IdleController >,#endif TriggerScheduler,#if EFI_HPFP &&EFI_ENGINE_CONTROL HpfpController,#endif #if EFI_ENGINE_CONTROL Mockable< ThrottleModel >,#endif #if EFI_ALTERNATOR_CONTROL AlternatorController,#endif FuelPumpController, MainRelayController, Mockable< IgnitionController >, Mockable< AcController >, FanControl1, FanControl2, PrimeController, DfcoController,#if EFI_HD_ACR HarleyAcr,#endif Mockable< WallFuelController >,#if EFI_VEHICLE_SPEED GearDetector, TripOdometer,#endif KnockController, SensorChecker,#if EFI_ENGINE_CONTROL LimpManager,#endif #if EFI_VVT_PID VvtController1, VvtController2, VvtController3, VvtController4,#endif #if EFI_BOOST_CONTROL BoostController,#endif TpsAccelEnrichment,#if EFI_LAUNCH_CONTROL NitrousController,#endif #if EFI_LTFT_CONTROL LongTermFuelTrim,#endif EngineModule > engineModules
int getGlobalConfigurationVersion(void) const
bool slowCallBackWasInvoked
SingleTimerExecutor scheduler
bool isInShutdownMode() const
bool isMainRelayEnabled() const
void periodicSlowCallback()
SwitchedState brakePedalSwitchedState
void OnTriggerStateProperState(efitick_t nowNt) override
RpmCalculator rpmCalculator
void resetEngineSnifferIfInTestMode()
SwitchedState clutchUpSwitchedState
int globalConfigurationVersion
SwitchedState acButtonSwitchedState
void OnTriggerSynchronization(bool wasSynchronized, bool isDecodingError) override
void injectEngineReferences()
TunerStudioOutputChannels outputChannels
void updateTriggerConfiguration()
void updateSwitchInputs()
constexpr auto & module()
void OnTriggerSynchronizationLost() override
RegisteredOutputPin mainRelay
RegisteredOutputPin triggerDecoderErrorPin
RegisteredOutputPin starterRelayDisable
virtual bool isCranking() const =0
void periodicFastCallback()
sensor_chart_e sensorChartMode
bool getLogicValue() const
void setValue(const char *msg, int logicValue, bool isForce=false)
void resetState() override
void setSpinningUp(efitick_t nowNt)
virtual SensorResult get() const =0
static float getOrZero(SensorType type)
bool update(bool newState)
VvtTriggerDecoder vvtState[BANKS_COUNT][CAMS_PER_BANK]
InstantRpmCalculator instantRpm
PrimaryTriggerDecoder triggerState
bool engineMovedRecently(efitick_t nowNt) const
bool isSpinningJustForWatchdog
bool isEngineSnifferEnabled
TriggerWaveform triggerShape
void applyShapesConfiguration()
cyclic_buffer< int > triggerErrorDetection
VvtTriggerConfiguration vvtTriggerConfiguration[CAMS_PER_BANK]
PrimaryTriggerConfiguration primaryTriggerConfiguration
virtual void resetState()
current_cycle_state_s currentCycle
bool someSortOfTriggerError() const
rusEfi console sniffer data buffer
efitick_t pauseEngineSnifferUntilNt
efitimems_t getTimeNowMs()
Returns the 32 bit number of milliseconds since the board initialization.
bool getBrakePedalState()
LimpManager * getLimpManager()
Scheduler * getScheduler()
static void assertTimeIsLinear()
TriggerCentral * getTriggerCentral()
static bool getClutchUpState()
injection_mode_e getCurrentInjectionMode()
FuelSchedule * getFuelSchedule()
trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode)
EngineRotationState * getEngineRotationState()
EngineState * getEngineState()
bool getClutchDownState()
IgnitionEventList * getIgnitionEvents()
TunerStudioOutputChannels * getTunerStudioOutputChannels()
static Engine *const engine
void prepareOutputSignals()
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
rusEfi console wave sniffer
@ TT_VVT_BOSCH_QUICK_START
bool warning(ObdCode code, const char *fmt,...)
void firmwareError(ObdCode code, const char *fmt,...)
Idle Air Control valve hardware.
Idle Valve Control thread.
bool efiReadPin(brain_pin_e pin)
void refreshMapAveragingPreCalc()
@ RUNTIME_CRITICAL_WATCH_DOG_SECONDS
@ CUSTOM_ERR_2ND_WATCHDOG
@ EnginePeriodicSlowCallback
@ EnginePeriodicFastCallback
bool isBrainPinValid(brain_pin_e brainPin)
@ FOUR_STROKE_CRANK_SENSOR
void setWidebandOffset(uint8_t index)
brakePedalState("Brake switch", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1263, 1.0, -1.0, -1.0, "")
acButtonState("AC switch", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1184, 1.0, -1.0, -1.0, "")
clutchUpState("Clutch: up", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1262, 1.0, -1.0, -1.0, "")
void scheduleStopEngine()
bool disableDecelerationFuelCutOff
size_t eventCount[PWM_PHASE_MAX_WAVE_PER_PWM]
vehicle_info_t engineMake
switch_input_pin_e clutchUpPin
bool brakePedalPinInverted
bool suppressWboWorkaround7048
uint16_t sensorSnifferRpmThreshold
bool verboseTriggerSynchDetails
cranking_parameters_s cranking
switch_input_pin_e clutchDownPin
sensor_chart_e sensorChartMode
injection_mode_e crankingInjectionMode
uint16_t engineSnifferRpmThreshold
bool clutchDownPinInverted
switch_input_pin_e brakePedalPin
injection_mode_e injectionMode
bool watchOutForLinearTime
bool heaterControlEnabled
uint16_t engineMakeCodeNameCrc16
void apply_all(func_t const &f)
angle_t getEngineCycle(operation_mode_e operationMode)
void updateVrThresholdPwm()