mmu: add ResetCommunicationTimeoutAttempts
Adding __attribute__((noinline)) saves 14 bytes of flash Change in memory: Flash: +34 bytes SRAM: 0 bytes
This commit is contained in:
parent
ef33db9a71
commit
7b9e707709
|
|
@ -63,8 +63,8 @@ void MMU2::Start() {
|
||||||
|
|
||||||
// start the communication
|
// start the communication
|
||||||
logic.Start();
|
logic.Start();
|
||||||
|
|
||||||
logic.ResetRetryAttempts();
|
logic.ResetRetryAttempts();
|
||||||
|
logic.ResetCommunicationTimeoutAttempts();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MMU2::Stop() {
|
void MMU2::Stop() {
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) {
|
||||||
SendVersion(stage);
|
SendVersion(stage);
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
SendVersion(stage + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -774,7 +774,7 @@ void ProtocolLogic::LogResponse() {
|
||||||
StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) {
|
StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) {
|
||||||
if (dataTO.Record(ss)) {
|
if (dataTO.Record(ss)) {
|
||||||
LogError(msg_P);
|
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();
|
return dataTO.InitialCause();
|
||||||
} else {
|
} else {
|
||||||
return Processing; // suppress short drop outs of communication
|
return Processing; // suppress short drop outs of communication
|
||||||
|
|
@ -865,6 +865,11 @@ void ProtocolLogic::ResetRetryAttempts() {
|
||||||
retryAttempts = MAX_RETRIES;
|
retryAttempts = MAX_RETRIES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __attribute__((noinline)) ProtocolLogic::ResetCommunicationTimeoutAttempts() {
|
||||||
|
SERIAL_ECHOLNPGM("RSTCommTimeout");
|
||||||
|
dataTO.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
bool DropOutFilter::Record(StepStatus ss) {
|
bool DropOutFilter::Record(StepStatus ss) {
|
||||||
if (occurrences == maxOccurrences) {
|
if (occurrences == maxOccurrences) {
|
||||||
cause = ss;
|
cause = ss;
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,8 @@ public:
|
||||||
/// Reset the retryAttempts back to the default value
|
/// Reset the retryAttempts back to the default value
|
||||||
void ResetRetryAttempts();
|
void ResetRetryAttempts();
|
||||||
|
|
||||||
|
void ResetCommunicationTimeoutAttempts();
|
||||||
|
|
||||||
constexpr bool InAutoRetry() const { return inAutoRetry; }
|
constexpr bool InAutoRetry() const { return inAutoRetry; }
|
||||||
void SetInAutoRetry(bool iar) {
|
void SetInAutoRetry(bool iar) {
|
||||||
inAutoRetry = iar;
|
inAutoRetry = iar;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue