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>2014-06-02 21:18:51 +0400
committerDaniel Garcia <danielgarcia@gmail.com>2014-06-02 21:18:51 +0400
commit70ea308f624bd760a6b5540363dacf681bcda92c (patch)
treeb0e42ecf282f3c7e2b1cc8859fb525d9794335d4 /noise.cpp
parentbc82af3c413bbc8d301f8d9c477885cc0353d0fb (diff)
Here, have some more memory. PROGMEM has some cost, but getting 257 bytes of ram back is more important.
Diffstat (limited to 'noise.cpp')
-rw-r--r--noise.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/noise.cpp b/noise.cpp
index 1117c2b6..6d2db292 100644
--- a/noise.cpp
+++ b/noise.cpp
@@ -1,6 +1,16 @@
#include <FastLED.h>
+#include <avr/pgmspace.h>
-static uint8_t p[] = { 151,160,137,91,90,15,
+#define USE_PROGMEM
+#ifdef USE_PROGMEM
+#define FL_PROGMEM PROGMEM
+#define P(x) pgm_read_byte_near(p + x)
+#else
+#define FL_PROGMEM
+#define P(x) p[(x)]
+#endif
+
+PROGMEM static uint8_t p[] = { 151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
@@ -14,7 +24,6 @@ static uint8_t p[] = { 151,160,137,91,90,15,
49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,151
};
-#define P(x) p[(x)]
//
// #define FADE_12