You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using oneShot = polledTimeout::timeoutTemplate<false>;
119
-
using periodic = polledTimeout::timeoutTemplate<true>;
248
+
// legacy type names, deprecated (unit is milliseconds)
249
+
250
+
using oneShot = polledTimeout::timeoutTemplate<false> /*__attribute__((deprecated("use oneShotMs")))*/;
251
+
using periodic = polledTimeout::timeoutTemplate<true> /*__attribute__((deprecated("use periodicMs")))*/;
252
+
253
+
// standard versions (based on millis())
254
+
// timeMax() is 49.7 days ((2^32)-2 ms)
255
+
256
+
using oneShotMs = polledTimeout::timeoutTemplate<false>;
257
+
using periodicMs = polledTimeout::timeoutTemplate<true>;
258
+
259
+
// Time policy based on ESP.getCycleCount(), and intended to be called very often:
260
+
// "Fast" versions sacrifices time range for improved precision and reduced execution time (by 86%)
261
+
// (cpu cycles for ::expired(): 372 (millis()) vs 52 (ESP.getCycleCount()))
262
+
// timeMax() values:
263
+
// Ms: max is 26843 ms (26.8 s)
264
+
// Us: max is 26843545 us (26.8 s)
265
+
// Ns: max is 1073741823 ns ( 1.07 s)
266
+
// (time policy based on ESP.getCycleCount() is intended to be called very often)
267
+
268
+
using oneShotFastMs = polledTimeout::timeoutTemplate<false, YieldPolicy::DoNothing, TimePolicy::TimeFastMillis>;
269
+
using periodicFastMs = polledTimeout::timeoutTemplate<true, YieldPolicy::DoNothing, TimePolicy::TimeFastMillis>;
270
+
using oneShotFastUs = polledTimeout::timeoutTemplate<false, YieldPolicy::DoNothing, TimePolicy::TimeFastMicros>;
271
+
using periodicFastUs = polledTimeout::timeoutTemplate<true, YieldPolicy::DoNothing, TimePolicy::TimeFastMicros>;
272
+
using oneShotFastNs = polledTimeout::timeoutTemplate<false, YieldPolicy::DoNothing, TimePolicy::TimeFastNanos>;
273
+
using periodicFastNs = polledTimeout::timeoutTemplate<true, YieldPolicy::DoNothing, TimePolicy::TimeFastNanos>;
120
274
121
275
} //polledTimeout
122
276
123
277
124
278
/* A 1-shot timeout that auto-yields when in CONT can be built as follows:
125
-
* using oneShotYield = esp8266::polledTimeout::timeoutTemplate<false, esp8266::polledTimeout::YieldPolicy::YieldOrSkip>;
279
+
* using oneShotYieldMs = esp8266::polledTimeout::timeoutTemplate<false, esp8266::polledTimeout::YieldPolicy::YieldOrSkip>;
126
280
*
127
281
* Other policies can be implemented by the user, e.g.: simple yield that panics in SYS, and the polledTimeout types built as needed as shown above, without modifying this file.
0 commit comments