diff --git a/tests/unit/logic/load_filament/test_load_filament.cpp b/tests/unit/logic/load_filament/test_load_filament.cpp index 939abf9..a21a3c5 100644 --- a/tests/unit/logic/load_filament/test_load_filament.cpp +++ b/tests/unit/logic/load_filament/test_load_filament.cpp @@ -161,9 +161,10 @@ void FailedLoadToFindaResolveManual(uint8_t slot, logic::LoadFilament &lf) { // - basically it will just start homing // 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 - mm::TriggerStallGuard(mm::Selector); - ms::selector.Step(); - mm::motion.StallGuardReset(mm::Selector); // drop stallguard on Selector to avoid future confusion + // + // With the introduction of dual-side homing, the simulation gets even harder, + // 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 // but the selector then (correctly) plans its move to the original position diff --git a/tests/unit/logic/stubs/main_loop_stub.cpp b/tests/unit/logic/stubs/main_loop_stub.cpp index d331531..c4009ac 100644 --- a/tests/unit/logic/stubs/main_loop_stub.cpp +++ b/tests/unit/logic/stubs/main_loop_stub.cpp @@ -128,9 +128,10 @@ void SimulateIdlerHoming() { mm::motion.StallGuardReset(mm::Idler); // now do a correct amount of steps of each axis towards the other end - uint32_t idlerSteps = mm::unitToSteps(config::idlerLimits.lenght) + 1; + uint32_t idlerSteps = mm::unitToSteps(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(); if (i == idlerSteps) { @@ -157,8 +158,9 @@ void SimulateSelectorHoming() { // now do a correct amount of steps of each axis towards the other end uint32_t selectorSteps = mm::unitToSteps(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(); if (i == selectorSteps) {