Motion: allow to abort movement on a single axis

This can be useful for things like faster homing in the future and comes
at no expense.
pull/119/head
Yuri D'Elia 2021-09-07 10:44:47 +02:00 committed by DRracer
parent a380a698d9
commit d18032b729
2 changed files with 11 additions and 2 deletions

View File

@ -70,9 +70,13 @@ bool Motion::QueueEmpty() const {
return true;
}
void Motion::AbortPlannedMoves(Axis axis, bool halt) {
axisData[axis].ctrl.AbortPlannedMoves(halt);
}
void Motion::AbortPlannedMoves(bool halt) {
for (uint8_t i = 0; i != NUM_AXIS; ++i)
axisData[i].ctrl.AbortPlannedMoves(halt);
AbortPlannedMoves((Axis)i, halt);
}
st_timer_t Motion::Step() {

View File

@ -255,7 +255,12 @@ public:
/// @param axis axis requested
bool Full(Axis axis) const { return axisData[axis].ctrl.Full(); }
/// stop whatever moves are being done
/// Stop whatever moves are being done for one axis
/// @param axis axis requested
/// @param halt When true, also abruptly stop axis movement.
void AbortPlannedMoves(Axis axis, bool halt = true);
/// Stop whatever moves are being done on all axes
/// @param halt When true, also abruptly stop axis movement.
void AbortPlannedMoves(bool halt = true);