Abort moves when tmc errors happen

pull/212/head
Alex Voinea 2022-10-09 23:32:03 +02:00
parent a5140350a1
commit 801bd65edd
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,7 @@ void MovableBase::PerformMove() {
if (mm::motion.DriverForAxis(axis).CheckForErrors(axisParams[axis].params)) {
// TMC2130 entered some error state, the planned move couldn't have been finished - result of operation is Failed
tmcErrorFlags = mm::motion.DriverForAxis(axis).GetErrorFlags(); // save the failed state
mm::motion.AbortPlannedMoves(axis, true);
state = TMCFailed;
} else if (mm::motion.QueueEmpty(axis)) {
// move finished
@ -91,6 +92,7 @@ void MovableBase::IdleChecks() {
if (mm::motion.DriverForAxis(axis).CheckForErrors(axisParams[axis].params)) {
// TMC2130 entered some error state, the planned move couldn't have been finished - result of operation is Failed
tmcErrorFlags = mm::motion.DriverForAxis(axis).GetErrorFlags(); // save the failed state
mm::motion.AbortPlannedMoves(axis, true);
state = TMCFailed;
}
}