guards
This commit is contained in:
parent
d6870f47fb
commit
d951f36794
|
@ -101,7 +101,11 @@ const tps_accel_state_s* getLiveData(size_t) {
|
|||
|
||||
template<>
|
||||
const trigger_central_s* getLiveData(size_t) {
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
return &engine->triggerCentral;
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
|
@ -606,10 +606,12 @@ void EtbController::update() {
|
|||
}
|
||||
|
||||
TpsState localReason = TpsState::None;
|
||||
if (engineConfiguration->disableEtbWhenEngineStopped && !engine->triggerCentral.engineMovedRecently()) {
|
||||
localReason = TpsState::EngineStopped;
|
||||
} else if (etbTpsErrorCounter > 50) {
|
||||
if (etbTpsErrorCounter > 50) {
|
||||
localReason = TpsState::IntermittentTps;
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
} else if (engineConfiguration->disableEtbWhenEngineStopped && !engine->triggerCentral.engineMovedRecently()) {
|
||||
localReason = TpsState::EngineStopped;
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
} else if (etbPpsErrorCounter > 50) {
|
||||
localReason = TpsState::IntermittentPps;
|
||||
} else if (engine->engineState.lua.luaDisableEtb) {
|
||||
|
|
|
@ -104,9 +104,11 @@ angle_t getAdvanceCorrections(int rpm) {
|
|||
);
|
||||
}
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
float instantRpm = engine->triggerCentral.instantRpm.getInstantRpm();
|
||||
|
||||
engine->engineState.timingPidCorrection = engine->module<IdleController>()->getIdleTimingAdjustment(instantRpm);
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
#if EFI_TUNER_STUDIO
|
||||
engine->outputChannels.multiSparkCounter = engine->engineState.multispark.count;
|
||||
|
|
|
@ -680,7 +680,7 @@ void configureRusefiLuaHooks(lua_State* l) {
|
|||
});
|
||||
#endif // EFI_LAUNCH_CONTROL
|
||||
|
||||
#if !EFI_UNIT_TEST
|
||||
#if EFI_SHAFT_POSITION_INPUT && !EFI_UNIT_TEST
|
||||
lua_register(l, "selfStimulateRPM", [](lua_State* l) {
|
||||
auto rpm = luaL_checkinteger(l, 1);
|
||||
if (rpm < 1) {
|
||||
|
@ -872,13 +872,13 @@ void configureRusefiLuaHooks(lua_State* l) {
|
|||
doScheduleStopEngine();
|
||||
return 0;
|
||||
});
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
lua_register(l, "getTimeSinceTriggerEventMs", [](lua_State* l) {
|
||||
int result = engine->triggerCentral.m_lastEventTimer.getElapsedUs() / 1000;
|
||||
lua_pushnumber(l, result);
|
||||
return 1;
|
||||
});
|
||||
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
#if EFI_CAN_SUPPORT
|
||||
lua_register(l, "canRxAdd", lua_canRxAdd);
|
||||
|
|
|
@ -410,7 +410,9 @@ void prepareOutputSignals() {
|
|||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
engine->triggerCentral.prepareTriggerShape();
|
||||
#endif // EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
// Fuel schedule may now be completely wrong, force a reset
|
||||
engine->injectionEvents.invalidate();
|
||||
|
|
Loading…
Reference in New Issue