diff options
author | Mark Kriegsman <kriegsman@tr.org> | 2016-01-07 23:08:23 +0300 |
---|---|---|
committer | Mark Kriegsman <kriegsman@tr.org> | 2016-01-07 23:08:23 +0300 |
commit | 2e48c08b24bf56e969145318c1bf7b04333d1953 (patch) | |
tree | c282fde76080915f9f41b3e164ebc190d18faa1c | |
parent | 0f146d5542ad77037b9954fd05843c6526878574 (diff) | |
parent | 1ec83d92272552361623baeba51dcc7c88b16fde (diff) |
Merge branch 'master' of https://github.com/FastLED/FastLED
-rw-r--r-- | FastLED.cpp | 6 | ||||
-rw-r--r-- | FastLED.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/FastLED.cpp b/FastLED.cpp index af92429e..c31f9296 100644 --- a/FastLED.cpp +++ b/FastLED.cpp @@ -114,14 +114,18 @@ void CFastLED::clearData() { void CFastLED::delay(unsigned long ms) { unsigned long start = millis(); - while((millis()-start) < ms) { + do { #ifndef FASTLED_ACCURATE_CLOCK // make sure to allow at least one ms to pass to ensure the clock moves // forward ::delay(1); #endif show(); +#if defined(ARDUINO) && (ARDUINO > 150) + yield(); +#endif } + while((millis()-start) < ms) { } void CFastLED::setTemperature(const struct CRGB & temp) { @@ -442,7 +442,8 @@ public: void showColor(const struct CRGB & color) { showColor(color, m_Scale); } /// Delay for the given number of milliseconds. Provided to allow the library to be used on platforms - /// that don't have a delay function (to allow code to be more portable) + /// that don't have a delay function (to allow code to be more portable). Note: this will call show + /// constantly to drive the dithering engine (and will call show at least once). /// @param ms the number of milliseconds to pause for void delay(unsigned long ms); |