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:
91 case VVT_MAZDA_SKYACTIV:
97 case VVT_MITSUBISHI_4G69:
99 case VVT_MITSUBISHI_3A92:
101 case VVT_MITSUBISHI_6G72:
103 case VVT_HONDA_CBR_600:
105 case VVT_MITSUBISHI_6G75:
108 case VVT_MITSUBISHI_4G9x:
110 case VVT_MITSUBISHI_4G63:
113 criticalError(
"Broken VVT mode maybe corrupted calibration %d: %s", vvtMode,
getVvt_mode_e(vvtMode));
121 #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
123 chibios_rt::CriticalSectionLocker csl;
134 #if ANALOG_HW_CHECK_MODE
136 if (actual < 0.95f * expected || actual > 1.05f * expected) {
137 criticalError(
"%s validation failed actual=%f vs expected=%f", msg, actual, expected);
145 #if EFI_SHAFT_POSITION_INPUT
148 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
169 #if (BOARD_TLE8888_COUNT > 0)
184 #if ANALOG_HW_CHECK_MODE
188 #if ! HW_CHECK_ALWAYS_STIMULATE
189 fail(
"HW_CHECK_ALWAYS_STIMULATE required to have self-stimulation")
192 int hwCheckRpm = 204;
193 if (secondsNow > 2 && secondsNow < 180) {
195 }
else if (!hasFirmwareError() && secondsNow > 180) {
196 static bool isHappyTest =
false;
199 efiPrintf(
"TEST PASSED");
218 #if EFI_SHAFT_POSITION_INPUT
227 #if EFI_GPIO_HARDWARE
246 #if EFI_GPIO_HARDWARE
287 #if EFI_LAUNCH_CONTROL
289 , softSparkLimiter(false), hardSparkLimiter(true)
291 #if EFI_ANTILAG_SYSTEM
319 #if EFI_BOOST_CONTROL
320 module<BoostController>().unmock().resetLua();
325 module<IdleController>().unmock().luaAdd = 0;
345 #if EFI_SHAFT_POSITION_INPUT
369 if (wasSynchronized) {
374 if (isDecodingError) {
377 efiPrintf(
"error: synchronizationPoint @ index %d expected %d/%d got %d/%d",
394 #if EFI_SHAFT_POSITION_INPUT
396 for (
int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
416 if (mostRecentMs != 0) {
421 mostRecentMs, msNow, gapInMs);
425 mostRecentMs = msNow;
433 #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
457 #if EFI_ENGINE_CONTROL
461 #if EFI_PROD_CODE || EFI_SIMULATOR
462 efiPrintf(
"Engine has stopped spinning.");
470 #if EFI_MAIN_RELAY_CONTROL
505 #if 0 && EFI_MAIN_RELAY_CONTROL && EFI_PROD_CODE
507 if (stopEngineRequestTimeNt == 0 && ignitionOnTimeNt > 0) {
508 const float vBattThresholdOff = 5.0f;
516 if (stopEngineRequestTimeNt == 0) {
520 const efitick_t turnOffWaitTimeoutNt = NT_PER_SECOND;
523 if ((
getTimeNowNt() - stopEngineRequestTimeNt) < turnOffWaitTimeoutNt)
526 const efitick_t engineSpinningWaitTimeoutNt = 5 * NT_PER_SECOND;
528 if (isSpinning && (
getTimeNowNt() - stopEngineRequestTimeNt) < engineSpinningWaitTimeoutNt)
533 const efitick_t idleMotorWaitTimeoutNt = 10 * NT_PER_SECOND;
541 #if EFI_MAIN_RELAY_CONTROL
560 #if EFI_MAP_AVERAGING
588 #if EFI_SHAFT_POSITION_INPUT
594 #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()
FuelSchedule * getFuelSchedule()
LimpManager * getLimpManager()
TunerStudioOutputChannels * getTunerStudioOutputChannels()
static void assertTimeIsLinear()
IgnitionEventList * getIgnitionEvents()
static bool getClutchUpState()
static void assertCloseTo(const char *msg, float actual, float expected)
static bool getBrakePedalState()
injection_mode_e getCurrentInjectionMode()
trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode)
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
brakePedalState("Brake switch", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1156, 1.0, -1.0, -1.0, "")
acButtonState("AC switch", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1072, 1.0, -1.0, -1.0, "")
clutchUpState("Clutch: up", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1154, 1.0, -1.0, -1.0, "")
void scheduleStopEngine()
int acSwitchLastChangeTimeMs
size_t eventCount[PWM_PHASE_MAX_WAVE_PER_PWM]
vehicle_info_t engineMake
switch_input_pin_e clutchUpPin
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)