Skip to content

Commit

Permalink
Fix 'narrowing' compiler errors on Teensy
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintYourDragon committed Jan 24, 2018
1 parent 44397a8 commit c53d8aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Adafruit_NeoPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,15 +2181,15 @@ void Adafruit_NeoPixel::clear() {
// It exploits features of GCC's preprocessor to generate a PROGMEM
// table (in flash memory) holding an 8-bit unsigned sine wave (0-255).
static const int _SBASE_ = __COUNTER__ + 1; // Index of 1st __COUNTER__ below
#define _S1_ (sin((__COUNTER__ - _SBASE_) / 128.0 * M_PI) + 1.0) * 127.5 + 0.5,
#define _S1_ (uint8_t)((sin((__COUNTER__-_SBASE_)/128.0*M_PI)+1.0)*127.5+0.5),
#define _S2_ _S1_ _S1_ _S1_ _S1_ _S1_ _S1_ _S1_ _S1_ // Expands to 8 items
#define _S3_ _S2_ _S2_ _S2_ _S2_ _S2_ _S2_ _S2_ _S2_ // Expands to 64 items
static const uint8_t PROGMEM _sineTable[] = { _S3_ _S3_ _S3_ _S3_ }; // 256

// Similar to above, but for an 8-bit gamma-correction table.
#define _GAMMA_ 2.6
static const int _GBASE_ = __COUNTER__ + 1; // Index of 1st __COUNTER__ below
#define _G1_ pow((__COUNTER__ - _GBASE_) / 255.0, _GAMMA_) * 255.0 + 0.5,
#define _G1_ (uint8_t)(pow((__COUNTER__-_GBASE_)/255.0,_GAMMA_)*255.0+0.5),
#define _G2_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ // Expands to 8 items
#define _G3_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ // Expands to 64 items
static const uint8_t PROGMEM _gammaTable[] = { _G3_ _G3_ _G3_ _G3_ }; // 256
Expand Down

0 comments on commit c53d8aa

Please sign in to comment.