clutch input via CAN #3605

This commit is contained in:
rusefillc 2021-12-15 19:20:07 -05:00
parent b3a240f893
commit 31ed18fe84
1 changed files with 4 additions and 0 deletions

View File

@ -313,17 +313,21 @@ void Engine::updateSlowSensors() {
} }
static bool getClutchUpState() { static bool getClutchUpState() {
#if EFI_GPIO_HARDWARE
if (isBrainPinValid(engineConfiguration->clutchUpPin)) { if (isBrainPinValid(engineConfiguration->clutchUpPin)) {
return engineConfiguration->clutchUpPinInverted ^ efiReadPin(engineConfiguration->clutchUpPin); return engineConfiguration->clutchUpPinInverted ^ efiReadPin(engineConfiguration->clutchUpPin);
} }
#endif // EFI_GPIO_HARDWARE
return engine->engineState.luaAdjustments.clutchUpState; return engine->engineState.luaAdjustments.clutchUpState;
} }
static bool getBrakePedalState() { static bool getBrakePedalState() {
#if EFI_GPIO_HARDWARE
if (isBrainPinValid(engineConfiguration->throttlePedalUpPin)) { if (isBrainPinValid(engineConfiguration->throttlePedalUpPin)) {
return efiReadPin(engineConfiguration->brakePedalPin); return efiReadPin(engineConfiguration->brakePedalPin);
} }
return engine->engineState.luaAdjustments.brakePedalState; return engine->engineState.luaAdjustments.brakePedalState;
#endif // EFI_GPIO_HARDWARE
} }
void Engine::updateSwitchInputs() { void Engine::updateSwitchInputs() {