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");
CountingSemaphore(UBaseType_t maxCount, UBaseType_t initialCount)
bool TakeFromISR(BaseType_t *pxHigherPriorityTaskWoken)
bool GiveFromISR(BaseType_t *pxHigherPriorityTaskWoken)
bool Take(TickType_t Timeout=portMAX_DELAY)
BinarySemaphore(bool set=false)