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-07 10:05:09 +0400
committerDaniel Garcia <danielgarcia@gmail.com>2014-06-07 10:05:09 +0400
commit14a228f960e7b28653bb13ccf65fa2ca31663157 (patch)
tree3e7f0ad70b9fcb767ce2a45dc060898016a36670 /controller.h
parenta4323c3d94faafbfa2bfc0d8ec26f40769132e0a (diff)
parent4ac475b57b12cbb2f5eb48d376e250caeaac28f0 (diff)
Merge from FastLED2.1
Diffstat (limited to 'controller.h')
-rw-r--r--controller.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/controller.h b/controller.h
index b9912291..1dbc5751 100644
--- a/controller.h
+++ b/controller.h
@@ -32,7 +32,7 @@ typedef uint8_t EDitherMode;
class CLEDController {
protected:
friend class CFastLED;
- const CRGB *m_Data;
+ CRGB *m_Data;
CLEDController *m_pNext;
CRGB m_ColorCorrection;
CRGB m_ColorTemperature;
@@ -96,7 +96,7 @@ public:
}
#endif
- CLEDController & setLeds(const CRGB *data, int nLeds) {
+ CLEDController & setLeds(CRGB *data, int nLeds) {
m_Data = data;
m_nLeds = nLeds;
return *this;
@@ -108,6 +108,15 @@ public:
}
}
+ // How many leds does this controller manage?
+ int size() { return m_nLeds; }
+
+ // Pointer to the CRGB array for this controller
+ CRGB* leds() { return m_Data; }
+
+ // Reference to the n'th item in the controller
+ CRGB &operator[](int x) { return m_Data[x]; }
+
inline CLEDController & setDither(uint8_t ditherMode = BINARY_DITHER) { m_DitherMode = ditherMode; return *this; }
inline uint8_t getDither() { return m_DitherMode; }