Cleanup HoldOn-Resume code in movables
parent
0cef9dabcb
commit
7ab56b9812
|
|
@ -179,15 +179,8 @@ void CommandBase::InvalidateHomingAndFilamentState() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandBase::HoldIdlerSelector() {
|
void CommandBase::HoldIdlerSelector() {
|
||||||
mm::motion.AbortPlannedMoves(mm::Idler);
|
|
||||||
mi::idler.HoldOn();
|
mi::idler.HoldOn();
|
||||||
mm::motion.AbortPlannedMoves(mm::Selector);
|
|
||||||
ms::selector.HoldOn();
|
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() {
|
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);
|
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() {
|
MovableBase::OperationResult MovableBase::InitMovement() {
|
||||||
if (motion.InitAxis(axis)) {
|
if (motion.InitAxis(axis)) {
|
||||||
return InitMovementNoReinitAxis();
|
return InitMovementNoReinitAxis();
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,10 @@ public:
|
||||||
void SetCurrents(uint8_t iRun, uint8_t iHold);
|
void SetCurrents(uint8_t iRun, uint8_t iHold);
|
||||||
|
|
||||||
/// Puts the movable on-hold
|
/// Puts the movable on-hold
|
||||||
void HoldOn() { state = OnHold; }
|
/// Also, disables the axis
|
||||||
/// Allows the movable to move/home again
|
void HoldOn();
|
||||||
|
|
||||||
|
/// Allows the movable to move/home again after begin suspended by HoldOn
|
||||||
void Resume() { state = Ready; }
|
void Resume() { state = Ready; }
|
||||||
|
|
||||||
#ifndef UNITTEST
|
#ifndef UNITTEST
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue