useFSIO6ForRevLimiter

This commit is contained in:
rusefi 2020-06-01 09:09:55 -04:00
parent 5f14c7993f
commit 0847dc4683
6 changed files with 17 additions and 3 deletions

View File

@ -481,6 +481,13 @@ operation_mode_e Engine::getOperationMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
return doesTriggerImplyOperationMode(engineConfiguration->trigger.type) ? triggerCentral.triggerShape.getOperationMode() : engineConfiguration->ambiguousOperationMode;
}
int Engine::getRpmHardLimit(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (engineConfiguration->useFSIO6ForRevLimiter) {
return fsioState.fsioRpmHardLimit;
}
return CONFIG(rpmHardLimit);
}
/**
* The idea of this method is to execute all heavy calculations in a lower-priority thread,
* so that trigger event handler/IO scheduler tasks are faster.

View File

@ -241,6 +241,7 @@ public:
bool isRunningPwmTest = false;
int getRpmHardLimit(DECLARE_ENGINE_PARAMETER_SIGNATURE);
FsioState fsioState;

View File

@ -87,6 +87,8 @@ public:
float fsioIdleOffset = 0;
float fsioIdleMinValue = 0;
float fsioRpmHardLimit;
#if EFI_UNIT_TEST
float mockFan = 0;
float mockRpm = 0;

View File

@ -516,6 +516,10 @@ void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
updateValueOrWarning(MAGIC_OFFSET_FOR_TIMING_FSIO, "timing", &ENGINE(fsioState.fsioTimingAdjustment) PASS_ENGINE_PARAMETER_SUFFIX);
}
if (engineConfiguration->useFSIO6ForRevLimiter) {
updateValueOrWarning(6 - 1, "rpm limit", &ENGINE(fsioState.fsioRpmHardLimit) PASS_ENGINE_PARAMETER_SUFFIX);
}
if (engineConfiguration->useFSIO8ForServo1) {
useFsioForServo(0 PASS_ENGINE_PARAMETER_SUFFIX);
}

View File

@ -717,6 +717,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20200531;
return 20200601;
}
#endif /* EFI_UNIT_TEST */

View File

@ -391,8 +391,8 @@ static void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEvent
// TODO: add 'pin shutdown' invocation somewhere - coils might be still open here!
return;
}
bool limitedSpark = rpm > CONFIG(rpmHardLimit);
bool limitedFuel = rpm > CONFIG(rpmHardLimit);
bool limitedSpark = rpm > engine->getRpmHardLimit(PASS_ENGINE_PARAMETER_SIGNATURE);
bool limitedFuel = rpm > engine->getRpmHardLimit(PASS_ENGINE_PARAMETER_SIGNATURE);
if (CONFIG(boostCutPressure) != 0) {
if (getMap(PASS_ENGINE_PARAMETER_SIGNATURE) > CONFIG(boostCutPressure)) {