void setTriggerEmulatorRPM(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { engineConfiguration->bc.triggerSimulatorFrequency = rpm; /** * All we need to do here is to change the periodMs * togglePwmState() would see that the periodMs has changed and act accordingly */ if (rpm == 0) { triggerSignal.setFrequency(NAN); } else { float rpmM = getRpmMultiplier(engineConfiguration->operationMode); float rPerSecond = rpm * rpmM / 60.0; // per minute converted to per second triggerSignal.setFrequency(rPerSecond); } #if EFI_ENGINE_SNIFFER if (engine->isTestMode) waveChart.reset(); #endif /* EFI_ENGINE_SNIFFER */ scheduleMsg(logger, "Emulating position sensor(s). RPM=%d", rpm); }
static void resetNow(void) { skipUntilEngineCycle = engine->rpmCalculator.getRevolutionCounter() + 3; waveChart.reset(); }