Skip to content

Commit 4582088

Browse files
authored
Merge pull request FastLED#1272 from ben-xo/feature/make-minimum-wait-optional
Make the minimum wait optional by defining NO_MINIMUM_WAIT
2 parents a67bedb + c7dfa15 commit 4582088

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/fastled_delay.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
FASTLED_NAMESPACE_BEGIN
1010

11+
12+
#if (!defined(NO_MINIMUM_WAIT) || (NO_MINIMUM_WAIT==0))
13+
1114
/// 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
1215
/// this should make sure that chipsets that have
1316
template<int WAIT> class CMinWait {
@@ -26,6 +29,18 @@ template<int WAIT> class CMinWait {
2629
void mark() { mLastMicros = micros() & 0xFFFF; }
2730
};
2831

32+
#else
33+
34+
// 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.
35+
template<int WAIT> class CMinWait {
36+
public:
37+
CMinWait() { }
38+
void wait() { }
39+
void mark() {}
40+
};
41+
42+
#endif
43+
2944

3045
////////////////////////////////////////////////////////////////////////////////////////////
3146
//

0 commit comments

Comments
 (0)