46 #if (BOARD_TLE8888_COUNT > 0)
50 #if EFI_ENGINE_SNIFFER
57 #if EFI_ENGINE_SNIFFER
73 case VVT_TOYOTA_3_TOOTH:
77 case VVT_BOSCH_QUICK_START:
79 case VVT_HONDA_K_EXHAUST:
81 case VVT_HONDA_K_INTAKE:
82 case VVT_SINGLE_TOOTH:
87 case VVT_BARRA_3_PLUS_1:
93 case VVT_MAZDA_SKYACTIV:
101 case VVT_MITSUBISHI_4G69:
103 case VVT_MITSUBISHI_3A92:
105 case VVT_MITSUBISHI_6G72:
107 case VVT_HONDA_CBR_600:
109 case VVT_MITSUBISHI_6G75:
112 case VVT_MITSUBISHI_4G9x:
114 case VVT_MITSUBISHI_4G63:
117 criticalError(
"Broken VVT mode maybe corrupted calibration %d: %s", vvtMode,
getVvt_mode_e(vvtMode));
125 #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
127 chibios_rt::CriticalSectionLocker csl;
138 #if ANALOG_HW_CHECK_MODE
140 if (actual < 0.95f * expected || actual > 1.05f * expected) {
141 criticalError(
"%s validation failed actual=%f vs expected=%f", msg, actual, expected);
149 #if EFI_SHAFT_POSITION_INPUT
152 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
173 #if (BOARD_TLE8888_COUNT > 0)
188 #if ANALOG_HW_CHECK_MODE
192 #if ! HW_CHECK_ALWAYS_STIMULATE
193 fail(
"HW_CHECK_ALWAYS_STIMULATE required to have self-stimulation")
196 int hwCheckRpm = 204;
197 if (secondsNow > 2 && secondsNow < 180) {
199 }
else if (!hasFirmwareError() && secondsNow > 180) {
200 static bool isHappyTest =
false;
203 efiPrintf(
"TEST PASSED");
222 #if EFI_SHAFT_POSITION_INPUT
232 #if EFI_GPIO_HARDWARE
242 #if EFI_GPIO_HARDWARE
252 #if EFI_GPIO_HARDWARE
267 #if EFI_GPIO_HARDWARE
302 #if EFI_LAUNCH_CONTROL
304 , softSparkLimiter(false), hardSparkLimiter(true)
306 #if EFI_ANTILAG_SYSTEM
336 #if EFI_BOOST_CONTROL
337 module<BoostController>().unmock().resetLua();
342 module<IdleController>().unmock().luaAdd = 0;
362 #if EFI_SHAFT_POSITION_INPUT
386 if (wasSynchronized) {
391 if (isDecodingError) {
394 efiPrintf(
"error: synchronizationPoint @ index %lu expected %d/%d got %d/%d",
411 #if EFI_SHAFT_POSITION_INPUT
413 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
436 if (mostRecentMs != 0) {
441 mostRecentMs, msNow, gapInMs);
445 mostRecentMs = msNow;
453 #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
477 #if EFI_ENGINE_CONTROL
481 #if EFI_PROD_CODE || EFI_SIMULATOR
482 efiPrintf(
"Engine has stopped spinning.");
490 #if EFI_MAIN_RELAY_CONTROL
525 #if 0 && EFI_MAIN_RELAY_CONTROL && EFI_PROD_CODE
527 if (stopEngineRequestTimeNt == 0 && ignitionOnTimeNt > 0) {
528 const float vBattThresholdOff = 5.0f;
536 if (stopEngineRequestTimeNt == 0) {
540 const efitick_t turnOffWaitTimeoutNt = NT_PER_SECOND;
543 if ((
getTimeNowNt() - stopEngineRequestTimeNt) < turnOffWaitTimeoutNt)
546 const efitick_t engineSpinningWaitTimeoutNt = 5 * NT_PER_SECOND;
548 if (isSpinning && (
getTimeNowNt() - stopEngineRequestTimeNt) < engineSpinningWaitTimeoutNt)
553 const efitick_t idleMotorWaitTimeoutNt = 10 * NT_PER_SECOND;
561 #if EFI_MAIN_RELAY_CONTROL
580 #if EFI_MAP_AVERAGING
608 #if EFI_SHAFT_POSITION_INPUT
614 #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.
TriggerCentral triggerCentral
bool isFunctionalTestMode
FuelSchedule injectionEvents
IgnitionEventList ignitionEvents
void onEngineHasStopped()
IgnitionState ignitionState
void periodicFastCallback()
int getGlobalConfigurationVersion(void) const
bool slowCallBackWasInvoked
bool isInShutdownMode() const
bool isMainRelayEnabled() const
void periodicSlowCallback()
SwitchedState brakePedalSwitchedState
void OnTriggerStateProperState(efitick_t nowNt) override
RpmCalculator rpmCalculator
void resetEngineSnifferIfInTestMode()
SwitchedState clutchUpSwitchedState
constexpr auto & module()
SingleTimerExecutor executor
int globalConfigurationVersion
SwitchedState acButtonSwitchedState
void OnTriggerSynchronization(bool wasSynchronized, bool isDecodingError) override
void injectEngineReferences()
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, 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 EngineModule > engineModules
TunerStudioOutputChannels outputChannels
void updateSwitchInputs()
TpsAccelEnrichment tpsAccelEnrichment
void updateTriggerWaveform()
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
virtual float getRaw() const
static float getOrZero(SensorType type)
bool update(bool newState)
void onNewValue(float currentValue)
VvtTriggerDecoder vvtState[BANKS_COUNT][CAMS_PER_BANK]
InstantRpmCalculator instantRpm
PrimaryTriggerDecoder triggerState
bool engineMovedRecently(efitick_t nowNt) const
bool isSpinningJustForWatchdog
bool isEngineSnifferEnabled
TriggerWaveform triggerShape
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
efitimeus_t getTimeNowUs()
efitimesec_t getTimeNowS()
Current system time in seconds (32 bits)
efitimems_t getTimeNowMs()
Returns the 32 bit number of milliseconds since the board initialization.
EngineRotationState * getEngineRotationState()
bool getBrakePedalState()
FuelSchedule * getFuelSchedule()
LimpManager * getLimpManager()
TunerStudioOutputChannels * getTunerStudioOutputChannels()
static void assertTimeIsLinear()
IgnitionEventList * getIgnitionEvents()
static bool getClutchUpState()
static void assertCloseTo(const char *msg, float actual, float expected)
injection_mode_e getCurrentInjectionMode()
trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode)
bool getClutchDownState()
ExecutorInterface * getExecutorInterface()
EngineState * getEngineState()
TriggerCentral * getTriggerCentral()
void prepareOutputSignals()
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()
@ CUSTOM_ERR_2ND_WATCHDOG
@ EnginePeriodicSlowCallback
@ EnginePeriodicFastCallback
persistent_config_s * config
engine_configuration_s * engineConfiguration
bool isBrainPinValid(brain_pin_e brainPin)
@ FOUR_STROKE_CRANK_SENSOR
acButtonState("AC switch", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1080, 1.0, -1.0, -1.0, "")
brakePedalState("Brake switch", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1164, 1.0, -1.0, -1.0, "")
clutchUpState("Clutch: up", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1162, 1.0, -1.0, -1.0, "")
void scheduleStopEngine()
bool disableDecelerationFuelCutOff
int acSwitchLastChangeTimeMs
size_t eventCount[PWM_PHASE_MAX_WAVE_PER_PWM]
vehicle_info_t engineMake
switch_input_pin_e clutchUpPin
bool brakePedalPinInverted
uint16_t sensorSnifferRpmThreshold
bool verboseTriggerSynchDetails
cranking_parameters_s cranking
switch_input_pin_e clutchDownPin
switch_input_pin_e throttlePedalUpPin
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
warning_message_t warning_message
void apply_all(func_t const &f)
fail("EFI_SHAFT_POSITION_INPUT required to have EFI_EMULATE_POSITION_SENSORS") static_assert(sizeof(composite_logger_s)
void setTriggerEmulatorRPM(int rpm)
angle_t getEngineCycle(operation_mode_e operationMode)
static void updateVrThresholdPwm(int rpm, size_t index)