diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index 714c833b7..a084a8839 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -839,7 +839,12 @@ void MMU2::ReportError(ErrorCode ec, ErrorSource res) { LogErrorEvent_P( _O(PrusaErrorTitle(PrusaErrorCodeIndex((uint16_t)ec))) ); } - ReportErrorHook((uint16_t)ec); + if( !mmu2.RetryIfPossible((uint16_t)ec) ) { + // If retry attempts are all used up + // or if 'Retry' operation is not available + // raise the MMU error sceen and wait for user input + ReportErrorHook((uint16_t)ec); + } static_assert(mmu2Magic[0] == 'M' && mmu2Magic[1] == 'M' diff --git a/Firmware/mmu2.h b/Firmware/mmu2.h index 6dfced7f4..d791a6b87 100644 --- a/Firmware/mmu2.h +++ b/Firmware/mmu2.h @@ -185,6 +185,8 @@ public: bool MMU_PRINT_SAVED() const { return mmu_print_saved != SavedState::None; } /// Automagically "press" a Retry button if we have any retry attempts left + /// @param ec ErrorCode enum value + /// @returns true if auto-retry is ongoing, false when retry is unavailable or retry attempts are all used up bool RetryIfPossible(uint16_t ec); /// Decrement the retry attempts, if in a retry. diff --git a/Firmware/mmu2_reporting.cpp b/Firmware/mmu2_reporting.cpp index df32fab21..c40497863 100644 --- a/Firmware/mmu2_reporting.cpp +++ b/Firmware/mmu2_reporting.cpp @@ -224,13 +224,6 @@ void ReportErrorHook(uint16_t ec) { // a button was pushed on the MMU and the LCD should // dismiss the error screen until MMU raises a new error ReportErrorHookState = ReportErrorHookStates::DISMISS_ERROR_SCREEN; - } else { - // attempt an automatic Retry button - if( ReportErrorHookState == ReportErrorHookStates::MONITOR_SELECTION ){ - if( mmu2.RetryIfPossible(ec) ){ - ReportErrorHookState = ReportErrorHookStates::DISMISS_ERROR_SCREEN; - } - } } const uint8_t ei = PrusaErrorCodeIndex(ec);