diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 548a627aba..664821e530 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -690,6 +690,25 @@ void startIdleThread(DECLARE_ENGINE_PARAMETER_SIGNATURE) { DISPLAY_TEXT(Manual_idle_control); /* DISPLAY_ENDIF */ + startPedalPins(PASS_ENGINE_PARAMETER_SIGNATURE); + +#if ! EFI_UNIT_TEST + + addConsoleAction("idleinfo", showIdleInfo); + + addConsoleActionII("blipidle", blipIdle); + + // split this whole file into manual controller and auto controller? move these commands into the file + // which would be dedicated to just auto-controller? + + addConsoleAction("idlebench", startIdleBench); +#endif /* EFI_UNIT_TEST */ + applyPidSettings(PASS_ENGINE_PARAMETER_SIGNATURE); +} + +#endif /* EFI_IDLE_CONTROL */ + +void startPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_PROD_CODE // this is neutral/no gear switch input. on Miata it's wired both to clutch pedal and neutral in gearbox // this switch is not used yet @@ -713,19 +732,13 @@ void startIdleThread(DECLARE_ENGINE_PARAMETER_SIGNATURE) { getInputMode(engineConfiguration->brakePedalPinMode)); } #endif /* EFI_PROD_CODE */ - -#if ! EFI_UNIT_TEST - - addConsoleAction("idleinfo", showIdleInfo); - - addConsoleActionII("blipidle", blipIdle); - - // split this whole file into manual controller and auto controller? move these commands into the file - // which would be dedicated to just auto-controller? - - addConsoleAction("idlebench", startIdleBench); -#endif /* EFI_UNIT_TEST */ - applyPidSettings(PASS_ENGINE_PARAMETER_SIGNATURE); } -#endif /* EFI_IDLE_CONTROL */ +void stopPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + brain_pin_markUsed(CONFIG(clutchUpPin), "clutch" PASS_ENGINE_PARAMETER_SIGNATURE); + brain_pin_markUsed(CONFIG(clutchDownPin), "clutch" PASS_ENGINE_PARAMETER_SIGNATURE); + brain_pin_markUsed(CONFIG(throttlePedalUpPin), "th_pedal" PASS_ENGINE_PARAMETER_SIGNATURE); + brain_pin_markUsed(CONFIG(brakePedalPin), "brake" PASS_ENGINE_PARAMETER_SIGNATURE); + +} + diff --git a/firmware/controllers/actuators/idle_thread.h b/firmware/controllers/actuators/idle_thread.h index 40f3cca0aa..c161122af3 100644 --- a/firmware/controllers/actuators/idle_thread.h +++ b/firmware/controllers/actuators/idle_thread.h @@ -97,3 +97,6 @@ void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfigura float getIdlePidOffset(DECLARE_ENGINE_PARAMETER_SIGNATURE); Pid * getIdlePid(DECLARE_ENGINE_PARAMETER_SIGNATURE); float getIdlePidMinValue(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void startPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void stopPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +