diff options
author | Ben Isaacs <75862+ben-xo@users.noreply.github.com> | 2021-08-01 21:18:54 +0300 |
---|---|---|
committer | Ben Isaacs <75862+ben-xo@users.noreply.github.com> | 2021-08-01 21:18:54 +0300 |
commit | c7dfa155dfd98271eda3ac48dd8986fb193c3635 (patch) | |
tree | af28661ef82543103a2df475de8de193de8dbbcb | |
parent | 5cc17b2be88982eb34b1998de22b83fee56d4f07 (diff) |
Make the minimum wait optional by defining NO_MINIMUM_WAIT
You may want this if you are doing your own frame-rate accounting and don't want to waste cycles. You may also want this if you are intentionally calling show() multiple times for the same strip.
-rw-r--r-- | src/fastled_delay.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/fastled_delay.h b/src/fastled_delay.h index a14e8a29..4f99e3f6 100644 --- a/src/fastled_delay.h +++ b/src/fastled_delay.h @@ -8,6 +8,9 @@ FASTLED_NAMESPACE_BEGIN + +#if (!defined(NO_MINIMUM_WAIT) || (NO_MINIMUM_WAIT==0)) + /// Class to ensure that a minimum amount of time has kicked since the last time run - and delay if not enough time has passed yet /// this should make sure that chipsets that have template<int WAIT> class CMinWait { @@ -26,6 +29,18 @@ public: void mark() { mLastMicros = micros() & 0xFFFF; } }; +#else + +// if you keep your own FPS (and therefore don't call show() too quickly for pixels to latch), you may not want a minimum wait. +template<int WAIT> class CMinWait { +public: + CMinWait() { } + void wait() { } + void mark() {} +}; + +#endif + //////////////////////////////////////////////////////////////////////////////////////////// // |