Increment errors in ReportError
This commit is contained in:
parent
4eaabbf092
commit
adb24cd410
|
|
@ -880,6 +880,16 @@ void MMU2::ReportError(ErrorCode ec, ErrorSource res) {
|
|||
lastErrorCode = ec;
|
||||
lastErrorSource = res;
|
||||
LogErrorEvent_P( _O(PrusaErrorTitle(PrusaErrorCodeIndex((uint16_t)ec))) );
|
||||
|
||||
if( ec != ErrorCode::OK ){
|
||||
IncrementMMUFails();
|
||||
|
||||
// check if it is a "power" failure - we consider TMC-related errors as power failures
|
||||
if( (uint16_t)ec & 0x7e00 ){ // @@TODO can be optimized to uint8_t operation
|
||||
// TMC-related errors are from 0x8200 higher
|
||||
IncrementTMCFailures();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !mmu2.RetryIfPossible((uint16_t)ec) ) {
|
||||
|
|
|
|||
|
|
@ -233,14 +233,6 @@ void ReportErrorHook(uint16_t ec) {
|
|||
case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN:
|
||||
ReportErrorHookStaticRender(ei);
|
||||
ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION;
|
||||
IncrementMMUFails();
|
||||
|
||||
// check if it is a "power" failure - we consider TMC-related errors as power failures
|
||||
if( (uint16_t)ec & 0x7e00 ){ // @@TODO can be optimized to uint8_t operation
|
||||
// TMC-related errors are from 0x8200 higher
|
||||
// we can increment a power error at this spot
|
||||
mmu2.IncrementTMCFailures();
|
||||
}
|
||||
[[fallthrough]];
|
||||
case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION:
|
||||
mmu2.is_mmu_error_monitor_active = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue