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

◆ commit()

template<fl::size DescriptorCount, fl::size ArenaSize>
void fl::AsyncLogQueue< DescriptorCount, ArenaSize >::commit ( )

Consumer: Commit the popped message to free space (main thread only)

Definition at line 71 of file async_log_queue.cpp.hpp.

71 {
74
75 // Free arena space by advancing arena tail
76 fl::u32 newArenaTail = (mArenaTail + desc.mLength) & (ArenaSize - 1);
77
78 {
79 fl::isr::critical_section cs; // Protect arena tail update
81 }
82
83 // Clear descriptor (optional, for debugging/sentinel semantics)
85
86 // Advance tail (consumer publishes completion)
87 fl::u32 newTail = (tail + 1) & (DescriptorCount - 1);
88
89 {
90 fl::isr::critical_section cs; // Protect tail update
91 mTail = newTail;
92 }
93}
volatile fl::u32 mTail
Consumer read position (descriptor ring)
Descriptor mDescriptors[DescriptorCount]
Ring of message descriptors.
volatile fl::u32 mArenaTail
Consumer read position (arena)
High-performance SPSC async log queue.
Descriptor for one log message.