MCPcopy Create free account
hub / github.com/FastLED/FastLED / notify_one

Method notify_one

src/platforms/esp/32/condition_variable_esp32.cpp.hpp:86–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void ConditionVariableESP32::notify_one() FL_NOEXCEPT {
87 if (mMutex == nullptr || mWaitQueue == nullptr) {
88 return;
89 }
90
91 SemaphoreHandle_t mutex = static_cast<SemaphoreHandle_t>(mMutex);
92 QueueHandle_t queue = static_cast<QueueHandle_t>(mWaitQueue);
93
94 // Lock internal mutex
95 xSemaphoreTake(mutex, portMAX_DELAY);
96
97 // Try to dequeue one waiting task
98 WaitingTask waiter;
99 if (xQueueReceive(queue, &waiter, 0) == pdTRUE) {
100 // Mark as notified and wake the task
101 waiter.notified = true;
102 xTaskNotifyGive(waiter.task);
103 }
104
105 // Unlock internal mutex
106 xSemaphoreGive(mutex);
107}
108
109void ConditionVariableESP32::notify_all() FL_NOEXCEPT {
110 if (mMutex == nullptr || mWaitQueue == nullptr) {

Callers 2

FL_TEST_FILEFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected