diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2014-06-02 21:18:51 +0400 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2014-06-02 21:18:51 +0400 |
commit | 70ea308f624bd760a6b5540363dacf681bcda92c (patch) | |
tree | b0e42ecf282f3c7e2b1cc8859fb525d9794335d4 /noise.cpp | |
parent | bc82af3c413bbc8d301f8d9c477885cc0353d0fb (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.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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 |