Cleanup HoldOn-Resume code in movables
parent
0cef9dabcb
commit
7ab56b9812
|
|
@ -179,15 +179,8 @@ void CommandBase::InvalidateHomingAndFilamentState() {
|
|||
}
|
||||
|
||||
void CommandBase::HoldIdlerSelector() {
|
||||
mm::motion.AbortPlannedMoves(mm::Idler);
|
||||
mi::idler.HoldOn();
|
||||
mm::motion.AbortPlannedMoves(mm::Selector);
|
||||
ms::selector.HoldOn();
|
||||
|
||||
// Force turn off motors - prevent overheating and allow servicing during and error state.
|
||||
// And don't worry about TMC2130 creep after axis enabled - we'll rehome both axes later when needed.
|
||||
mm::motion.Disable(mm::Idler);
|
||||
mm::motion.Disable(mm::Selector);
|
||||
}
|
||||
|
||||
void CommandBase::ResumeIdlerSelector() {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,14 @@ void __attribute__((noinline)) MovableBase::SetCurrents(uint8_t iRun, uint8_t iH
|
|||
mm::motion.DriverForAxis(axis).SetCurrents(mm::axisParams[axis].params, tempCurrent);
|
||||
}
|
||||
|
||||
void MovableBase::HoldOn() {
|
||||
state = OnHold;
|
||||
mm::motion.AbortPlannedMoves(axis);
|
||||
// Force turn off motors - prevent overheating and allow servicing during an error state.
|
||||
// And don't worry about TMC2130 creep after axis enabled - we'll rehome both axes later when needed.
|
||||
mm::motion.Disable(axis);
|
||||
}
|
||||
|
||||
MovableBase::OperationResult MovableBase::InitMovement() {
|
||||
if (motion.InitAxis(axis)) {
|
||||
return InitMovementNoReinitAxis();
|
||||
|
|
|
|||
|
|
@ -75,8 +75,10 @@ public:
|
|||
void SetCurrents(uint8_t iRun, uint8_t iHold);
|
||||
|
||||
/// Puts the movable on-hold
|
||||
void HoldOn() { state = OnHold; }
|
||||
/// Allows the movable to move/home again
|
||||
/// Also, disables the axis
|
||||
void HoldOn();
|
||||
|
||||
/// Allows the movable to move/home again after begin suspended by HoldOn
|
||||
void Resume() { state = Ready; }
|
||||
|
||||
#ifndef UNITTEST
|
||||
|
|
|
|||
Loading…
Reference in New Issue