FastLED 3.10.10
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 917 of file channel.cpp.hpp.

917 {
918 FL_WARN("Channel '" << mName << "': showPixels() called while mChannelData is in use by driver, attempting to wait");
919 auto driver = mDriver.lock();
920 if (!driver) {
921 FL_ERROR("Channel '" << mName << "': No driver bound yet the mChannelData is in use - cannot transmit");
922 return false;
923 }
924 // wait until the driver is in a READY state.
925 bool ok = driver->waitForReady();
926 if (!ok) {
927 FL_ERROR("Channel '" << mName << "': Timeout occurred while waiting for driver to become READY");
928 return false;
929 }
930 FL_WARN("Channel '" << mName << "': Engine became READY after waiting");
931 return true;
932}
fl::weak_ptr< IChannelDriver > mDriver
Definition channel.h:435
fl::string mName
Definition channel.h:453
#define FL_WARN(...)
Definition log.h:437
#define FL_ERROR(...)
Definition log.h:373

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

Referenced by showPixels().

+ Here is the caller graph for this function: