FastLED 3.9.15
Loading...
Searching...
No Matches

◆ onQueuingDone()

bool fl::RectangularDrawBuffer::onQueuingDone ( )

Definition at line 49 of file rectangular_draw_buffer.cpp.

49 {
50 if (mQueueState == QUEUE_DONE) {
51 return false;
52 }
55 // iterator through the current draw objects and calculate the total
56 // number of bytes (representing RGB or RGBW) that will be drawn this frame.
57 u32 total_bytes = 0;
58 u32 max_bytes_in_strip = 0;
59 u32 num_strips = 0;
60 getBlockInfo(&num_strips, &max_bytes_in_strip, &total_bytes);
61 if (total_bytes > mAllLedsBufferUint8Size) {
62 u8 *old_ptr = mAllLedsBufferUint8.release();
64 u8 *ptr = fl::PSRamAllocator<u8>::Alloc(total_bytes);
65 mAllLedsBufferUint8.reset(ptr);
66 }
67 mAllLedsBufferUint8Size = total_bytes;
68 u32 offset = 0;
69 for (auto it = mDrawList.begin(); it != mDrawList.end(); ++it) {
70 u8 pin = it->mPin;
72 max_bytes_in_strip);
73 mPinToLedSegment[pin] = slice;
74 offset += max_bytes_in_strip;
75 }
76 return true;
77}
static T * Alloc(fl::size n)
Definition allocator.h:44
static void Free(T *p)
Definition allocator.h:49
fl::FixedMap< u8, fl::span< u8 >, 50 > mPinToLedSegment
void getBlockInfo(u32 *num_strips, u32 *bytes_per_strip, u32 *total_bytes) const
UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
unsigned char u8
Definition int.h:17
Slice< T > span
Definition span.h:8

References fl::PSRamAllocator< T >::Alloc(), fl::PSRamAllocator< T >::Free(), getBlockInfo(), mAllLedsBufferUint8, mAllLedsBufferUint8Size, mDrawList, mDrawListChangedThisFrame, mPinToLedSegment, mPrevDrawList, mQueueState, offset(), and QUEUE_DONE.

+ Here is the call graph for this function: