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-12-09 22:13:10 +0300
committerDaniel Garcia <danielgarcia@gmail.com>2015-12-09 22:13:10 +0300
commit7e152ff3f5ff8f4c3d97f8f9cff90e38e2d86ff8 (patch)
tree0805367d3caaa9e67e19c70110226b37cf928f3f /pixelset.h
parentebfccf2415397a68f786f32ebc6505f84297dbc1 (diff)
Add CRGBArray for defining the leds - preferred method to the normal array, now.
Diffstat (limited to 'pixelset.h')
-rw-r--r--pixelset.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/pixelset.h b/pixelset.h
index 759a905c..81c34144 100644
--- a/pixelset.h
+++ b/pixelset.h
@@ -190,6 +190,16 @@ public:
}
};
+__attribute__((always_inline))
+inline CRGB *operator+(const CPixelSet & pixels, int offset) { return (CRGB*)pixels + offset; }
+
typedef CPixelSet CRGBSet;
+template<int SIZE>
+class CRGBArray : public CPixelSet {
+ CRGB rawleds[SIZE];
+public:
+ CRGBArray() : CPixelSet(rawleds, SIZE) {}
+};
+
#endif