mmu: move RetryIfPossible outside the error screen
This fixes issue where 'retryAttempts=3' may be spammed in the logs Change in memory: Flash: 0 bytes SRAM: 0 bytes
This commit is contained in:
parent
1a35bf506a
commit
7bc7f21fa5
|
|
@ -839,7 +839,12 @@ void MMU2::ReportError(ErrorCode ec, ErrorSource res) {
|
||||||
LogErrorEvent_P( _O(PrusaErrorTitle(PrusaErrorCodeIndex((uint16_t)ec))) );
|
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'
|
static_assert(mmu2Magic[0] == 'M'
|
||||||
&& mmu2Magic[1] == 'M'
|
&& mmu2Magic[1] == 'M'
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,8 @@ public:
|
||||||
bool MMU_PRINT_SAVED() const { return mmu_print_saved != SavedState::None; }
|
bool MMU_PRINT_SAVED() const { return mmu_print_saved != SavedState::None; }
|
||||||
|
|
||||||
/// Automagically "press" a Retry button if we have any retry attempts left
|
/// 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);
|
bool RetryIfPossible(uint16_t ec);
|
||||||
|
|
||||||
/// Decrement the retry attempts, if in a retry.
|
/// Decrement the retry attempts, if in a retry.
|
||||||
|
|
|
||||||
|
|
@ -224,13 +224,6 @@ void ReportErrorHook(uint16_t ec) {
|
||||||
// a button was pushed on the MMU and the LCD should
|
// a button was pushed on the MMU and the LCD should
|
||||||
// dismiss the error screen until MMU raises a new error
|
// dismiss the error screen until MMU raises a new error
|
||||||
ReportErrorHookState = ReportErrorHookStates::DISMISS_ERROR_SCREEN;
|
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);
|
const uint8_t ei = PrusaErrorCodeIndex(ec);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue