Update documentation to correct spelling.

pull/1/head
Richard Barry 17 years ago
parent 44911a1c48
commit 6e27b6ec86

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

Loading…
Cancel
Save