motion: Remove motion.ResetAxesData
Use motion.SetPosition directly to minimize redundant code which is used for unit tests only.pull/153/head
parent
2e32204d17
commit
cabf284882
|
|
@ -288,12 +288,6 @@ public:
|
||||||
bool QueueEmpty(Axis axis) const {
|
bool QueueEmpty(Axis axis) const {
|
||||||
return axisData[axis].ctrl.QueueEmpty();
|
return axisData[axis].ctrl.QueueEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetAxesData() {
|
|
||||||
for (uint8_t i = 0; i != NUM_AXIS; ++i) {
|
|
||||||
axisData[i].ctrl.SetPosition(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
// Force STUB for testing
|
// Force STUB for testing
|
||||||
bool QueueEmpty(Axis axis) const;
|
bool QueueEmpty(Axis axis) const;
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,14 @@ ssize_t stepUntilDone(size_t maxSteps = 100000) {
|
||||||
void ResetMotionSim() {
|
void ResetMotionSim() {
|
||||||
stepUntilDone();
|
stepUntilDone();
|
||||||
REQUIRE(motion.QueueEmpty());
|
REQUIRE(motion.QueueEmpty());
|
||||||
motion.ResetAxesData();
|
|
||||||
|
motion.SetPosition(Idler, 0);
|
||||||
REQUIRE(motion.Position(Idler) == 0);
|
REQUIRE(motion.Position(Idler) == 0);
|
||||||
|
|
||||||
|
motion.SetPosition(Selector, 0);
|
||||||
REQUIRE(motion.Position(Selector) == 0);
|
REQUIRE(motion.Position(Selector) == 0);
|
||||||
|
|
||||||
|
motion.SetPosition(Pulley, 0);
|
||||||
REQUIRE(motion.Position(Pulley) == 0);
|
REQUIRE(motion.Position(Pulley) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue