\r
/**\r
* semphr. h\r
- * <pre>vSemaphoreCreateCounting( xSemaphoreHandle xSemaphore, unsigned portBASE_TYPE uxMaxCount )</pre>\r
+ * <pre>xSemaphoreHandle xSemaphoreCreateCounting( uxCountValue, uxInitialCount )</pre>\r
*\r
* <i>Macro</i> that creates a counting semaphore by using the existing \r
- * queue mechanism. The queue length is used as the maximum count. The data \r
- * size is 0 as we don't want to actually store any data - we just want to \r
- * know if the queue is empty or full.\r
+ * queue mechanism. \r
*\r
* Counting semaphores are typically used for two things:\r
*\r
* 1) Counting events. \r
*\r
- * In this usage scenario an event handler will 'give' a semphore each time\r
+ * In this usage scenario an event handler will 'give' a semaphore each time\r
* an event occurs (incrementing the semaphore count value), and a handler \r
* task will 'take' a semaphore each time it processes an event \r
* (decrementing the semaphore count value). The count value is therefore \r
*\r
* In this usage scenario the count value indicates the number of resources\r
* available. To obtain control of a resource a task must first obtain a \r
- * semphoare - decrementing the semaphore count value. When the count value\r
+ * semaphore - decrementing the semaphore count value. When the count value\r
* reaches zero there are no free resources. When a task finishes with the\r
- * resource it 'gives' the semahore back - incrementing the semaphore count\r
+ * resource it 'gives' the semaphore back - incrementing the semaphore count\r
* value. In this case it is desirable for the initial count value to be\r
* equal to the maximum count value, indicating that all resources are free.\r
*\r
* @param uxMaxCount The maximum count value that can be reached. When the \r
- * semaphore reaches this value it can nolonger be 'given'.\r
- * @param uxInitialCount\r
+ * semaphore reaches this value it can no longer be 'given'.\r
*\r
- * @return Handle to the created semaphore. Should be of type xSemaphoreHandle.\r
+ * @param uxInitialCount The count value assigned to the semaphore when it is\r
+ * created.\r
+ *\r
+ * @return Handle to the created semaphore. Null if the semaphore could not be\r
+ * created.\r
* \r
* Example usage:\r
<pre>\r
{\r
xSemaphoreHandle xSemaphore = NULL;\r
\r
- // Semaphore cannot be used before a call to vSemaphoreCreateCounting().\r
- // This is a macro so pass the variable in directly.\r
- vSemaphoreCreateBinary( xSemaphore, );\r
+ // Semaphore cannot be used before a call to xSemaphoreCreateCounting().\r
+ // The max value to which the semaphore can count should be 10, and the\r
+ // initial value assigned to the count should be 0.\r
+ xSemaphore = xSemaphoreCreateCounting( 10, 0 );\r
\r
if( xSemaphore != NULL )\r
{\r