Optimization - save 30B

pull/256/head
D.R.racer 2022-12-29 07:50:51 +01:00 committed by DRracer
parent 0bca66aeb5
commit 425f89c862
1 changed files with 3 additions and 2 deletions

View File

@ -53,10 +53,11 @@ bool Idler::FinishHomingAndPlanMoveToParkPos() {
void Idler::FinishMove() { void Idler::FinishMove() {
currentlyEngaged = plannedMove; currentlyEngaged = plannedMove;
hal::tmc2130::MotorCurrents c = mm::motion.CurrentsForAxis(axis);
if (Disengaged()) // reduce power into the Idler motor when disengaged (less force necessary) if (Disengaged()) // reduce power into the Idler motor when disengaged (less force necessary)
SetCurrents(mm::motion.CurrentsForAxis(axis).iRun, mm::motion.CurrentsForAxis(axis).iHold); SetCurrents(c.iRun, c.iHold);
else if (Engaged()) { // maximum motor power when the idler is engaged else if (Engaged()) { // maximum motor power when the idler is engaged
SetCurrents(mm::motion.CurrentsForAxis(axis).iRun, mm::motion.CurrentsForAxis(axis).iRun); SetCurrents(c.iRun, c.iRun);
} }
} }