TLIGHT_PRODUCTS / WS281X

Files at this revision

API Documentation at this revision

Comitter:
mutech
Date:
Wed Jul 27 14:42:36 2016 +0000
Parent:
1:0288c920499c
Child:
3:786b31c65e7a
Commit message:
WS2811/WS2812 Library;

Changed in this revision

ColorLib.h Show annotated file Show diff for this revision Revisions of this file
WS281X.cpp Show annotated file Show diff for this revision Revisions of this file
WS281X.h Show annotated file Show diff for this revision Revisions of this file
--- a/ColorLib.h	Wed Jul 27 08:12:04 2016 +0000
+++ b/ColorLib.h	Wed Jul 27 14:42:36 2016 +0000
@@ -252,13 +252,6 @@
         return *this;
     }
 
-    operator RGBColor()
-    {
-        RGBColor rgb;
-        hsv2rgb(*this, rgb);
-        return rgb;
-    }
-
 };
 
 //----------------------------------------------------------------------------
--- a/WS281X.cpp	Wed Jul 27 08:12:04 2016 +0000
+++ b/WS281X.cpp	Wed Jul 27 14:42:36 2016 +0000
@@ -173,16 +173,16 @@
 #if defined(TARGET_STM32F7)
 // DISCO-F746NG (216MHz), NUCLEO-F746ZG (216MHz)
 #define T0H             (35)
-#define T0L             (128-T0H)
+#define T0L             (125-T0H)
 #define T1H             (100)
-#define T1L             (128-T1H)
+#define T1L             (125-T1H)
 
 #define DELAY_T0H()     _delay(T0H)
 #define DELAY_T1H()     _delay(T1H-T0H)
 #define DELAY_TLOW()    _delay(T1L)
 #define DELAY_TLOW2()   //DELAY_TLOW()
 #define DELAY_SPACE()   DELAY_TLOW()
-#define DELAY_NEXT()    _delay(35)
+#define DELAY_NEXT()    _delay(30)
 
 inline __attribute__((always_inline))
 void WS281X::_delay(int value)
@@ -329,14 +329,14 @@
 }
 
 // 指定色でバッファを埋める
-void WS281X::clear(uint32_t color)
+void WS281X::clear(RGBColor color)
 {
     _pixels[0] = color;
     repeatBlock(1);
 }
 
 // 指定色でバッファを埋めた後表示
-void WS281X::show(uint32_t color)
+void WS281X::show(RGBColor color)
 {
     clear(color);
     show();
--- a/WS281X.h	Wed Jul 27 08:12:04 2016 +0000
+++ b/WS281X.h	Wed Jul 27 14:42:36 2016 +0000
@@ -59,21 +59,21 @@
     void setRGBOrder(RGBOrder rgbOrder = WS281X::RGB);
 
     void repeatBlock(int block_size);
-    void clear(uint32_t color = 0);
-    void clear(RGBColor color) { clear((uint32_t)color); }
+    void clear(RGBColor color);
+    void clear(uint32_t color = 0) { clear((RGBColor)color); }
 
     void show();
-    void show(uint32_t color);
-    void show(RGBColor color) { show((uint32_t)color); }
+    void show(RGBColor color);
+    void show(uint32_t color) { show((RGBColor)color); }
 
-    inline RGBColor operator[](int index) const
+    RGBColor operator[](int index) const
     {
         if ((uint16_t)index < _numPixels)
             return _pixels[index];
         return _dummyPixel;
     }
 
-    inline RGBColor& operator[](int index)
+    RGBColor& operator[](int index)
     {
         if ((uint16_t)index < _numPixels)
             return _pixels[index];
@@ -89,8 +89,8 @@
     int _1st, _2nd, _3rd;
 
     uint16_t _numPixels;
+    RGBColor *_pixels;
     RGBColor _dummyPixel;
-    RGBColor *_pixels;
 
 #if defined(TARGET_NXP)
     typedef uint32_t regsize_t;