Use constants

pull/126/head
3d-gussner 2021-09-22 20:27:16 +02:00 committed by DRracer
parent 5c44cf9ee0
commit ddcf24af43
1 changed files with 10 additions and 10 deletions

View File

@ -12,6 +12,7 @@ namespace logic {
void FeedToBondtech::Reset(uint8_t maxRetries) { void FeedToBondtech::Reset(uint8_t maxRetries) {
state = EngagingIdler; state = EngagingIdler;
this->maxRetries = maxRetries; this->maxRetries = maxRetries;
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::Color::green, ml::Mode::blink0);
mi::idler.Engage(mg::globals.ActiveSlot()); mi::idler.Engage(mg::globals.ActiveSlot());
} }
@ -22,16 +23,15 @@ bool FeedToBondtech::Step() {
case EngagingIdler: case EngagingIdler:
if (mi::idler.Engaged()) { if (mi::idler.Engaged()) {
state = PushingFilament; state = PushingFilament;
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0); mm::motion.PlanMove<mm::Pulley>(config::DefaultBowdenLength, config::pulleyFeedrate); //@@TODO constants - there was some strange acceleration sequence in the original FW,
mm::motion.PlanMove(mm::Pulley, steps, 4500); //@@TODO constants - there was some strange acceleration sequence in the original FW,
// we can probably hand over some array of constants for hand-tuned acceleration + leverage some smoothing in the stepper as well // we can probably hand over some array of constants for hand-tuned acceleration + leverage some smoothing in the stepper as well
} }
return false; return false;
case PushingFilament: case PushingFilament:
if (mfs::fsensor.Pressed()) { if (mfs::fsensor.Pressed()) {
mm::motion.AbortPlannedMoves(); // stop pushing filament mm::motion.AbortPlannedMoves(); // stop pushing filament
// mi::idler.Disengage(); mi::idler.Disengage();
state = OK; state = DisengagingIdler;
} else if (mm::motion.StallGuard(mm::Pulley)) { } else if (mm::motion.StallGuard(mm::Pulley)) {
// stall guard occurred during movement - the filament got stuck // stall guard occurred during movement - the filament got stuck
state = Failed; // @@TODO may be even report why it failed state = Failed; // @@TODO may be even report why it failed
@ -39,12 +39,12 @@ bool FeedToBondtech::Step() {
state = Failed; state = Failed;
} }
return false; return false;
// case DisengagingIdler: case DisengagingIdler:
// if (!mi::idler.Engaged()) { if (!mi::idler.Engaged()) {
// state = OK; state = OK;
// ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on); ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
// } }
// return false; return false;
case OK: case OK:
case Failed: case Failed:
default: default: