Distinguish iRun<32

as per suggestion from @leptun
pull/246/head
D.R.racer 2022-12-28 10:00:43 +01:00
parent 2f3cef887d
commit 31b36a9a4f
1 changed files with 9 additions and 2 deletions

View File

@ -25,8 +25,15 @@ void MovableBase::PlanHome() {
void MovableBase::SetCurrents(uint8_t iRun, uint8_t iHold) {
hal::tmc2130::MotorCurrents tempCurrent = mm::axisParams[axis].currents;
if (iRun < 32) {
tempCurrent.vSense = 1;
tempCurrent.iRun = iRun;
tempCurrent.iHold = iHold;
} else {
tempCurrent.vSense = 0;
tempCurrent.iRun = iRun >> 1;
tempCurrent.iHold = iHold >> 1;
}
mm::motion.DriverForAxis(axis).SetCurrents(mm::axisParams[axis].params, tempCurrent);
}