43#if (BOARD_TLE8888_COUNT > 0)
64 criticalError(
"Broken VVT mode maybe corrupted calibration %d: %s", vvtMode,
getVvt_mode_e(vvtMode));
79 case VVT_TOYOTA_3_TOOTH:
83 case VVT_BOSCH_QUICK_START:
85 case VVT_HONDA_K_EXHAUST:
87 case VVT_HONDA_K_INTAKE:
88 case VVT_SINGLE_TOOTH:
93 case VVT_BARRA_3_PLUS_1:
99 case VVT_MAZDA_SKYACTIV:
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:
122 case VVT_MITSUBISHI_4G63:
126 case VVT_SUBARU_7TOOTH:
134#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
136 chibios_rt::CriticalSectionLocker csl;
153#if EFI_SHAFT_POSITION_INPUT
156 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
177#if (BOARD_TLE8888_COUNT > 0)
188 if (
getEngineState()->undervoltageCrankingTimer.getElapsedSeconds() > 1) {
217#if EFI_SHAFT_POSITION_INPUT
311 module<BoostController>().unmock().resetLua();
316 module<IdleController>().unmock().luaAdd = 0;
334#if EFI_SHAFT_POSITION_INPUT
364 if (wasSynchronized) {
369 if (isDecodingError) {
372 efiPrintf(
"error: synchronizationPoint @ index %lu expected %d/%d got %d/%d",
389#if EFI_SHAFT_POSITION_INPUT
391 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
414 if (mostRecentMs != 0) {
419 mostRecentMs, msNow, gapInMs);
423 mostRecentMs = msNow;
432#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
456#if EFI_ENGINE_CONTROL
460#if EFI_PROD_CODE || EFI_SIMULATOR
461 efiPrintf(
"Engine has stopped spinning.");
469#if EFI_MAIN_RELAY_CONTROL
504#if 0 && EFI_MAIN_RELAY_CONTROL && EFI_PROD_CODE
506 if (stopEngineRequestTimeNt == 0 && ignitionOnTimeNt > 0) {
507 const float vBattThresholdOff = 5.0f;
515 if (stopEngineRequestTimeNt == 0) {
519 const efitick_t turnOffWaitTimeoutNt = NT_PER_SECOND;
522 if ((
getTimeNowNt() - stopEngineRequestTimeNt) < turnOffWaitTimeoutNt)
525 const efitick_t engineSpinningWaitTimeoutNt = 5 * NT_PER_SECOND;
527 if (isSpinning && (
getTimeNowNt() - stopEngineRequestTimeNt) < engineSpinningWaitTimeoutNt)
532 const efitick_t idleMotorWaitTimeoutNt = 10 * NT_PER_SECOND;
540#if EFI_MAIN_RELAY_CONTROL
566 engineModules.apply_all([](
auto & m) { m.onFastCallback(); });
589#if EFI_SHAFT_POSITION_INPUT
595#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
int getGlobalConfigurationVersion() const
bool isFunctionalTestMode
FuelSchedule injectionEvents
IgnitionEventList ignitionEvents
void onEngineHasStopped()
IgnitionState ignitionState
void periodicFastCallback()
bool slowCallBackWasInvoked
SingleTimerExecutor scheduler
bool isInShutdownMode() const
bool isMainRelayEnabled() const
void periodicSlowCallback()
SwitchedState brakePedalSwitchedState
RpmCalculator rpmCalculator
void resetEngineSnifferIfInTestMode()
TriggerStateListener * nextListener() override
SwitchedState clutchUpSwitchedState
int globalConfigurationVersion
SwitchedState acButtonSwitchedState
void OnTriggerSynchronization(bool wasSynchronized, bool isDecodingError) override
void injectEngineReferences()
TriggerStateListener * secondListener
TunerStudioOutputChannels outputChannels
void updateTriggerConfiguration()
void OnTriggerStateProperState(efitick_t nowNt, size_t triggerStateIndex) override
void updateSwitchInputs()
constexpr auto & module()
void OnTriggerSynchronizationLost() override
type_list< Mockable< InjectorModelPrimary >, Mockable< InjectorModelSecondary >,#if EFI_IDLE_CONTROL Mockable< IdleController >,#endif TriggerScheduler,#if EFI_HPFP &&EFI_ENGINE_CONTROL Mockable< HpfpController >,#endif #if EFI_ENGINE_CONTROL Mockable< ThrottleModel >,#endif #if EFI_ALTERNATOR_CONTROL AlternatorController,#endif MainRelayController, Mockable< IgnitionController >, Mockable< AcController >, PrimeController, DfcoController,#if EFI_HD_ACR HarleyAcr,#endif Mockable< WallFuelController >, KnockController, SensorChecker,#if EFI_ENGINE_CONTROL Mockable< 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 ShortTermFuelTrim,#include "modules_list_generated.h" EngineModule > engineModules
RegisteredOutputPin mainRelay
RegisteredOutputPin triggerDecoderErrorPin
RegisteredOutputPin starterRelayDisable
virtual bool isCranking() const =0
void periodicFastCallback()
Timer undervoltageCrankingTimer
bool getLogicValue() const
void setValue(const char *msg, int logicValue, bool isForce=false)
void resetState() override
void setSpinningUp(efitick_t nowNt)
bool isCranking() const override
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()
PUBLIC_API_WEAK trigger_type_e getCustomVvtTriggerType(vvt_mode_e vvtMode)
static bool getClutchUpState()
injection_mode_e getCurrentInjectionMode()
PUBLIC_API_WEAK void boardPeriodicSlowCallback()
PUBLIC_API_WEAK void boardPeriodicFastCallback()
FuelSchedule * getFuelSchedule()
trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode)
EngineRotationState * getEngineRotationState()
EngineState * getEngineState()
bool getClutchDownState()
IgnitionEventList * getIgnitionEvents()
TunerStudioOutputChannels * getTunerStudioOutputChannels()
static EngineAccessor engine
void prepareOutputSignals()
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
rusEfi console wave sniffer
@ TT_VVT_BOSCH_QUICK_START
@ TT_VVT_SUBARU_7_WITHOUT_6
bool warning(ObdCode code, const char *fmt,...)
void firmwareError(ObdCode code, const char *fmt,...)
bool warningTsReport(ObdCode code, const char *fmt,...)
Idle Air Control valve hardware.
Idle Valve Control thread.
bool efiReadPin(brain_pin_e pin)
UNUSED(samplingTimeSeconds)
@ RUNTIME_CRITICAL_WATCH_DOG_SECONDS
@ CUSTOM_ERR_2ND_WATCHDOG
@ EnginePeriodicSlowCallback
@ EnginePeriodicFastCallback
bool isBrainPinValid(brain_pin_e brainPin)
@ FOUR_STROKE_CRANK_SENSOR
triggerStateIndex("triggerStateIndex", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1584, 1.0, -1.0, -1.0, "")
void doScheduleStopEngine(StopRequestedReason reason)
bool disableDecelerationFuelCutOff
size_t eventCount[PWM_PHASE_MAX_WAVE_PER_PWM]
vehicle_info_t engineMake
pin_input_mode_e clutchDownPinMode
switch_input_pin_e clutchUpPin
bool verboseTriggerSynchDetails
pin_input_mode_e clutchUpPinMode
cranking_parameters_s cranking
switch_input_pin_e clutchDownPin
pin_input_mode_e brakePedalPinMode
injection_mode_e crankingInjectionMode
uint16_t engineSnifferRpmThreshold
switch_input_pin_e brakePedalPin
injection_mode_e injectionMode
bool watchOutForLinearTime
bool heaterControlEnabled
uint16_t engineMakeCodeNameCrc16
angle_t getEngineCycle(operation_mode_e operationMode)
void updateVrThresholdPwm()