diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 9556f887f4..05612177c2 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -677,6 +677,14 @@ bool isIdleHardwareRestartNeeded() { } +bool isIdleMotorBusy(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + if (!CONFIG(useStepperIdle)) { + // todo: check other motor types? + return false; + } + return iacMotor.isBusy(); +} + void stopIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_PROD_CODE brain_pin_markUnused(activeConfiguration.stepperEnablePin); diff --git a/firmware/controllers/actuators/idle_thread.h b/firmware/controllers/actuators/idle_thread.h index b8a94fa45f..45626ddab0 100644 --- a/firmware/controllers/actuators/idle_thread.h +++ b/firmware/controllers/actuators/idle_thread.h @@ -38,6 +38,7 @@ void setIdleDT(int value); void stopIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE); void initIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE); bool isIdleHardwareRestartNeeded(); +bool isIdleMotorBusy(DECLARE_ENGINE_PARAMETER_SIGNATURE); void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfiguration); float getIdlePidOffset(DECLARE_ENGINE_PARAMETER_SIGNATURE); Pid * getIdlePid(DECLARE_ENGINE_PARAMETER_SIGNATURE);