8000 Fix expiredOneShot to properly stay expired forever unless reset. · dok-net/arduino-esp8266@5b942e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b942e4

Browse files
committed
Fix expiredOneShot to properly stay expired forever unless reset.
1 parent 7f77012 commit 5b942e4

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
@@ -269,10 +269,16 @@ class timeoutTemplate
269269
}
270270

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

278284
timeType _timeout;

0 commit comments

Comments
 (0)
0