Update debug

pull/126/head
3d-gussner 2021-09-30 18:18:34 +02:00 committed by DRracer
parent d9134b16fc
commit 62116b1283
2 changed files with 14 additions and 3 deletions

View File

@ -22,6 +22,7 @@ bool FeedToBondtech::Step() {
switch (state) {
case EngagingIdler:
if (mi::idler.Engaged()) {
dbg_logic_P(PSTR("Feed to Bondtech --> Idler engaged"));
dbg_logic_sprintf_P(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
state = PushingFilament;
mm::motion.InitAxis(mm::Pulley);
@ -30,7 +31,7 @@ bool FeedToBondtech::Step() {
}
return false;
case PushingFilament:
dbg_logic_P(PSTR("Feed to Bondtech --> Pushing"));
//dbg_logic_P(PSTR("Feed to Bondtech --> Pushing"));
if (mfs::fsensor.Pressed()) {
mm::motion.AbortPlannedMoves(); // stop pushing filament
mi::idler.Disengage();
@ -44,8 +45,9 @@ bool FeedToBondtech::Step() {
}
return false;
case DisengagingIdler:
dbg_logic_P(PSTR("Feed to Bondtech --> DisengagingIdler"));
if (!mi::idler.Engaged()) {
dbg_logic_P(PSTR("Feed to Bondtech --> Idler disengaged"));
dbg_logic_sprintf_P(PSTR("Pulley end steps %u"), mm::motion.CurPosition(mm::Pulley));
state = OK;
mm::motion.Disable(mm::Pulley);
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);

View File

@ -7,10 +7,11 @@
#include "../modules/motion.h"
#include "../modules/permanent_storage.h"
#include "../modules/user_input.h"
#include "../debug.h"
namespace logic {
void FeedToFinda::Reset(bool feedPhaseLimited) {
dbg_logic_P(PSTR("\nFeed to FINDA\n\n"));
state = EngagingIdler;
this->feedPhaseLimited = feedPhaseLimited;
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0);
@ -23,6 +24,8 @@ bool FeedToFinda::Step() {
switch (state) {
case EngagingIdler:
if (mi::idler.Engaged() && ms::selector.Slot() == mg::globals.ActiveSlot()) {
dbg_logic_P(PSTR("Feed to Finda --> Idler engaged"));
dbg_logic_sprintf_P(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
state = PushingFilament;
mm::motion.InitAxis(mm::Pulley);
mm::motion.PlanMove<mm::Pulley>(config::feedToFinda, config::pulleyFeedrate);
@ -35,6 +38,8 @@ bool FeedToFinda::Step() {
mm::motion.AbortPlannedMoves(); // stop pushing filament
// FINDA triggered - that means it works and detected the filament tip
mg::globals.SetFilamentLoaded(mg::FilamentLoadState::InSelector);
dbg_logic_P(PSTR("Feed to Finda --> Idler disengaged"));
dbg_logic_sprintf_P(PSTR("Pulley end steps %u"), mm::motion.CurPosition(mm::Pulley));
state = OK;
} else if (mm::motion.QueueEmpty()) { // all moves have been finished and FINDA didn't switch on
state = Failed;
@ -44,7 +49,11 @@ bool FeedToFinda::Step() {
}
return false;
case OK:
dbg_logic_P(PSTR("Feed to FINDA OK"));
return true;
case Failed:
dbg_logic_P(PSTR("Feed to FINDA FAILED"));
return true;
default:
return true;
}