We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9c21cd commit 74b906eCopy full SHA for 74b906e
src/utility/time/TimedAttempt.cpp
@@ -52,8 +52,9 @@ unsigned long TimedAttempt::retry() {
52
}
53
54
unsigned long TimedAttempt::reload() {
55
- unsigned long retryDelay = (1 << _retryCount) * _minDelay;
56
- _retryDelay = min(retryDelay, _maxDelay);
+ unsigned long shift = _retryCount > 31 ? 31 : _retryCount;
+ unsigned long delay = (1UL << shift) * _minDelay;
57
+ _retryDelay = min(delay, _maxDelay);
58
_retryTick = millis();
59
return _retryDelay;
60
0 commit comments