Skip to content

Commit ed920df

Browse files
committed
expiredOneShot() qualifed as const, despite asymmetry with expired() and expiredRetrigger().
_oneShotExpired qualified as mutable member. This is done as intermediate fix for use in derived class ESP8266WiFiMesh ExpiringTimeTracker.
1 parent 05272e5 commit ed920df

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cores/esp8266/PolledTimeout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class timeoutTemplate
269269
}
270270

271271
IRAM_ATTR // fast
272-
bool expiredOneShot()
272+
bool expiredOneShot() const
273273
{
274274
// returns "always expired" or "has expired"
275275
if (!canWait()) return true;
@@ -284,7 +284,7 @@ class timeoutTemplate
284284
timeType _timeout;
285285
timeType _start;
286286
bool _neverExpires;
287-
bool _oneShotExpired;
287+
mutable bool _oneShotExpired;
288288
};
289289

290290
// legacy type names, deprecated (unit is milliseconds)

libraries/ESP8266WiFiMesh/src/ExpiringTimeTracker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ExpiringTimeTracker : private esp8266::polledTimeout::oneShotMs {
6161
* Get the time since the ExpiringTimeTracker instance creation or the last reset(), whichever is more recent.
6262
*/
6363
uint32_t elapsedTime() const;
64-
bool expired();
64+
bool expired() const;
6565
void reset();
6666
void reset(const uint32_t newDuration);
6767
void reset(const calculatorType newDurationCalculator);

0 commit comments

Comments
 (0)