Set green LED at start when filament loaded + set Idler as idle at start

pull/148/head
D.R.racer 2021-11-23 08:06:37 +01:00 committed by DRracer
parent e064a6c2f5
commit f2f82c620a
2 changed files with 7 additions and 2 deletions

View File

@ -117,6 +117,11 @@ void setup() {
// Idler and Selector decide whether homing is possible/safe
mi::idler.Init();
ms::selector.Init();
// activate the correct LED if filament is present
if (mg::globals.FilamentLoaded() > mg::FilamentLoadState::AtPulley) {
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
}
}
static constexpr const uint8_t maxMsgLen = 10;

View File

@ -123,8 +123,8 @@ void Idler::Init() {
// home the Idler only in case we don't have filament loaded in the printer (or at least we think we don't)
PlanHome(mm::Idler);
} else {
// otherwise set selector's position according to know slot positions (and pretend it is correct)
mm::motion.SetPosition(mm::Idler, SlotPosition(mg::globals.ActiveSlot()).v);
// otherwise assume the Idler is at its idle position (that's where it usually is)
mm::motion.SetPosition(mm::Idler, SlotPosition(IdleSlotIndex()).v);
InvalidateHoming(); // and plan homing sequence ASAP
}
}