rusEFI
The most advanced open source ECU
engine.cpp
Go to the documentation of this file.
1 /**
2  * @file engine.cpp
3  *
4  *
5  * This might be a http://en.wikipedia.org/wiki/God_object but that's best way I can
6  * express myself in C/C++. I am open for suggestions :)
7  *
8  * @date May 21, 2014
9  * @author Andrey Belomutskiy, (c) 2012-2020
10  */
11 
12 #include "pch.h"
13 
14 #include "trigger_central.h"
15 #include "fuel_math.h"
16 #include "advance_map.h"
17 #include "speed_density.h"
18 #include "advance_map.h"
19 #include "init.h"
20 
21 #include "aux_valves.h"
22 #include "map_averaging.h"
23 #include "perf_trace.h"
24 #include "backup_ram.h"
25 #include "idle_thread.h"
26 #include "idle_hardware.h"
27 #include "gppwm.h"
28 #include "tachometer.h"
29 #include "speedometer.h"
30 #include "dynoview.h"
31 #include "boost_control.h"
32 #include "fan_control.h"
33 #include "ac_control.h"
34 #include "vr_pwm.h"
35 #include "max3185x.h"
36 #if EFI_MC33816
37  #include "mc33816.h"
38 #endif // EFI_MC33816
39 
40 #include "bench_test.h"
41 
42 #if EFI_PROD_CODE
43 #include "trigger_emulator_algo.h"
44 #endif /* EFI_PROD_CODE */
45 
46 #if (BOARD_TLE8888_COUNT > 0)
47 #include "gpio/tle8888.h"
48 #endif
49 
50 #if EFI_ENGINE_SNIFFER
51 #include "engine_sniffer.h"
52 extern int waveChartUsedSize;
53 extern WaveChart waveChart;
54 #endif /* EFI_ENGINE_SNIFFER */
55 
57 #if EFI_ENGINE_SNIFFER
59  // TODO: what is the exact reasoning for the exact engine sniffer pause time I wonder
61  waveChart.reset();
62  }
63 #endif /* EFI_ENGINE_SNIFFER */
64 }
65 
66 /**
67  * VVT decoding delegates to universal trigger decoder. Here we map vvt_mode_e into corresponding trigger_type_e
68  */
70  switch (vvtMode) {
71  case VVT_INACTIVE:
73  case VVT_TOYOTA_3_TOOTH:
75  case VVT_MIATA_NB:
77  case VVT_BOSCH_QUICK_START:
79  case VVT_HONDA_K_EXHAUST:
81  case VVT_HONDA_K_INTAKE:
82  case VVT_SINGLE_TOOTH:
83  case VVT_MAP_V_TWIN:
85  case VVT_FORD_ST170:
87  case VVT_BARRA_3_PLUS_1:
89  case VVT_FORD_COYOTE:
91  case VVT_MAZDA_SKYACTIV:
93  case VVT_NISSAN_VQ:
95  case VVT_TOYOTA_4_1:
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:
106  case VVT_NISSAN_MR:
108  case VVT_MITSUBISHI_4G9x:
110  case VVT_MITSUBISHI_4G63:
112  default:
113  criticalError("Broken VVT mode maybe corrupted calibration %d: %s", vvtMode, getVvt_mode_e(vvtMode));
114  return trigger_type_e::TT_HALF_MOON; // we have to return something for the sake of -Werror=return-type
115  }
116 }
117 
119 
120 
121 #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
122  // we have a confusing threading model so some synchronization would not hurt
123  chibios_rt::CriticalSectionLocker csl;
124 
126 
127 
130  }
131 #endif /* EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT */
132 }
133 
134 #if ANALOG_HW_CHECK_MODE
135 static void assertCloseTo(const char* msg, float actual, float expected) {
136  if (actual < 0.95f * expected || actual > 1.05f * expected) {
137  criticalError("%s validation failed actual=%f vs expected=%f", msg, actual, expected);
138  }
139 }
140 #endif // ANALOG_HW_CHECK_MODE
141 
144 
145 #if EFI_SHAFT_POSITION_INPUT
146  // Re-read config in case it's changed
148  for (int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
150  }
151 
153  enginePins.o2heater.setValue(getEngineState()->heaterControlEnabled);
155 #endif // EFI_SHAFT_POSITION_INPUT
156 
157  efiWatchdog();
159  checkShutdown();
160 
162 
164 
165  updateGppwm();
166 
167  engine->engineModules.apply_all([](auto & m) { m.onSlowCallback(); });
168 
169 #if (BOARD_TLE8888_COUNT > 0)
170  tle8888startup();
171 #endif
172 
173 #if EFI_DYNO_VIEW
174  updateDynoView();
175 #endif
176 
177  slowCallBackWasInvoked = true;
178 
179 #if EFI_PROD_CODE
180  void baroLps25Update();
181  baroLps25Update();
182 #endif // EFI_PROD_CODE
183 
184 #if ANALOG_HW_CHECK_MODE
185  criticalAssertVoid(isAdcChannelValid(engineConfiguration->clt.adcChannel), "No CLT setting");
186  efitimesec_t secondsNow = getTimeNowS();
187 
188 #if ! HW_CHECK_ALWAYS_STIMULATE
189  fail("HW_CHECK_ALWAYS_STIMULATE required to have self-stimulation")
190 #endif
191 
192  int hwCheckRpm = 204;
193  if (secondsNow > 2 && secondsNow < 180) {
194  assertCloseTo("RPM", Sensor::get(SensorType::Rpm).Value, hwCheckRpm);
195  } else if (!hasFirmwareError() && secondsNow > 180) {
196  static bool isHappyTest = false;
197  if (!isHappyTest) {
198  setTriggerEmulatorRPM(5 * hwCheckRpm);
199  efiPrintf("TEST PASSED");
200  isHappyTest = true;
201  }
202  }
203 
208 #endif // ANALOG_HW_CHECK_MODE
209 }
210 
211 /**
212  * We are executing these heavy (logarithm) methods from outside the trigger callbacks for performance reasons.
213  * See also periodicFastCallback
214  */
217 
218 #if EFI_SHAFT_POSITION_INPUT
222 
224 #endif // EFI_SHAFT_POSITION_INPUT
225 }
226 
227 #if EFI_GPIO_HARDWARE
228 static bool getClutchUpState() {
231  }
232  // todo: boolean sensors should leverage sensor framework #6342
234 }
235 
236 static bool getBrakePedalState() {
239  }
240  // todo: boolean sensors should leverage sensor framework #6342
242 }
243 #endif // EFI_GPIO_HARDWARE
244 
246 #if EFI_GPIO_HARDWARE
247  // this value is not used yet
250  }
251  {
252  bool currentState;
253  if (hasAcToggle()) {
254  currentState = getAcToggle();
255 #ifdef EFI_KLINE
256  } else if (engineConfiguration->hondaK) {
257 extern bool kAcRequestState;
258  currentState = kAcRequestState;
259 #endif // EFI_KLINE
260  } else {
261  currentState = engine->engineState.lua.acRequestState;
262  }
263  AcController & acController = engine->module<AcController>().unmock();
264  if (engine->acButtonSwitchedState.update(currentState)) {
265  acController.acSwitchLastChangeTimeMs = US2MS(getTimeNowUs());
266  }
267  }
269 
270 #if EFI_IDLE_CONTROL
273  }
274 #endif // EFI_IDLE_CONTROL
275 
277  pokeAuxDigital();
278 
279 #endif // EFI_GPIO_HARDWARE
280 }
281 
283  : clutchUpSwitchedState(&engineState.clutchUpState),
284  brakePedalSwitchedState(&engineState.brakePedalState),
285  acButtonSwitchedState(&module<AcController>().unmock().acButtonState)
286 
287 #if EFI_LAUNCH_CONTROL
288 
289  , softSparkLimiter(false), hardSparkLimiter(true)
290 
291 #if EFI_ANTILAG_SYSTEM
292 // , ALSsoftSparkLimiter(false)
293 #endif /* EFI_ANTILAG_SYSTEM */
294 
295 #endif // EFI_LAUNCH_CONTROL
296 {
297  reset();
298 }
299 
302 }
303 
305  /**
306  * it's important for wrapAngle() that engineCycle field never has zero
307  */
309  resetLua();
310 }
311 
313  // todo: https://github.com/rusefi/rusefi/issues/4308
314  engineState.lua = {};
315  engineState.lua.fuelAdd = 0;
317  engineState.lua.luaDisableEtb = false;
318  engineState.lua.luaIgnCut = false;
319 #if EFI_BOOST_CONTROL
320  module<BoostController>().unmock().resetLua();
321 #endif // EFI_BOOST_CONTROL
324 #if EFI_IDLE_CONTROL
325  module<IdleController>().unmock().luaAdd = 0;
326 #endif // EFI_IDLE_CONTROL
327 }
328 
329 /**
330  * Here we have a bunch of stuff which should invoked after configuration change
331  * so that we can prepare some helper structures
332  */
334 #if EFI_TUNER_STUDIO
335  // we take 2 bytes of crc32, no idea if it's right to call it crc16 or not
336  // we have a hack here - we rely on the fact that engineMake is the first of three relevant fields
338 
339  // we need and can empty warning message for CRC purposes
340  memset(config->warning_message, 0, sizeof(config->warning_message));
342 #endif /* EFI_TUNER_STUDIO */
343 }
344 
345 #if EFI_SHAFT_POSITION_INPUT
346 void Engine::OnTriggerStateProperState(efitick_t nowNt) {
348 }
349 
351  // Needed for early instant-RPM detection
353 
356 
357  for (size_t i = 0; i < efi::size(triggerCentral.vvtState); i++) {
358  for (size_t j = 0; j < efi::size(triggerCentral.vvtState[0]); j++) {
360  }
361  }
362 }
363 
364 void Engine::OnTriggerSynchronization(bool wasSynchronized, bool isDecodingError) {
365  // TODO: this logic probably shouldn't be part of engine.cpp
366 
367  // We only care about trigger shape once we have synchronized trigger. Anything could happen
368  // during first revolution and it's fine
369  if (wasSynchronized) {
370  enginePins.triggerDecoderErrorPin.setValue(isDecodingError);
371 
372  // 'triggerStateListener is not null' means we are running a real engine and now just preparing trigger shape
373  // that's a bit of a hack, a sweet OOP solution would be a real callback or at least 'needDecodingErrorLogic' method?
374  if (isDecodingError) {
375 #if EFI_PROD_CODE
377  efiPrintf("error: synchronizationPoint @ index %d expected %d/%d got %d/%d",
383  }
384 #endif /* EFI_PROD_CODE */
385  }
386 
387  engine->triggerCentral.triggerErrorDetection.add(isDecodingError);
388  }
389 
390 }
391 #endif
392 
394 #if EFI_SHAFT_POSITION_INPUT
396  for (int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
398  }
399 #endif // EFI_SHAFT_POSITION_INPUT
400 }
401 
403  efi::clear(config);
404 
406 }
407 
408 /**
409  * This code asserts that we do not have unexpected gaps in time flow with the exception of internal flash burn.
410  */
411 static void assertTimeIsLinear() {
412  static efitimems_t mostRecentMs = 0;
413  efitimems_t msNow = getTimeNowMs();
415 
416  if (mostRecentMs != 0) {
417  efitimems_t gapInMs = msNow - mostRecentMs;
418  // todo: lower gapInMs threshold?
419  if (gapInMs > 200) {
420  firmwareError(ObdCode::WATCH_DOG_SECONDS, "gap in time: mostRecentMs %dmS, now=%dmS, gap=%dmS",
421  mostRecentMs, msNow, gapInMs);
422  }
423  }
424  }
425  mostRecentMs = msNow;
426 }
427 
430  if (isRunningPwmTest)
431  return;
432 
433 #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
434  if (module<PrimeController>()->isPriming() || triggerCentral.engineMovedRecently()) {
435  // do not invoke check in priming or if engine moved recently, no need to assert safe pin state.
436  return;
437  }
438 
440  if (!isRunningBenchTest() && enginePins.stopPins()) {
441  // todo: make this a firmwareError assuming functional tests would run
442  warning(ObdCode::CUSTOM_ERR_2ND_WATCHDOG, "Some pins were turned off by 2nd pass watchdog");
443  }
444  return;
445  }
446 
447  /**
448  * todo: better watch dog implementation should be implemented - see
449  * http://sourceforge.net/p/rusefi/tickets/96/
450  */
453 #endif // EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
454 }
455 
457 #if EFI_ENGINE_CONTROL
458  ignitionEvents.isReady = false;
459 #endif // EFI_ENGINE_CONTROL
460 
461 #if EFI_PROD_CODE || EFI_SIMULATOR
462  efiPrintf("Engine has stopped spinning.");
463 #endif
464 
465  // this invocation should be the last layer of defence in terms of making sure injectors/coils are not active
467 }
468 
470 #if EFI_MAIN_RELAY_CONTROL
471  // if we are already in the "ignition_on" mode, then do nothing
472 /* this logic is not alive
473  if (ignitionOnTimeNt > 0) {
474  return;
475  }
476 todo: move to shutdown_controller.cpp
477 */
478 
479  // here we are in the shutdown (the ignition is off) or initial mode (after the firmware fresh start)
480 /* this needs work or tests
481  const efitick_t engineStopWaitTimeoutUs = 500000LL; // 0.5 sec
482  // in shutdown mode, we need a small cooldown time between the ignition off and on
483 todo: move to shutdown_controller.cpp
484  if (stopEngineRequestTimeNt == 0 || (getTimeNowNt() - stopEngineRequestTimeNt) > US2NT(engineStopWaitTimeoutUs)) {
485  // if the ignition key is turned on again,
486  // we cancel the shutdown mode, but only if all shutdown procedures are complete
487  const float vBattThresholdOn = 8.0f;
488  // we fallback into zero instead of VBAT_FALLBACK_VALUE because it's not safe to false-trigger the "ignition on" event,
489  // and we want to turn on the main relay only when 100% sure.
490  if ((Sensor::getOrZero(SensorType::BatteryVoltage) > vBattThresholdOn) && !isInShutdownMode()) {
491  ignitionOnTimeNt = getTimeNowNt();
492  efiPrintf("Ignition voltage detected!");
493  if (stopEngineRequestTimeNt != 0) {
494  efiPrintf("Cancel the engine shutdown!");
495  stopEngineRequestTimeNt = 0;
496  }
497  }
498  }
499 */
500 #endif /* EFI_MAIN_RELAY_CONTROL */
501 }
502 
504  // TODO: this logic is currently broken
505 #if 0 && EFI_MAIN_RELAY_CONTROL && EFI_PROD_CODE
506  // if we are in "ignition_on" mode and not in shutdown mode
507  if (stopEngineRequestTimeNt == 0 && ignitionOnTimeNt > 0) {
508  const float vBattThresholdOff = 5.0f;
509  // start the shutdown process if the ignition voltage dropped low
510  if (Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) <= vBattThresholdOff) {
512  }
513  }
514 
515  // we are not in the shutdown mode?
516  if (stopEngineRequestTimeNt == 0) {
517  return false;
518  }
519 
520  const efitick_t turnOffWaitTimeoutNt = NT_PER_SECOND;
521  // We don't want any transients to step in, so we wait at least 1 second whatever happens.
522  // Also it's good to give the stepper motor some time to start moving to the initial position (or parking)
523  if ((getTimeNowNt() - stopEngineRequestTimeNt) < turnOffWaitTimeoutNt)
524  return true;
525 
526  const efitick_t engineSpinningWaitTimeoutNt = 5 * NT_PER_SECOND;
527  // The engine is still spinning! Give it some time to stop (but wait no more than 5 secs)
528  if (isSpinning && (getTimeNowNt() - stopEngineRequestTimeNt) < engineSpinningWaitTimeoutNt)
529  return true;
530 
531  // The idle motor valve is still moving! Give it some time to park (but wait no more than 10 secs)
532  // Usually it can move to the initial 'cranking' position or zero 'parking' position.
533  const efitick_t idleMotorWaitTimeoutNt = 10 * NT_PER_SECOND;
534  if (isIdleMotorBusy() && (getTimeNowNt() - stopEngineRequestTimeNt) < idleMotorWaitTimeoutNt)
535  return true;
536 #endif /* EFI_MAIN_RELAY_CONTROL */
537  return false;
538 }
539 
541 #if EFI_MAIN_RELAY_CONTROL
543 #else
544  // if no main relay control, we assume it's always turned on
545  return true;
546 #endif /* EFI_MAIN_RELAY_CONTROL */
547 }
548 
551 }
552 
553 /**
554  * The idea of this method is to execute all heavy calculations in a lower-priority thread,
555  * so that trigger event handler/IO scheduler tasks are faster.
556  */
559 
560 #if EFI_MAP_AVERAGING
562 #endif
563 
565 
566  tachUpdate();
567  speedoUpdate();
568 
569  engine->engineModules.apply_all([](auto & m) { m.onFastCallback(); });
570 }
571 
573  return &engine->rpmCalculator;
574 }
575 
577  return &engine->engineState;
578 }
579 
581  return &engine->outputChannels;
582 }
583 
585  return &engine->executor;
586 }
587 
588 #if EFI_SHAFT_POSITION_INPUT
590  return &engine->triggerCentral;
591 }
592 #endif // EFI_SHAFT_POSITION_INPUT
593 
594 #if EFI_ENGINE_CONTROL
596  return &engine->module<LimpManager>().unmock();
597 }
598 
600  return &engine->injectionEvents;
601 }
602 
604  return &engine->ignitionEvents;
605 }
606 #endif // EFI_ENGINE_CONTROL
bool isAdcChannelValid(adc_channel_e hwChannel)
Definition: adc_inputs.h:20
bool getAcToggle()
Definition: allsensors.cpp:19
bool hasAcToggle()
Definition: allsensors.cpp:23
const char * getVvt_mode_e(vvt_mode_e value)
Non-volatile backup-RAM registers support.
bool isRunningBenchTest()
Definition: bench_test.cpp:28
Utility methods related to bench testing.
TriggerCentral triggerCentral
Definition: engine.h:286
void resetLua()
Definition: engine.cpp:312
void updateSlowSensors()
Definition: engine.cpp:215
bool isFunctionalTestMode
Definition: engine.h:311
FuelSchedule injectionEvents
Definition: engine.h:258
IgnitionEventList ignitionEvents
Definition: engine.h:259
void onEngineHasStopped()
Definition: engine.cpp:456
IgnitionState ignitionState
Definition: engine.h:210
void periodicFastCallback()
Definition: engine.cpp:557
void checkShutdown()
Definition: engine.cpp:469
void preCalculate()
Definition: engine.cpp:333
int getGlobalConfigurationVersion(void) const
Definition: engine.cpp:300
bool slowCallBackWasInvoked
Definition: engine.h:271
bool isInShutdownMode() const
Definition: engine.cpp:503
void efiWatchdog()
Definition: engine.cpp:428
bool isMainRelayEnabled() const
Definition: engine.cpp:540
EngineState engineState
Definition: engine.h:315
void periodicSlowCallback()
Definition: engine.cpp:142
SwitchedState brakePedalSwitchedState
Definition: engine.h:187
void OnTriggerStateProperState(efitick_t nowNt) override
Definition: engine.cpp:346
RpmCalculator rpmCalculator
Definition: engine.h:273
void resetEngineSnifferIfInTestMode()
Definition: engine.cpp:56
SwitchedState clutchUpSwitchedState
Definition: engine.h:186
Engine()
Definition: engine.cpp:282
constexpr auto & module()
Definition: engine.h:177
SingleTimerExecutor executor
Definition: engine.h:241
int globalConfigurationVersion
Definition: engine.h:281
SwitchedState acButtonSwitchedState
Definition: engine.h:188
void setConfig()
Definition: engine.cpp:402
void OnTriggerSynchronization(bool wasSynchronized, bool isDecodingError) override
Definition: engine.cpp:364
void injectEngineReferences()
Definition: engine.cpp:393
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
Definition: engine.h:171
TunerStudioOutputChannels outputChannels
Definition: engine.h:99
void updateSwitchInputs()
Definition: engine.cpp:245
void reset()
Definition: engine.cpp:304
TpsAccelEnrichment tpsAccelEnrichment
Definition: engine.h:283
void updateTriggerWaveform()
Definition: engine.cpp:118
void OnTriggerSynchronizationLost() override
Definition: engine.cpp:350
Timer configBurnTimer
Definition: engine.h:275
bool isRunningPwmTest
Definition: engine.h:305
RegisteredOutputPin mainRelay
Definition: efi_gpio.h:73
OutputPin o2heater
Definition: efi_gpio.h:94
RegisteredOutputPin triggerDecoderErrorPin
Definition: efi_gpio.h:116
RegisteredOutputPin starterRelayDisable
Definition: efi_gpio.h:81
bool stopPins()
Definition: efi_gpio.cpp:215
virtual bool isCranking() const =0
angle_t engineCycle
Definition: engine_state.h:27
void updateSlowSensors()
Definition: engine2.cpp:88
void periodicFastCallback()
Definition: engine2.cpp:100
sensor_chart_e sensorChartMode
Definition: engine_state.h:32
bool getLogicValue() const
Definition: efi_gpio.cpp:646
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition: efi_gpio.cpp:583
void resetState() override
void setSpinningUp(efitick_t nowNt)
bool isRunning() const
virtual SensorResult get() const =0
virtual float getRaw() const
Definition: sensor.h:162
static float getOrZero(SensorType type)
Definition: sensor.h:92
bool update(bool newState)
Definition: efi_output.cpp:10
void onNewValue(float currentValue)
VvtTriggerDecoder vvtState[BANKS_COUNT][CAMS_PER_BANK]
InstantRpmCalculator instantRpm
PrimaryTriggerDecoder triggerState
bool engineMovedRecently(efitick_t nowNt) const
bool isSpinningJustForWatchdog
TriggerWaveform triggerShape
cyclic_buffer< int > triggerErrorDetection
VvtTriggerConfiguration vvtTriggerConfiguration[CAMS_PER_BANK]
PrimaryTriggerConfiguration primaryTriggerConfiguration
virtual void resetState()
current_cycle_state_s currentCycle
bool someSortOfTriggerError() const
size_t getExpectedEventCount(TriggerWheel channelIndex) const
rusEfi console sniffer data buffer
efitick_t pauseEngineSnifferUntilNt
void updateDynoView()
Definition: dynoview.cpp:146
EnginePins enginePins
Definition: efi_gpio.cpp:24
efitick_t getTimeNowNt()
Definition: efitime.cpp:19
efitimeus_t getTimeNowUs()
Definition: efitime.cpp:26
efitimesec_t getTimeNowS()
Current system time in seconds (32 bits)
Definition: efitime.cpp:42
efitimems_t getTimeNowMs()
Returns the 32 bit number of milliseconds since the board initialization.
Definition: efitime.cpp:34
int waveChartUsedSize
EngineRotationState * getEngineRotationState()
Definition: engine.cpp:572
FuelSchedule * getFuelSchedule()
Definition: engine.cpp:599
LimpManager * getLimpManager()
Definition: engine.cpp:595
TunerStudioOutputChannels * getTunerStudioOutputChannels()
Definition: engine.cpp:580
static void assertTimeIsLinear()
Definition: engine.cpp:411
IgnitionEventList * getIgnitionEvents()
Definition: engine.cpp:603
static bool getClutchUpState()
Definition: engine.cpp:228
static void assertCloseTo(const char *msg, float actual, float expected)
Definition: engine.cpp:135
static bool getBrakePedalState()
Definition: engine.cpp:236
injection_mode_e getCurrentInjectionMode()
Definition: engine.cpp:549
trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode)
Definition: engine.cpp:69
ExecutorInterface * getExecutorInterface()
Definition: engine.cpp:584
EngineState * getEngineState()
Definition: engine.cpp:576
TriggerCentral * getTriggerCentral()
Definition: engine.cpp:589
WaveChart waveChart
void prepareOutputSignals()
Engine * engine
rusEfi console wave sniffer
trigger_type_e
Definition: engine_types.h:286
bool warning(ObdCode code, const char *fmt,...)
void firmwareError(ObdCode code, const char *fmt,...)
void updateGppwm()
Definition: gppwm.cpp:58
Idle Air Control valve hardware.
bool isIdleMotorBusy()
Idle Valve Control thread.
void pokeAuxDigital()
void baroLps25Update()
Definition: init_baro.cpp:19
bool efiReadPin(brain_pin_e pin)
Definition: io_pins.cpp:89
bool kAcRequestState
Definition: kline.cpp:26
void refreshMapAveragingPreCalc()
@ CUSTOM_ERR_2ND_WATCHDOG
@ WATCH_DOG_SECONDS
@ EnginePeriodicSlowCallback
@ EnginePeriodicFastCallback
persistent_config_s * config
engine_configuration_s * engineConfiguration
bool isBrainPinValid(brain_pin_e brainPin)
vvt_mode_e
Definition: rusefi_enums.h:120
@ FOUR_STROKE_CRANK_SENSOR
Definition: rusefi_enums.h:254
injection_mode_e
Definition: rusefi_enums.h:331
uint32_t efitimems_t
Definition: rusefi_types.h:43
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()
Definition: settings.cpp:649
void tle8888startup()
Definition: smart_gpio.cpp:308
void speedoUpdate()
Definition: speedometer.cpp:9
size_t eventCount[PWM_PHASE_MAX_WAVE_PER_PWM]
void apply_all(func_t const &f)
Definition: type_list.h:43
void tachUpdate()
Definition: tachometer.cpp:31
composite packet size
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)
Definition: vr_pwm.cpp:13