46bool Semaphore::Take(TickType_t xBlockTime)
50 success = xSemaphoreTake(
handle, xBlockTime);
52 return success == pdTRUE ? true :
false;
60 success = xSemaphoreTakeFromISR(
handle, pxHigherPriorityTaskWoken);
62 return success == pdTRUE ? true :
false;
70 success = xSemaphoreGive(
handle);
72 return success == pdTRUE ? true :
false;
80 success = xSemaphoreGiveFromISR(
handle, pxHigherPriorityTaskWoken);
82 return success == pdTRUE ? true :
false;
99 handle = xSemaphoreCreateBinary();
102#ifndef CPP_FREERTOS_NO_EXCEPTIONS
105 configASSERT(!
"BinarySemaphore Constructor Failed");
118#ifndef CPP_FREERTOS_NO_EXCEPTIONS
121 configASSERT(!
"CountingSemaphore Constructor bad maxCount");
125 if (initialCount > maxCount) {
126#ifndef CPP_FREERTOS_NO_EXCEPTIONS
129 configASSERT(!
"CountingSemaphore Constructor bad initialCount");
133 handle = xSemaphoreCreateCounting(maxCount, initialCount);
136#ifndef CPP_FREERTOS_NO_EXCEPTIONS
139 configASSERT(!
"CountingSemaphore Constructor Failed");
BinarySemaphore(bool set=false)
CountingSemaphore(UBaseType_t maxCount, UBaseType_t initialCount)
bool GiveFromISR(BaseType_t *pxHigherPriorityTaskWoken)
bool TakeFromISR(BaseType_t *pxHigherPriorityTaskWoken)