diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index 6bd6f1605..ced863fe0 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -63,8 +63,8 @@ void MMU2::Start() { // start the communication logic.Start(); - logic.ResetRetryAttempts(); + logic.ResetCommunicationTimeoutAttempts(); } void MMU2::Stop() { diff --git a/Firmware/mmu2_protocol_logic.cpp b/Firmware/mmu2_protocol_logic.cpp index 77a0da950..65b5a4115 100644 --- a/Firmware/mmu2_protocol_logic.cpp +++ b/Firmware/mmu2_protocol_logic.cpp @@ -256,7 +256,7 @@ StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { SendVersion(stage); } } else { - dataTO.Reset(); // got a meaningful response from the MMU, stop data layer timeout tracking + ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); } } @@ -774,7 +774,7 @@ void ProtocolLogic::LogResponse() { StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { LogError(msg_P); - dataTO.Reset(); // prepare for another run of consecutive retries before firing an error + ResetCommunicationTimeoutAttempts(); // prepare for another run of consecutive retries before firing an error return dataTO.InitialCause(); } else { return Processing; // suppress short drop outs of communication @@ -865,6 +865,11 @@ void ProtocolLogic::ResetRetryAttempts() { retryAttempts = MAX_RETRIES; } +void __attribute__((noinline)) ProtocolLogic::ResetCommunicationTimeoutAttempts() { + SERIAL_ECHOLNPGM("RSTCommTimeout"); + dataTO.Reset(); +} + bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { cause = ss; diff --git a/Firmware/mmu2_protocol_logic.h b/Firmware/mmu2_protocol_logic.h index bf884106b..6e46360ed 100644 --- a/Firmware/mmu2_protocol_logic.h +++ b/Firmware/mmu2_protocol_logic.h @@ -186,6 +186,8 @@ public: /// Reset the retryAttempts back to the default value void ResetRetryAttempts(); + void ResetCommunicationTimeoutAttempts(); + constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar;