Fix unit tests
parent
d0ae94d655
commit
4d9d310f00
|
|
@ -161,9 +161,10 @@ void FailedLoadToFindaResolveManual(uint8_t slot, logic::LoadFilament &lf) {
|
||||||
// - basically it will just start homing
|
// - basically it will just start homing
|
||||||
// Moreover, the Idler is to disengage meanwhile, which makes the simulation even harder.
|
// Moreover, the Idler is to disengage meanwhile, which makes the simulation even harder.
|
||||||
// Therefore we just tick the stallguard of the Selector and hope for the best
|
// Therefore we just tick the stallguard of the Selector and hope for the best
|
||||||
mm::TriggerStallGuard(mm::Selector);
|
//
|
||||||
ms::selector.Step();
|
// With the introduction of dual-side homing, the simulation gets even harder,
|
||||||
mm::motion.StallGuardReset(mm::Selector); // drop stallguard on Selector to avoid future confusion
|
// so let's assume the MMU does its job -> prefer simulating selector homing properly and check the machine's state afterwards
|
||||||
|
SimulateSelectorHoming();
|
||||||
|
|
||||||
// just one step is necessary to "finish" homing
|
// just one step is necessary to "finish" homing
|
||||||
// but the selector then (correctly) plans its move to the original position
|
// but the selector then (correctly) plans its move to the original position
|
||||||
|
|
|
||||||
|
|
@ -128,9 +128,10 @@ void SimulateIdlerHoming() {
|
||||||
mm::motion.StallGuardReset(mm::Idler);
|
mm::motion.StallGuardReset(mm::Idler);
|
||||||
|
|
||||||
// now do a correct amount of steps of each axis towards the other end
|
// now do a correct amount of steps of each axis towards the other end
|
||||||
uint32_t idlerSteps = mm::unitToSteps<mm::I_pos_t>(config::idlerLimits.lenght) + 1;
|
uint32_t idlerSteps = mm::unitToSteps<mm::I_pos_t>(config::idlerLimits.lenght);
|
||||||
|
uint32_t maxSteps = idlerSteps + 1;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < idlerSteps; ++i) {
|
for (uint32_t i = 0; i < maxSteps; ++i) {
|
||||||
main_loop();
|
main_loop();
|
||||||
|
|
||||||
if (i == idlerSteps) {
|
if (i == idlerSteps) {
|
||||||
|
|
@ -157,8 +158,9 @@ void SimulateSelectorHoming() {
|
||||||
|
|
||||||
// now do a correct amount of steps of each axis towards the other end
|
// now do a correct amount of steps of each axis towards the other end
|
||||||
uint32_t selectorSteps = mm::unitToSteps<mm::S_pos_t>(config::selectorLimits.lenght) + 1;
|
uint32_t selectorSteps = mm::unitToSteps<mm::S_pos_t>(config::selectorLimits.lenght) + 1;
|
||||||
|
uint32_t maxSteps = selectorSteps + 1;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < selectorSteps; ++i) {
|
for (uint32_t i = 0; i < maxSteps; ++i) {
|
||||||
main_loop();
|
main_loop();
|
||||||
|
|
||||||
if (i == selectorSteps) {
|
if (i == selectorSteps) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue