Skip to content

Commit 0743684

Browse files
committed
Fix expiredOneShot to properly stay expired forever unless reset.
1 parent dc3db41 commit 0743684

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cores/esp8266/PolledTimeout.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,16 @@ class timeoutTemplate
268268
}
269269

270270
IRAM_ATTR // fast
271-
bool expiredOneShot() const
271+
bool expiredOneShot()
272272
{
273273
// returns "always expired" or "has expired"
274-
return !canWait() || checkExpired(TimePolicyT::time());
274+
return !canWait();
275+
if (checkExpired(TimePolicyT::time()))
276+
{
277+
_timeout = alwaysExpired;
278+
return true;
279+
}
280+
return false;
275281
}
276282

277283
timeType _timeout;

0 commit comments

Comments
 (0)