Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9863f71

Browse files
committed
Reset() was wrecked by resetting _timeout. Reverted.
1 parenta6456d0 commit9863f71

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎cores/esp8266/PolledTimeout.h‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class timeoutTemplate
177177

178178
boolcanWait ()const
179179
{
180-
return _timeout != alwaysExpired;
180+
return _timeout != alwaysExpired && !_oneShotExpired;
181181
}
182182

183183
// Resets, will trigger after this new timeout.
@@ -194,6 +194,7 @@ class timeoutTemplate
194194
voidreset()
195195
{
196196
_start =TimePolicyT::time();
197+
_oneShotExpired =false;
197198
}
198199

199200
// Resets to just expired so that on next poll the check will immediately trigger for the user,
@@ -246,8 +247,8 @@ class timeoutTemplate
246247
boolcheckExpired(const timeType internalUnit)const
247248
{
248249
// canWait() is not checked here
249-
// returns "can expire" and "time expired"
250-
return (!_neverExpires) && ((internalUnit - _start) >= _timeout);
250+
// returns "can expire" and "oneshot not expired" and "time expired"
251+
return (_oneShotExpired) || ((!_neverExpires) && ((internalUnit - _start) >= _timeout));
251252
}
252253

253254
protected:
@@ -275,7 +276,7 @@ class timeoutTemplate
275276
if (!canWait())returntrue;
276277
if (checkExpired(TimePolicyT::time()))
277278
{
278-
_timeout =alwaysExpired;
279+
_oneShotExpired =true;
279280
returntrue;
280281
}
281282
returnfalse;
@@ -284,6 +285,7 @@ class timeoutTemplate
284285
timeType _timeout;
285286
timeType _start;
286287
bool _neverExpires;
288+
bool _oneShotExpired;
287289
};
288290

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp