1#define FASTLED_INTERNAL
11#ifndef MAX_CLED_CONTROLLERS
14#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega32U4__)
15#define MAX_CLED_CONTROLLERS 16
17#define MAX_CLED_CONTROLLERS 8
20#define MAX_CLED_CONTROLLERS 64
24#ifndef FASTLED_MANUAL_ENGINE_EVENTS
25#define FASTLED_MANUAL_ENGINE_EVENTS 0
28#if defined(__SAM3X8E__)
29volatile fl::u32 fuckit;
47#ifndef FASTLED_NO_ATEXIT
48#define FASTLED_NO_ATEXIT 0
52extern "C" __attribute__((weak))
int atexit(
void (* )()) {
return 0; }
55#ifdef FASTLED_NEEDS_YIELD
56extern "C" void yield(
void) { }
103 return (*
this)[0].size();
107 return (*
this)[0].leds();
112 int nLedsOrOffset,
int nLedsIfOffset) {
113 int nOffset = (nLedsIfOffset > 0) ? nLedsOrOffset : 0;
114 int nLeds = (nLedsIfOffset > 0) ? nLedsIfOffset : nLedsOrOffset;
117 pLed->
setLeds(data + nOffset, nLeds);
132#if !FASTLED_MANUAL_ENGINE_EVENTS
178#if !FASTLED_MANUAL_ENGINE_EVENTS
268 unsigned long start = millis();
270#ifndef FASTLED_ACCURATE_CLOCK
278 while((millis()-start) < ms);
358 static fl::u32 lastframe = 0;
360 if(br++ >= nFrames) {
361 fl::u32 now = millis();
366 m_nFPS = (br * 1000) / now;
368 lastframe = millis();
379 }
else if(refresh > 0) {
388 return FastLED.getBrightness();
396 #if !defined(ESP8266) && !defined(ESP32)
397 extern "C" void __cxa_pure_virtual (
void) {}
403 __extension__
typedef int __guard __attribute__((mode(__DI__)));
405 extern "C" int __cxa_guard_acquire (__guard *) __attribute__((weak));
406 extern "C" void __cxa_guard_release (__guard *) __attribute__((weak));
407 extern "C" void __cxa_guard_abort (__guard *) __attribute__((weak));
409 extern "C" int __cxa_guard_acquire (__guard *g)
411 return !*(
char *)(g);
414 extern "C" void __cxa_guard_release (__guard *g)
419 extern "C" void __cxa_guard_abort (__guard *)
#define MAX_CLED_CONTROLLERS
void * pSmartMatrix
Pointer to the matrix object when using the Smart Matrix Library.
fl::u32 _retry_cnt
Global frame retry counter, used for debugging ESP implementations.
static void * gControllersData[MAX_CLED_CONTROLLERS]
FASTLED_NAMESPACE_BEGIN fl::u16 cled_contoller_size()
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
int noise_max
Unused value.
fl::u32 _frame_cnt
Global frame counter, used for debugging ESP implementations.
int noise_min
Unused value.
CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
int size()
Get the number of leds in the first controller.
CRGB * leds()
Get a pointer to led data for the first controller.
void setTemperature(const struct CRGB &temp)
Set a global color temperature.
void setMaxRefreshRate(fl::u16 refresh, bool constrain=false)
Set the maximum refresh rate.
void show()
Update all our controllers with the current led colors.
void showColor(const struct CRGB &color, fl::u8 scale)
Set all leds on all controllers to the given color/scale.
power_func m_pPowerFunc
function for overriding brightness when using FastLED.show();
fl::u32 m_nPowerData
max power use parameter
void countFPS(int nFrames=25)
For debugging, this will keep track of time between calls to countFPS().
CLEDController & operator[](int x)
Get a reference to a registered controller.
fl::u8 m_Scale
the current global brightness scale setting
void delay(unsigned long ms)
Delay for the given number of milliseconds.
fl::u32 m_nMinMicros
minimum µs between frames, used for capping frame rates
void setDither(fl::u8 ditherMode=BINARY_DITHER)
Set the dithering mode.
void clearData()
Clear out the local data array.
void setCorrection(const struct CRGB &correction)
Set a global color correction.
int count()
Get how many controllers have been registered.
void clear(bool writeData=false)
Clear the leds, wiping the local array of data.
fl::u16 m_nFPS
tracking for current frames per second (FPS) value
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
High level controller interface for FastLED.
CLEDController * next()
Get the next controller in the linked list after this one.
static CLEDController * m_pHead
pointer to the first LED controller in the linked list
virtual void endShowLeds(void *data)
virtual int size()
How many LEDs does this controller manage?
void showColorInternal(const struct CRGB &data, int nLeds, fl::u8 brightness)
CLEDController & setLeds(CRGB *data, int nLeds)
Set the default array of LEDs to be used by this controller.
CLEDController & setCorrection(CRGB correction)
The color corrction to use for this controller, expressed as a CRGB object.
static CLEDController * head()
Get the first LED controller in the linked list of controllers.
CLEDController & setTemperature(CRGB temperature)
Set the color temperature, aka white point, for this controller.
static CLEDController * m_pTail
pointer to the last LED controller in the linked list
void clearLedDataInternal(int nLeds=-1)
Zero out the LED data managed by this controller.
virtual fl::u16 getMaxRefreshRate() const
Gets the maximum possible refresh rate of the strip.
void showLedsInternal(fl::u8 brightness)
Write the data to the LEDs managed by this controller.
virtual void init()=0
Initialize the LED controller.
CLEDController & setDither(fl::u8 ditherMode=BINARY_DITHER)
Set the dithering mode for this controller to use.
virtual void * beginShowLeds(int size)
Base definition for an LED controller.
static void onStripAdded(CLEDController *strip, fl::u32 num_leds)
static void onBeginFrame()
static void onEndShowLeds()
#define FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP
UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)
#define FASTLED_NAMESPACE_END
#define FASTLED_NAMESPACE_BEGIN
Representation of an RGB pixel (Red, Green, Blue)