mmu: formatting

This commit is contained in:
Guðni Már Gilbert 2023-10-18 22:57:34 +00:00
parent 12a3051c50
commit cd3372dc92
1 changed files with 16 additions and 2 deletions

View File

@ -835,45 +835,58 @@ bool MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
}
StepStatus MMU2::LogicStep(bool reportErrors) {
CheckUserInput(); // Process any buttons before proceeding with another MMU Query
StepStatus ss = logic.Step();
// Process any buttons before proceeding with another MMU Query
CheckUserInput();
const StepStatus ss = logic.Step();
switch (ss) {
case Finished:
// At this point it is safe to trigger a runout and not interrupt the MMU protocol
CheckFINDARunout();
break;
case Processing:
OnMMUProgressMsg(logic.Progress());
break;
case ButtonPushed:
lastButton = logic.Button();
LogEchoEvent_P(PSTR("MMU Button pushed"));
CheckUserInput(); // Process the button immediately
break;
case Interrupted:
// can be silently handed over to a higher layer, no processing necessary at this spot
break;
default:
if (reportErrors) {
switch (ss) {
case CommandError:
ReportError(logic.Error(), ErrorSourceMMU);
break;
case CommunicationTimeout:
state = xState::Connecting;
ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter);
break;
case ProtocolError:
state = xState::Connecting;
ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter);
break;
case VersionMismatch:
StopKeepPowered();
ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter);
break;
case PrinterError:
ReportError(logic.PrinterError(), ErrorSourcePrinter);
break;
default:
break;
}
@ -883,6 +896,7 @@ StepStatus MMU2::LogicStep(bool reportErrors) {
if (logic.Running()) {
state = xState::Active;
}
return ss;
}