Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kriegsman <kriegsman@tr.org>2016-01-07 23:08:23 +0300
committerMark Kriegsman <kriegsman@tr.org>2016-01-07 23:08:23 +0300
commit2e48c08b24bf56e969145318c1bf7b04333d1953 (patch)
treec282fde76080915f9f41b3e164ebc190d18faa1c
parent0f146d5542ad77037b9954fd05843c6526878574 (diff)
parent1ec83d92272552361623baeba51dcc7c88b16fde (diff)
Merge branch 'master' of https://github.com/FastLED/FastLED
-rw-r--r--FastLED.cpp6
-rw-r--r--FastLED.h3
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) {
diff --git a/FastLED.h b/FastLED.h
index 376c705d..496411a1 100644
--- a/FastLED.h
+++ b/FastLED.h
@@ -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);