Remove redundant ::Color and ::Mode for LED colors and modes
makes the code shorter and more readable, no identifier clashes revealedpull/126/head
parent
53b329941f
commit
5eedeb0968
|
|
@ -20,7 +20,7 @@ void FeedToBondtech::Reset(uint8_t maxRetries) {
|
|||
#endif //DEBUG_LOGIC
|
||||
state = EngagingIdler;
|
||||
this->maxRetries = maxRetries;
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::Color::green, ml::Mode::blink0);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0);
|
||||
mi::idler.Engage(mg::globals.ActiveSlot());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace logic {
|
|||
void FeedToFinda::Reset(bool feedPhaseLimited) {
|
||||
state = EngagingIdler;
|
||||
this->feedPhaseLimited = feedPhaseLimited;
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::Color::green, ml::Mode::blink0);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0);
|
||||
mi::idler.Engage(mg::globals.ActiveSlot());
|
||||
// We can't get any FINDA readings if the selector is at the wrong spot - move it accordingly if necessary
|
||||
ms::selector.MoveToSlot(mg::globals.ActiveSlot());
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ void UnloadFilament::Reset(uint8_t /*param*/) {
|
|||
state = ProgressCode::UnloadingToFinda;
|
||||
error = ErrorCode::RUNNING;
|
||||
unl.Reset(maxRetries);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::Mode::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::Mode::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::off);
|
||||
}
|
||||
|
||||
bool UnloadFilament::StepInner() {
|
||||
|
|
@ -35,8 +35,8 @@ bool UnloadFilament::StepInner() {
|
|||
// couldn't unload to FINDA, report error and wait for user to resolve it
|
||||
state = ProgressCode::ERRDisengagingIdler;
|
||||
error = ErrorCode::FINDA_DIDNT_SWITCH_OFF;
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::Mode::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::Mode::blink0);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::blink0);
|
||||
} else {
|
||||
state = ProgressCode::DisengagingIdler;
|
||||
}
|
||||
|
|
@ -64,8 +64,8 @@ bool UnloadFilament::StepInner() {
|
|||
error = ErrorCode::OK;
|
||||
mm::motion.Disable(mm::Pulley);
|
||||
mg::globals.SetFilamentLoaded(false); // filament unloaded
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::Mode::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::Mode::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::off);
|
||||
}
|
||||
return false;
|
||||
case ProgressCode::ERRDisengagingIdler: // couldn't unload to FINDA
|
||||
|
|
@ -86,8 +86,8 @@ bool UnloadFilament::StepInner() {
|
|||
Reset(0); //@@TODO validate the reset parameter
|
||||
break;
|
||||
case mui::Event::Right: // problem resolved - the user pulled the fillament by hand
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::Mode::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::Mode::on);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
|
||||
// mm::motion.PlanMove(mm::Pulley, 450, 5000); // @@TODO constants
|
||||
state = ProgressCode::AvoidingGrind;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ bool UnloadToFinda::Step() {
|
|||
case EngagingIdler:
|
||||
if (mg::globals.FilamentLoaded()) {
|
||||
state = UnloadingToFinda;
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::Color::green, ml::Mode::blink0);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0);
|
||||
} else {
|
||||
state = Failed;
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ bool UnloadToFinda::Step() {
|
|||
// detected end of filament
|
||||
state = OK;
|
||||
mm::motion.AbortPlannedMoves(); // stop rotating the pulley
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::Color::green, ml::Mode::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off);
|
||||
} else if (/*tmc2130_read_gstat() &&*/ mm::motion.QueueEmpty()) {
|
||||
// we reached the end of move queue, but the FINDA didn't switch off
|
||||
// two possible causes - grinded filament or malfunctioning FINDA
|
||||
|
|
|
|||
Loading…
Reference in New Issue