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

Method release

src/platforms/esp/32/semaphore_esp32.cpp.hpp:66–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65template<ptrdiff_t LeastMaxValue>
66void CountingSemaphoreESP32<LeastMaxValue>::release(ptrdiff_t update) {
67 FL_ASSERT(update >= 0, "CountingSemaphoreESP32: release update must be non-negative");
68 FL_ASSERT(mHandle != nullptr, "CountingSemaphoreESP32::release() called on null semaphore");
69
70 SemaphoreHandle_t handle = static_cast<SemaphoreHandle_t>(mHandle);
71
72 // Release the semaphore 'update' times
73 for (ptrdiff_t i = 0; i < update; ++i) {
74 BaseType_t result = pdFALSE;
75 if (xPortInIsrContext()) {
76 BaseType_t higherPriorityTaskWoken = pdFALSE;
77 result = xSemaphoreGiveFromISR(handle, &higherPriorityTaskWoken);
78 if (higherPriorityTaskWoken == pdTRUE) {
79 portYIELD_FROM_ISR();
80 }
81 } else {
82 result = xSemaphoreGive(handle);
83 }
84
85 // If we fail to give, it means we would exceed the max value
86 if (result != pdTRUE) {
87 FL_ASSERT(false, "CountingSemaphoreESP32: release would exceed max value");
88 break;
89 }
90 }
91}
92
93template<ptrdiff_t LeastMaxValue>
94void CountingSemaphoreESP32<LeastMaxValue>::acquire() {

Callers 12

attach_timer_handlerFunction · 0.45
attach_external_handlerFunction · 0.45
attach_timer_handlerFunction · 0.45
attach_external_handlerFunction · 0.45
ChannelPollSignalClass · 0.45
attach_timer_handlerFunction · 0.45
attach_external_handlerFunction · 0.45
ESP32SPIOutputClass · 0.45
ESP32SPIOutputClass · 0.45
SPIDeviceProxyClass · 0.45
createTransportFunction · 0.45
ESP8266SPIOutputClass · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected