Unify MMU operations' workflow

This commit is contained in:
D.R.racer 2023-09-13 12:43:44 +02:00 committed by DRracer
parent a02ff0651c
commit ea01012026
1 changed files with 23 additions and 23 deletions

View File

@ -81,8 +81,7 @@ void MMU2::StopKeepPowered() {
void MMU2::Tune() { void MMU2::Tune() {
switch (lastErrorCode) { switch (lastErrorCode) {
case ErrorCode::HOMING_SELECTOR_FAILED: case ErrorCode::HOMING_SELECTOR_FAILED:
case ErrorCode::HOMING_IDLER_FAILED: case ErrorCode::HOMING_IDLER_FAILED: {
{
// Prompt a menu for different values // Prompt a menu for different values
tuneIdlerStallguardThreshold(); tuneIdlerStallguardThreshold();
break; break;
@ -465,9 +464,11 @@ bool MMU2::unload() {
WaitForHotendTargetTempBeep(); WaitForHotendTargetTempBeep();
{
ReportingRAII rep(CommandInProgress::UnloadFilament); ReportingRAII rep(CommandInProgress::UnloadFilament);
UnloadInner(); UnloadInner();
}
ScreenUpdateEnable();
return true; return true;
} }
@ -495,10 +496,10 @@ bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) {
ReportingRAII rep(CommandInProgress::CutFilament); ReportingRAII rep(CommandInProgress::CutFilament);
CutFilamentInner(slot); CutFilamentInner(slot);
}
extruder = MMU2_NO_TOOL; extruder = MMU2_NO_TOOL;
tool_change_extruder = MMU2_NO_TOOL; tool_change_extruder = MMU2_NO_TOOL;
MakeSound(SoundType::Confirm); MakeSound(SoundType::Confirm);
}
ScreenUpdateEnable(); ScreenUpdateEnable();
return true; return true;
} }
@ -517,7 +518,7 @@ bool MMU2::load_filament(uint8_t slot) {
return false; return false;
FullScreenMsgLoad(slot); FullScreenMsgLoad(slot);
{
ReportingRAII rep(CommandInProgress::LoadFilament); ReportingRAII rep(CommandInProgress::LoadFilament);
for (;;) { for (;;) {
Disable_E0(); Disable_E0();
@ -526,11 +527,9 @@ bool MMU2::load_filament(uint8_t slot) {
break; break;
IncrementMMUFails(); IncrementMMUFails();
} }
MakeSound(SoundType::Confirm); MakeSound(SoundType::Confirm);
}
ScreenUpdateEnable(); ScreenUpdateEnable();
return true; return true;
} }
@ -580,10 +579,11 @@ bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) {
break; break;
IncrementMMUFails(); IncrementMMUFails();
} }
}
extruder = MMU2_NO_TOOL; extruder = MMU2_NO_TOOL;
tool_change_extruder = MMU2_NO_TOOL; tool_change_extruder = MMU2_NO_TOOL;
MakeSound(Confirm); MakeSound(Confirm);
}
ScreenUpdateEnable();
return true; return true;
} }