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:
authorDaniel Garcia <danielgarcia@gmail.com>2015-08-19 20:04:23 +0300
committerDaniel Garcia <danielgarcia@gmail.com>2015-08-19 20:04:23 +0300
commit26aaa822160790ac8200a5ee9294466073d430f7 (patch)
tree890c0317282b4fcbaa9c35a4290dd0de65935cbe
parentc5b261d6a244980e900a37e8c0bce4d10255ed55 (diff)
If re-attempting a show right after an interrupt interrupts things, make sure we wait the gap to minimize led flickering.
-rw-r--r--examples/Fire2012/Fire2012.ino5
-rw-r--r--platforms/arm/nrf51/clockless_arm_nrf51.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/Fire2012/Fire2012.ino b/examples/Fire2012/Fire2012.ino
index e65982a8..a1a8088f 100644
--- a/examples/Fire2012/Fire2012.ino
+++ b/examples/Fire2012/Fire2012.ino
@@ -1,8 +1,9 @@
+#define FASTLED_ALLOW_INTERRUPTS 1
#include <FastLED.h>
#define LED_PIN 5
#define COLOR_ORDER GRB
-#define CHIPSET WS2811
+#define CHIPSET WS2811_400
#define NUM_LEDS 30
#define BRIGHTNESS 200
@@ -21,7 +22,7 @@ void setup() {
void loop()
{
// Add entropy to random number generator; we use a lot of it.
- random16_add_entropy( random());
+ // random16_add_entropy( random());
Fire2012(); // run simulation frame
diff --git a/platforms/arm/nrf51/clockless_arm_nrf51.h b/platforms/arm/nrf51/clockless_arm_nrf51.h
index f365814f..4d0f89dd 100644
--- a/platforms/arm/nrf51/clockless_arm_nrf51.h
+++ b/platforms/arm/nrf51/clockless_arm_nrf51.h
@@ -47,6 +47,7 @@ public:
// attempt to re-show a frame if we exit early because of interrupts.
if(!showRGBInternal(pixels)) {
+ sei(); delayMicroseconds(WAIT_TIME); cli();
showRGBInternal(pixels);
}
@@ -60,6 +61,7 @@ public:
cli();
if(!showRGBInternal(pixels)) {
+ sei(); delayMicroseconds(WAIT_TIME); cli();
showRGBInternal(pixels);
}