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

Method release

src/platforms/arm/stm32/semaphore_stm32.cpp.hpp:65–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

SPIDeviceProxyClass · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected