FastLED 3.10.6
Loading...
Searching...
No Matches

◆ waitForInUseBuffer()

bool fl::Channel::waitForInUseBuffer ( )
private

Cold helper for showPixels() when mChannelData is still in use by the driver: warns and waits for READY (#4566).

Returns
false if showPixels() must drop the frame

Definition at line 857 of file channel.cpp.hpp.

857 {
858 FL_WARN("Channel '%s': showPixels() called while mChannelData is in use by driver, attempting to wait", mName);
859 auto driver = mDriver.lock();
860 if (!driver) {
861 FL_ERROR("Channel '%s': No driver bound yet the mChannelData is in use - cannot transmit", mName);
862 return false;
863 }
864 // wait until the driver is in a READY state.
865 bool ok = driver->waitForReady();
866 if (!ok) {
867 FL_ERROR("Channel '%s': Timeout occurred while waiting for driver to become READY", mName);
868 return false;
869 }
870 FL_WARN("Channel '%s': Engine became READY after waiting", mName);
871 return true;
872}
fl::weak_ptr< IChannelDriver > mDriver
Definition channel.h:411
fl::string mName
Definition channel.h:434
#define FL_WARN(...)
Definition log.h:440
#define FL_ERROR(...)
Definition log.h:372

References FL_ERROR, fl::FL_NO_EXCEPT, FL_WARN, mDriver, and mName.

Referenced by showPixels().

+ Here is the caller graph for this function: