FastLED NeoPixel v1.0.3
Loading...
Searching...
No Matches
Unimplemented Functions

These are the functions that are present in Adafruit_NeoPixel but for technical reasons are missing in this implementation. More...

Functions

void FastLED_NeoPixel_Variant::setPin (uint16_t p)
 
void FastLED_NeoPixel_Variant::updateType (neoPixelType T)
 

Detailed Description

These are the functions that are present in Adafruit_NeoPixel but for technical reasons are missing in this implementation.

All of these functions are declared but not defined. Attempting to use them will create a compile-time error.

Unlike the Adafruit_NeoPixel library the FastLED library uses compile-time constants for optimization purposes. Because of this it's not easy to change LED settings such as the strip type, color order, or data pin on the fly.

Because these arguments must be known at compile-time it's not possible to use a simple member function to set them. The functions would need to use a template parameter instead of an argument, which isn't the end of the world but it breaks the "no modifications to your sketch" purpose of the library.

The more significant complications is that the CLEDController objects which send data to the strips are defined within a linked list using the FastLED.addLeds() function. These objects have static storage duration, so defining multiple controllers for the same strip will create a memory leak. It may also cause a slowdown of the code, as calling FastLED.show() will send the data to all CLEDController objects regardless of whether they're currently in use or not.

It is possible to work around this by declaring a CLEDController object without calling the FastLED.addLeds function. This will avoid static storage duration and will avoid the memory leak / slowdown issues. The downside is that the strip will not work with FastLED.show() and the other linked list functions. The function to build the CLEDController would also have to be templated, which means all of the values would need to be passed together in a single function. At that point it's simpler for the user to create the controller themselves and pass it to the existing FastLED_NeoPixel_Variant::begin(CLEDController&) function.

Function Documentation

◆ setPin()

void FastLED_NeoPixel_Variant::setPin ( uint16_t  p)

UNIMPLEMENTED: Changes the output pin

FastLED uses compile-time pin definitions so that the optimized data latching code is only included for the pins used. This is a run-time function and the arguments are not known at compile-time.

See also
Adafruit_NeoPixel::setPin(uint16_t)

◆ updateType()

void FastLED_NeoPixel_Variant::updateType ( neoPixelType  T)

UNIMPLEMENTED: Changes the pixel format of the strip

The strip's color order is required at compile-time. Changing it during the program would require rebuilding the CLEDController object with all necessary compile-time constants.