mirror of https://github.com/rusefi/rusefi-1.git
move swtiches out of idle (#2148)
This commit is contained in:
parent
8def663025
commit
898b7a82e0
|
@ -471,32 +471,6 @@ static percent_t automaticIdleController(float tpsPos, float rpm, int targetRpm
|
||||||
wasResetPid = true;
|
wasResetPid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if EFI_GPIO_HARDWARE
|
|
||||||
// this value is not used yet
|
|
||||||
if (CONFIG(clutchDownPin) != GPIO_UNASSIGNED) {
|
|
||||||
engine->clutchDownState = efiReadPin(CONFIG(clutchDownPin));
|
|
||||||
}
|
|
||||||
if (hasAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
|
||||||
bool result = getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
if (engine->acSwitchState != result) {
|
|
||||||
engine->acSwitchState = result;
|
|
||||||
engine->acSwitchLastChangeTime = getTimeNowUs();
|
|
||||||
}
|
|
||||||
engine->acSwitchState = result;
|
|
||||||
}
|
|
||||||
if (CONFIG(clutchUpPin) != GPIO_UNASSIGNED) {
|
|
||||||
engine->clutchUpState = efiReadPin(CONFIG(clutchUpPin));
|
|
||||||
}
|
|
||||||
if (CONFIG(throttlePedalUpPin) != GPIO_UNASSIGNED) {
|
|
||||||
engine->engineState.idle.throttlePedalUpState = efiReadPin(CONFIG(throttlePedalUpPin));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (engineConfiguration->brakePedalPin != GPIO_UNASSIGNED) {
|
|
||||||
engine->brakePedalState = efiReadPin(engineConfiguration->brakePedalPin);
|
|
||||||
}
|
|
||||||
#endif /* EFI_GPIO_HARDWARE */
|
|
||||||
|
|
||||||
finishIdleTestIfNeeded();
|
finishIdleTestIfNeeded();
|
||||||
undoIdleBlipIfNeeded();
|
undoIdleBlipIfNeeded();
|
||||||
|
|
||||||
|
|
|
@ -246,6 +246,8 @@ extern float vBattForTle8888;
|
||||||
* See also periodicFastCallback
|
* See also periodicFastCallback
|
||||||
*/
|
*/
|
||||||
void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
updateSwitchInputs(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
int rpm = GET_RPM();
|
int rpm = GET_RPM();
|
||||||
isEngineChartEnabled = CONFIG(isEngineChartEnabled) && rpm < CONFIG(engineSnifferRpmThreshold);
|
isEngineChartEnabled = CONFIG(isEngineChartEnabled) && rpm < CONFIG(engineSnifferRpmThreshold);
|
||||||
|
@ -273,6 +275,33 @@ void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Engine::updateSwitchInputs(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
#if EFI_GPIO_HARDWARE
|
||||||
|
// this value is not used yet
|
||||||
|
if (CONFIG(clutchDownPin) != GPIO_UNASSIGNED) {
|
||||||
|
engine->clutchDownState = efiReadPin(CONFIG(clutchDownPin));
|
||||||
|
}
|
||||||
|
if (hasAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||||
|
bool result = getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
if (engine->acSwitchState != result) {
|
||||||
|
engine->acSwitchState = result;
|
||||||
|
engine->acSwitchLastChangeTime = getTimeNowUs();
|
||||||
|
}
|
||||||
|
engine->acSwitchState = result;
|
||||||
|
}
|
||||||
|
if (CONFIG(clutchUpPin) != GPIO_UNASSIGNED) {
|
||||||
|
engine->clutchUpState = efiReadPin(CONFIG(clutchUpPin));
|
||||||
|
}
|
||||||
|
if (CONFIG(throttlePedalUpPin) != GPIO_UNASSIGNED) {
|
||||||
|
engine->engineState.idle.throttlePedalUpState = efiReadPin(CONFIG(throttlePedalUpPin));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (engineConfiguration->brakePedalPin != GPIO_UNASSIGNED) {
|
||||||
|
engine->brakePedalState = efiReadPin(engineConfiguration->brakePedalPin);
|
||||||
|
}
|
||||||
|
#endif // EFI_GPIO_HARDWARE
|
||||||
|
}
|
||||||
|
|
||||||
void Engine::onTriggerSignalEvent(efitick_t nowNt) {
|
void Engine::onTriggerSignalEvent(efitick_t nowNt) {
|
||||||
isSpinning = true;
|
isSpinning = true;
|
||||||
lastTriggerToothEventTimeNt = nowNt;
|
lastTriggerToothEventTimeNt = nowNt;
|
||||||
|
|
|
@ -252,6 +252,7 @@ public:
|
||||||
void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
void updateSwitchInputs(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
void initializeTriggerWaveform(Logging *logger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void initializeTriggerWaveform(Logging *logger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
bool clutchUpState = false;
|
bool clutchUpState = false;
|
||||||
|
|
Loading…
Reference in New Issue