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
|
||||
logic.Start();
|
||||
|
||||
logic.ResetRetryAttempts();
|
||||
logic.ResetCommunicationTimeoutAttempts();
|
||||
}
|
||||
|
||||
void MMU2::Stop() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue