FastLED 3.10.8
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 880 of file channel.cpp.hpp.

880 {
881 FL_WARN("Channel '" << mName << "': showPixels() called while mChannelData is in use by driver, attempting to wait");
882 auto driver = mDriver.lock();
883 if (!driver) {
884 FL_ERROR("Channel '" << mName << "': No driver bound yet the mChannelData is in use - cannot transmit");
885 return false;
886 }
887 // wait until the driver is in a READY state.
888 bool ok = driver->waitForReady();
889 if (!ok) {
890 FL_ERROR("Channel '" << mName << "': Timeout occurred while waiting for driver to become READY");
891 return false;
892 }
893 FL_WARN("Channel '" << mName << "': Engine became READY after waiting");
894 return true;
895}
fl::weak_ptr< IChannelDriver > mDriver
Definition channel.h:433
fl::string mName
Definition channel.h:456
#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: