mirror of
https://github.com/esphome/esphome.git
synced 2025-08-09 11:57:46 +00:00
Merge branch 'extract_helpers' into integration
This commit is contained in:
commit
17ddc9ee0c
@ -18,8 +18,12 @@ template<class T, uint8_t SIZE> class EventPool {
|
||||
~EventPool() {
|
||||
// Clean up any remaining events in the free list
|
||||
T *event;
|
||||
RAMAllocator<T> allocator(RAMAllocator<T>::ALLOC_INTERNAL);
|
||||
while ((event = this->free_list_.pop()) != nullptr) {
|
||||
delete event;
|
||||
// Call destructor
|
||||
event->~T();
|
||||
// Deallocate using RAMAllocator
|
||||
allocator.deallocate(event, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,9 @@ template<class T, uint8_t SIZE> class LockFreeQueue {
|
||||
return next_tail == head_.load(std::memory_order_acquire);
|
||||
}
|
||||
|
||||
// Set the FreeRTOS task handle to notify when items are pushed to the queue
|
||||
// This enables efficient wake-up of a consumer task that's waiting for data
|
||||
// @param task The FreeRTOS task handle to notify, or nullptr to disable notifications
|
||||
void set_task_to_notify(TaskHandle_t task) { task_to_notify_ = task; }
|
||||
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user