Rename mp (modules::pulley) namespace to mpu
clashed with the already used `modules::protocol` (mp)pull/154/head
parent
b36e6b99a1
commit
c5e5f57100
|
|
@ -120,7 +120,7 @@ bool CommandBase::WaitForModulesErrorRecovery() {
|
|||
if (WaitForOneModuleErrorRecovery(CheckMovable(ms::selector), ms::selector))
|
||||
return true;
|
||||
|
||||
if (WaitForOneModuleErrorRecovery(CheckMovable(mp::pulley), mp::pulley))
|
||||
if (WaitForOneModuleErrorRecovery(CheckMovable(mpu::pulley), mpu::pulley))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
@ -180,7 +180,7 @@ bool CommandBase::CheckToolIndex(uint8_t index) {
|
|||
void CommandBase::ErrDisengagingIdler() {
|
||||
if (!mi::idler.Engaged()) {
|
||||
state = ProgressCode::ERRWaitingForUser;
|
||||
mp::pulley.Disable();
|
||||
mpu::pulley.Disable();
|
||||
mui::userInput.Clear(); // remove all buffered events if any just before we wait for some input
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ bool CutFilament::StepInner() {
|
|||
} else {
|
||||
// unload back to the pulley
|
||||
state = ProgressCode::UnloadingToPulley;
|
||||
mp::pulley.PlanMove(-config::cutLength, config::pulleyUnloadFeedrate);
|
||||
mpu::pulley.PlanMove(-config::cutLength, config::pulleyUnloadFeedrate);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -75,7 +75,7 @@ bool CutFilament::StepInner() {
|
|||
case ProgressCode::PreparingBlade:
|
||||
if (ms::selector.Slot() == cutSlot + 1) {
|
||||
state = ProgressCode::PushingFilament;
|
||||
mp::pulley.PlanMove(config::cutLength, config::pulleyUnloadFeedrate); //
|
||||
mpu::pulley.PlanMove(config::cutLength, config::pulleyUnloadFeedrate); //
|
||||
}
|
||||
break;
|
||||
case ProgressCode::PushingFilament:
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ bool EjectFilament::StepInner() {
|
|||
case ProgressCode::ParkingSelector:
|
||||
if (mm::motion.QueueEmpty()) { // selector parked aside
|
||||
state = ProgressCode::EjectingFilament;
|
||||
mp::pulley.InitAxis();
|
||||
mp::pulley.PlanMove(-config::filamentMinLoadedToMMU, config::pulleySlowFeedrate);
|
||||
mpu::pulley.InitAxis();
|
||||
mpu::pulley.PlanMove(-config::filamentMinLoadedToMMU, config::pulleySlowFeedrate);
|
||||
}
|
||||
break;
|
||||
case ProgressCode::EjectingFilament:
|
||||
|
|
@ -66,7 +66,7 @@ bool EjectFilament::StepInner() {
|
|||
break;
|
||||
case ProgressCode::DisengagingIdler:
|
||||
if (!mi::idler.Engaged()) { // idler disengaged
|
||||
mp::pulley.Disable();
|
||||
mpu::pulley.Disable();
|
||||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::NotLoaded);
|
||||
state = ProgressCode::OK;
|
||||
error = ErrorCode::OK;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ void logic::FeedToBondtech::GoToPushToNozzle() {
|
|||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InFSensor);
|
||||
// plan a slow move to help push filament into the nozzle
|
||||
//@@TODO the speed in mm/s must correspond to printer's feeding speed!
|
||||
mp::pulley.PlanMove(config::fsensorToNozzle, config::pulleySlowFeedrate);
|
||||
mpu::pulley.PlanMove(config::fsensorToNozzle, config::pulleySlowFeedrate);
|
||||
state = PushingFilamentIntoNozzle;
|
||||
}
|
||||
|
||||
|
|
@ -35,8 +35,8 @@ bool FeedToBondtech::Step() {
|
|||
dbg_logic_P(PSTR("Feed to Bondtech --> Idler engaged"));
|
||||
dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
|
||||
state = PushingFilamentToFSensor;
|
||||
mp::pulley.InitAxis();
|
||||
mp::pulley.PlanMove(config::defaultBowdenLength, config::pulleyLoadFeedrate, config::pulleySlowFeedrate);
|
||||
mpu::pulley.InitAxis();
|
||||
mpu::pulley.PlanMove(config::defaultBowdenLength, config::pulleyLoadFeedrate, config::pulleySlowFeedrate);
|
||||
}
|
||||
return false;
|
||||
case PushingFilamentToFSensor:
|
||||
|
|
@ -56,7 +56,7 @@ bool FeedToBondtech::Step() {
|
|||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InNozzle);
|
||||
mi::idler.Disengage();
|
||||
// while disengaging the idler, keep on moving with the pulley to avoid grinding while the printer is trying to grab the filament itself
|
||||
mp::pulley.PlanMove(config::fsensorToNozzleAvoidGrind, config::pulleySlowFeedrate);
|
||||
mpu::pulley.PlanMove(config::fsensorToNozzleAvoidGrind, config::pulleySlowFeedrate);
|
||||
state = DisengagingIdler;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -65,7 +65,7 @@ bool FeedToBondtech::Step() {
|
|||
dbg_logic_P(PSTR("Feed to Bondtech --> Idler disengaged"));
|
||||
dbg_logic_fP(PSTR("Pulley end steps %u"), mm::motion.CurPosition(mm::Pulley));
|
||||
state = OK;
|
||||
mp::pulley.Disable();
|
||||
mpu::pulley.Disable();
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ bool FeedToFinda::Step() {
|
|||
dbg_logic_P(PSTR("Feed to Finda --> Idler engaged"));
|
||||
dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
|
||||
state = PushingFilament;
|
||||
mp::pulley.InitAxis();
|
||||
mpu::pulley.InitAxis();
|
||||
// @@TODO this may never happen as load filament always assumes the filament is at least at the pulley
|
||||
// if (mg::globals.FilamentLoaded() == mg::FilamentLoadState::NotLoaded) { // feed slowly filament to PTFE
|
||||
// mp::pulley.PlanMove(config::filamentMinLoadedToMMU, config::pulleySlowFeedrate);
|
||||
// }
|
||||
mp::pulley.PlanMove(config::maximumFeedToFinda, config::pulleySlowFeedrate);
|
||||
mpu::pulley.PlanMove(config::maximumFeedToFinda, config::pulleySlowFeedrate);
|
||||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
|
||||
mui::userInput.Clear(); // remove all buffered events if any just before we wait for some input
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ void logic::LoadFilament::FinishedCorrectly() {
|
|||
state = ProgressCode::OK;
|
||||
error = ErrorCode::OK;
|
||||
ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off);
|
||||
mp::pulley.Disable();
|
||||
mpu::pulley.Disable();
|
||||
}
|
||||
|
||||
bool LoadFilament::StepInner() {
|
||||
|
|
@ -118,7 +118,7 @@ bool LoadFilament::StepInner() {
|
|||
case ProgressCode::ERREngagingIdler:
|
||||
if (mi::idler.Engaged()) {
|
||||
state = ProgressCode::ERRHelpingFilament;
|
||||
mp::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate);
|
||||
mpu::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate);
|
||||
}
|
||||
return false;
|
||||
case ProgressCode::ERRHelpingFilament:
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ bool RetractFromFinda::Step() {
|
|||
if (mi::idler.Engaged()) {
|
||||
dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
|
||||
state = UnloadBackToPTFE;
|
||||
mp::pulley.PlanMove(-(config::cuttingEdgeToFindaMidpoint + config::cuttingEdgeRetract), config::pulleyUnloadFeedrate);
|
||||
mpu::pulley.PlanMove(-(config::cuttingEdgeToFindaMidpoint + config::cuttingEdgeRetract), config::pulleyUnloadFeedrate);
|
||||
}
|
||||
return false;
|
||||
case UnloadBackToPTFE:
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ bool ToolChange::StepInner() {
|
|||
case ProgressCode::ERREngagingIdler:
|
||||
if (mi::idler.Engaged()) {
|
||||
state = ProgressCode::ERRHelpingFilament;
|
||||
mp::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate);
|
||||
mpu::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate);
|
||||
}
|
||||
return false;
|
||||
case ProgressCode::ERRHelpingFilament:
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ void UnloadFilament::Reset(uint8_t /*param*/) {
|
|||
}
|
||||
|
||||
// unloads filament from extruder - filament is above Bondtech gears
|
||||
mp::pulley.InitAxis();
|
||||
mpu::pulley.InitAxis();
|
||||
state = ProgressCode::UnloadingToFinda;
|
||||
error = ErrorCode::RUNNING;
|
||||
unl.Reset(maxRetries);
|
||||
|
|
@ -35,7 +35,7 @@ void UnloadFilament::Reset(uint8_t /*param*/) {
|
|||
void UnloadFilament::FinishedCorrectly() {
|
||||
state = ProgressCode::OK;
|
||||
error = ErrorCode::OK;
|
||||
mp::pulley.Disable();
|
||||
mpu::pulley.Disable();
|
||||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::AtPulley); // filament unloaded
|
||||
ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off);
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ bool UnloadFilament::StepInner() {
|
|||
case ProgressCode::ERREngagingIdler:
|
||||
if (mi::idler.Engaged()) {
|
||||
state = ProgressCode::ERRHelpingFilament;
|
||||
mp::pulley.PlanMove(-config::pulleyHelperMove, config::pulleySlowFeedrate);
|
||||
mpu::pulley.PlanMove(-config::pulleyHelperMove, config::pulleySlowFeedrate);
|
||||
}
|
||||
return false;
|
||||
case ProgressCode::ERRHelpingFilament:
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ bool UnloadToFinda::Step() {
|
|||
case EngagingIdler:
|
||||
if (mg::globals.FilamentLoaded() >= mg::FilamentLoadState::InSelector) {
|
||||
state = UnloadingToFinda;
|
||||
mp::pulley.InitAxis();
|
||||
mpu::pulley.InitAxis();
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0);
|
||||
} else {
|
||||
state = FailedFINDA;
|
||||
|
|
@ -43,8 +43,8 @@ bool UnloadToFinda::Step() {
|
|||
if (mi::idler.Engaged()) {
|
||||
state = WaitingForFINDA;
|
||||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
|
||||
unloadStart_mm = mp::pulley.CurrentPositionPulley_mm();
|
||||
mp::pulley.PlanMove(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyUnloadFeedrate);
|
||||
unloadStart_mm = mpu::pulley.CurrentPositionPulley_mm();
|
||||
mpu::pulley.PlanMove(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyUnloadFeedrate);
|
||||
}
|
||||
return false;
|
||||
case WaitingForFINDA: {
|
||||
|
|
|
|||
|
|
@ -47,4 +47,4 @@ extern Pulley pulley;
|
|||
} // namespace pulley
|
||||
} // namespace modules
|
||||
|
||||
namespace mp = modules::pulley;
|
||||
namespace mpu = modules::pulley;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ void main_loop() {
|
|||
mf::finda.Step();
|
||||
mfs::fsensor.Step();
|
||||
mi::idler.Step();
|
||||
mp::pulley.Step();
|
||||
mpu::pulley.Step();
|
||||
ms::selector.Step();
|
||||
mm::motion.Step();
|
||||
mui::userInput.Step();
|
||||
|
|
@ -52,7 +52,7 @@ void ForceReinitAllAutomata() {
|
|||
new (&mf::finda) mf::FINDA();
|
||||
new (&mfs::fsensor) mfs::FSensor();
|
||||
new (&mi::idler) mi::Idler();
|
||||
new (&mp::pulley) mp::Pulley();
|
||||
new (&mpu::pulley) mpu::Pulley();
|
||||
new (&ms::selector) ms::Selector();
|
||||
new (&mm::motion) mm::Motion();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue