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:
Diffstat (limited to 'platforms/arm/k20/octows2811_controller.h')
-rw-r--r--platforms/arm/k20/octows2811_controller.h38
1 files changed, 5 insertions, 33 deletions
diff --git a/platforms/arm/k20/octows2811_controller.h b/platforms/arm/k20/octows2811_controller.h
index ed748919..ce959228 100644
--- a/platforms/arm/k20/octows2811_controller.h
+++ b/platforms/arm/k20/octows2811_controller.h
@@ -8,7 +8,7 @@
FASTLED_NAMESPACE_BEGIN
template<EOrder RGB_ORDER = GRB, boolean SLOW=false>
-class COctoWS2811Controller : public CLEDController {
+class COctoWS2811Controller : public CPixelLEDController<RGB_ORDER, 8, 0xFF> {
OctoWS2811 *pocto;
uint8_t *drawbuffer,*framebuffer;
@@ -34,45 +34,16 @@ public:
virtual void init() { /* do nothing yet */ }
- virtual void clearLeds(int nLeds) {
- _init(nLeds);
- showColor(CRGB(0,0,0),nLeds,CRGB(0,0,0));
- }
-
- virtual void showColor(const struct CRGB & data, int nLeds, CRGB scale) {
- _init(nLeds);
- // Get our pixel values
- PixelController<RGB_ORDER> pixels(data, nLeds, scale, getDither());
- uint8_t ball[3][8];
- memset(ball[0],pixels.loadAndScale0(),8);
- memset(ball[1],pixels.loadAndScale1(),8);
- memset(ball[2],pixels.loadAndScale2(),8);
-
- uint8_t bout[24];
- transpose8x1_MSB(ball[0],bout);
- transpose8x1_MSB(ball[1],bout+8);
- transpose8x1_MSB(ball[2],bout+16);
-
- uint8_t *pdata = drawbuffer;
- while(nLeds--) {
- memcpy(pdata,bout,24);
- pdata += 24;
- }
-
- pocto->show();
- }
-
typedef union {
uint8_t bytes[8];
uint32_t raw[2];
} Lines;
- virtual void show(const struct CRGB *rgbdata, int nLeds, CRGB scale) {
- _init(nLeds);
- MultiPixelController<8,0xFF,RGB_ORDER> pixels(rgbdata,nLeds, scale, getDither() );
+ virtual void showPixels(PixelController<RGB_ORDER, 8, 0xFF> & pixels) {
+ _init(pixels.size());
uint8_t *pData = drawbuffer;
- while(nLeds--) {
+ while(pixels.has(1)) {
Lines b;
for(int i = 0; i < 8; i++) { b.bytes[i] = pixels.loadAndScale0(i); }
@@ -87,6 +58,7 @@ public:
pocto->show();
}
+
};
FASTLED_NAMESPACE_END