@@ -22,29 +22,29 @@ uint8_t qsub8(uint8_t i, uint8_t j);
2222int8_t abs8 (int8_t i);
2323
2424typedef uint32_t TProgmemRGBPalette16[16 ];
25- typedef uint8_t TDynamicRGBGradientPalette_byte; // /< Byte of an RGB gradient entry, stored in dynamic (heap) memory
26- typedef const TDynamicRGBGradientPalette_byte *TDynamicRGBGradientPalette_bytes; // /< Pointer to bytes of an RGB gradient, stored in dynamic (heap) memory
27- typedef TDynamicRGBGradientPalette_bytes TDynamicRGBGradientPalettePtr; // /< Alias of ::TDynamicRGBGradientPalette_bytes
25+ typedef uint8_t TDynamicRGBGradientPalette_byte; // Byte of an RGB gradient entry, stored in dynamic (heap) memory
26+ typedef const TDynamicRGBGradientPalette_byte *TDynamicRGBGradientPalette_bytes; // Pointer to bytes of an RGB gradient, stored in dynamic (heap) memory
27+ typedef TDynamicRGBGradientPalette_bytes TDynamicRGBGradientPalettePtr; // Alias of ::TDynamicRGBGradientPalette_bytes
2828typedef const uint8_t TProgmemRGBGradientPalette_byte;
2929typedef const TProgmemRGBGradientPalette_byte *TProgmemRGBGradientPalette_bytes;
3030typedef TProgmemRGBGradientPalette_bytes TProgmemRGBGradientPalettePtr;
3131
32- // / Color interpolation options for palette
32+ // color interpolation options for palette
3333typedef enum {
34- NOBLEND=0 , // /< No interpolation between palette entries
35- LINEARBLEND=1 , // /< Linear interpolation between palette entries, with wrap-around from end to the beginning again
36- LINEARBLEND_NOWRAP=2 // /< Linear interpolation between palette entries, but no wrap-around
34+ NOBLEND=0 , // No interpolation between palette entries
35+ LINEARBLEND=1 , // Linear interpolation between palette entries, with wrap-around from end to the beginning again
36+ LINEARBLEND_NOWRAP=2 // Linear interpolation between palette entries, but no wrap-around
3737} TBlendType;
3838
3939typedef union {
4040 struct {
41- uint8_t index; // /< index of the color entry in the gradient
42- uint8_t r; // /< CRGB::red channel value of the color entry
43- uint8_t g; // /< CRGB::green channel value of the color entry
44- uint8_t b; // /< CRGB::blue channel value of the color entry
41+ uint8_t index; // index of the color entry in the gradient
42+ uint8_t r;
43+ uint8_t g;
44+ uint8_t b;
4545 };
46- uint32_t dword; // /< values as a packed 32-bit double word
47- uint8_t bytes[4 ]; // /< values as an array
46+ uint32_t dword; // values packed as 32-bit
47+ uint8_t bytes[4 ]; // values as an array
4848} TRGBGradientPaletteEntryUnion;
4949
5050// similar to NeoPixelBus NeoGammaTableMethod but allows dynamic changes (superseded by NPB::NeoGammaDynamicTableMethod)
@@ -122,11 +122,11 @@ struct CHSV {
122122 return raw[x];
123123 }
124124
125- // Default constructor
126- // @warning Default values are UNITIALIZED!
125+ // default constructor
126+ // @warning default values are UNITIALIZED!
127127 inline CHSV () __attribute__((always_inline)) = default;
128128
129- // /Allow construction from hue, saturation, and value
129+ // allow construction from hue, saturation, and value
130130 inline CHSV (uint8_t ih, uint8_t is, uint8_t iv) __attribute__((always_inline))
131131 : h(ih), s(is), v(iv) { }
132132
@@ -194,12 +194,12 @@ struct CRGB {
194194 hsv2rgb_rainbow (hue<<8 , sat, val, raw, false ); return *this ;
195195 }
196196
197- // Allow assignment from just a hue, sat and val are set to max
197+ // allow assignment from just a hue, sat and val are set to max
198198 inline CRGB& setHue (uint8_t hue) __attribute__((always_inline)) {
199199 hsv2rgb_rainbow (hue<<8 , 255 , 255 , raw, false ); return *this ;
200200 }
201201
202- // / Allow assignment from HSV color
202+ // allow assignment from HSV color
203203 inline CRGB& operator = (const CHSV& rhs) __attribute__((always_inline)) {
204204 hsv2rgb_rainbow (rhs.h <<8 , rhs.s , rhs.v , raw, false ); return *this ;
205205 }
@@ -214,23 +214,22 @@ struct CRGB {
214214 return *this ;
215215 }
216216
217- // / allow assignment from red, green, and blue
217+ // allow assignment from red, green, and blue
218218 inline CRGB& setRGB (uint8_t nr, uint8_t ng, uint8_t nb) __attribute__((always_inline)) {
219219 r = nr;
220220 g = ng;
221221 b = nb;
222222 return *this ;
223223 }
224224
225- // / Allow assignment from 32-bit (really 24-bit) 0xRRGGBB color code
225+ // allow assignment from 32-bit (really 24-bit) 0xRRGGBB color code
226226 inline CRGB& setColorCode (uint32_t colorcode) __attribute__((always_inline)) {
227227 r = R (colorcode);
228228 g = G (colorcode);
229229 b = B (colorcode);
230230 return *this ;
231231 }
232232
233-
234233 // add one CRGB to another, saturating at 0xFF for each channel
235234 inline CRGB& operator += (const CRGB& rhs) {
236235 r = qadd8 (r, rhs.r );
@@ -344,7 +343,7 @@ struct CRGB {
344343 return *this ;
345344 }
346345
347- // / Return a CRGB object that is a scaled down version of this object
346+ // return a CRGB object that is a scaled down version of this object
348347 inline CRGB scale8 (uint8_t scaledown) const {
349348 CRGB out = *this ;
350349 uint32_t scale_fixed = scaledown + 1 ;
@@ -354,7 +353,7 @@ struct CRGB {
354353 return out;
355354 }
356355
357- // / Return a CRGB object that is a scaled down version of this object
356+ // return a CRGB object that is a scaled down version of this object
358357 inline CRGB scale8 (const CRGB& scaledown) const {
359358 CRGB out;
360359 out.r = ::scale8 (r, scaledown.r );
@@ -363,8 +362,7 @@ struct CRGB {
363362 return out;
364363 }
365364
366- // / fadeToBlackBy is a synonym for nscale8(), as a fade instead of a scale
367- // / @param fadefactor the amount to fade, sent to nscale8() as (255 - fadefactor)
365+ // fadeToBlackBy is a synonym for nscale8(), as a fade instead of a scale
368366 inline CRGB& fadeToBlackBy (uint8_t fadefactor) {
369367 uint32_t scale_fixed = 256 - fadefactor;
370368 r = (((uint32_t )r) * scale_fixed) >> 8 ;
@@ -373,44 +371,42 @@ struct CRGB {
373371 return *this ;
374372 }
375373
376- // / "or" operator brings each channel up to the higher of the two values
374+ // "or" operator brings each channel up to the higher of the two values
377375 inline CRGB& operator |=(const CRGB& rhs) {
378376 if (rhs.r > r) r = rhs.r ;
379377 if (rhs.g > g) g = rhs.g ;
380378 if (rhs.b > b) b = rhs.b ;
381379 return *this ;
382380 }
383381
384- // / @copydoc operator|=
385382 inline CRGB& operator |=(uint8_t d) {
386383 if (d > r) r = d;
387384 if (d > g) g = d;
388385 if (d > b) b = d;
389386 return *this ;
390387 }
391388
392- // / "and" operator brings each channel down to the lower of the two values
389+ // "and" operator brings each channel down to the lower of the two values
393390 inline CRGB& operator &=(const CRGB& rhs) {
394391 if (rhs.r < r) r = rhs.r ;
395392 if (rhs.g < g) g = rhs.g ;
396393 if (rhs.b < b) b = rhs.b ;
397394 return *this ;
398395 }
399396
400- // / @copydoc operator&=
401397 inline CRGB& operator &=(uint8_t d) {
402398 if (d < r) r = d;
403399 if (d < g) g = d;
404400 if (d < b) b = d;
405401 return *this ;
406402 }
407403
408- // / This allows testing a CRGB for zero-ness
404+ // this allows testing a CRGB for zero-ness
409405 inline explicit operator bool () const __attribute__((always_inline)) {
410406 return r || g || b;
411407 }
412408
413- // / Converts a CRGB to a 32-bit color with white = 0
409+ // converts a CRGB to a 32-bit color with white = 0
414410 inline explicit operator uint32_t () const {
415411 return (uint32_t {r} << 16 ) |
416412 (uint32_t {g} << 8 ) |
@@ -662,7 +658,7 @@ class CRGBPalette16 {
662658 const uint8_t * p = (const uint8_t *)(&(this ->entries [0 ]));
663659 const uint8_t * q = (const uint8_t *)(&(rhs.entries [0 ]));
664660 if (p == q) return true ;
665- for (int i = 0 ; i < (sizeof (entries)); ++i) {
661+ for (unsigned i = 0 ; i < (sizeof (entries)); ++i) {
666662 if (*p != *q) return false ;
667663 ++p;
668664 ++q;
@@ -736,24 +732,24 @@ class CRGBPalette16 {
736732 TRGBGradientPaletteEntryUnion u;
737733
738734 // Count entries
739- uint32_t count = 0 ;
735+ int count = 0 ;
740736 do {
741737 u.dword = *(const uint32_t *)(progent + count);
742738 ++count;
743739 } while (u.index != 255 );
744740
745- int32_t lastSlotUsed = -1 ;
741+ int lastSlotUsed = -1 ;
746742
747743 u.dword = *(const uint32_t *)(progent);
748744 CRGB rgbstart (u.r , u.g , u.b );
749745
750- uint32_t indexstart = 0 ;
751- uint32_t istart8 = 0 ;
752- uint32_t iend8 = 0 ;
746+ int indexstart = 0 ;
747+ int istart8 = 0 ;
748+ int iend8 = 0 ;
753749 while (indexstart < 255 ) {
754750 ++progent;
755751 u.dword = *(const uint32_t *)(progent);
756- uint32_t indexend = u.index ;
752+ int indexend = u.index ;
757753 CRGB rgbend (u.r , u.g , u.b );
758754 istart8 = indexstart / 16 ;
759755 iend8 = indexend / 16 ;
@@ -779,20 +775,20 @@ class CRGBPalette16 {
779775 TRGBGradientPaletteEntryUnion u;
780776
781777 // Count entries
782- uint16_t count = 0 ;
778+ unsigned count = 0 ;
783779 do {
784780 u = *(ent + count);
785781 ++count;
786782 } while (u.index != 255 );
787783
788- int8_t lastSlotUsed = -1 ;
784+ int lastSlotUsed = -1 ;
789785
790786 u = *ent;
791787 CRGB rgbstart (u.r , u.g , u.b );
792788
793789 int indexstart = 0 ;
794- uint8_t istart8 = 0 ;
795- uint8_t iend8 = 0 ;
790+ int istart8 = 0 ;
791+ int iend8 = 0 ;
796792 while (indexstart < 255 ) {
797793 ++ent;
798794 u = *ent;
0 commit comments