Make Idler and Selector only wait for their own axis
... and fix the unit tests for thispull/112/head
parent
5571e77809
commit
ffe5bc2807
|
|
@ -51,8 +51,7 @@ bool Idler::Home() {
|
|||
bool Idler::Step() {
|
||||
switch (state) {
|
||||
case Moving:
|
||||
if (mm::motion.QueueEmpty()) { //@@TODO this will block until all axes made their movements,
|
||||
// not sure if that is something we want
|
||||
if (mm::motion.QueueEmpty(mm::Idler)) {
|
||||
// move finished
|
||||
state = Ready;
|
||||
}
|
||||
|
|
@ -71,10 +70,5 @@ bool Idler::Step() {
|
|||
}
|
||||
}
|
||||
|
||||
//hal::tmc2130::MotorParams Idler::TMCDriverParams() const {
|
||||
// return
|
||||
|
||||
//}
|
||||
|
||||
} // namespace idler
|
||||
} // namespace modules
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ bool Motion::QueueEmpty() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Motion::QueueEmpty(config::Axis axis) const {
|
||||
return axisData[axis].ctrl.QueueEmpty();
|
||||
}
|
||||
|
||||
void Motion::AbortPlannedMoves(bool halt) {
|
||||
for (uint8_t i = 0; i != NUM_AXIS; ++i)
|
||||
axisData[i].ctrl.AbortPlannedMoves(halt);
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ public:
|
|||
|
||||
/// @returns true if all planned moves have been finished for one axis
|
||||
/// @param axis requested
|
||||
bool QueueEmpty(Axis axis) const { return axisData[axis].ctrl.QueueEmpty(); }
|
||||
bool QueueEmpty(Axis axis) const;
|
||||
|
||||
/// @returns false if new moves can still be planned for one axis
|
||||
/// @param axis axis requested
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ bool Selector::Home() {
|
|||
bool Selector::Step() {
|
||||
switch (state) {
|
||||
case Moving:
|
||||
if (mm::motion.QueueEmpty()) {
|
||||
if (mm::motion.QueueEmpty(mm::Selector)) {
|
||||
// move finished
|
||||
state = Ready;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@ bool Motion::QueueEmpty() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Motion::QueueEmpty(Axis axis) const {
|
||||
return axes[axis].pos == axes[axis].targetPos;
|
||||
}
|
||||
|
||||
void Motion::AbortPlannedMoves(bool halt) {
|
||||
for (uint8_t i = 0; i < 3; ++i) {
|
||||
axes[i].targetPos = axes[i].pos; // leave the axis where it was at the time of abort
|
||||
|
|
|
|||
Loading…
Reference in New Issue