Merge branch 'docs/fix_static_sem_api_desc' into 'master'

Fix usage example in xSemaphoreCreateBinaryStatic

Closes IDFGH-3280

See merge request espressif/esp-idf!8750
This commit is contained in:
Angus Gratton
2020-05-15 15:04:36 +08:00

View File

@@ -235,13 +235,14 @@ typedef QueueHandle_t SemaphoreHandle_t;
* *
* void vATask( void * pvParameters ) * void vATask( void * pvParameters )
* { * {
* // Semaphore cannot be used before a call to xSemaphoreCreateBinary(). * // Semaphore cannot be used before a call to xSemaphoreCreateBinary() or
* // xSemaphoreCreateBinaryStatic().
* // The semaphore's data structures will be placed in the xSemaphoreBuffer * // The semaphore's data structures will be placed in the xSemaphoreBuffer
* // variable, the address of which is passed into the function. The * // variable, the address of which is passed into the function. The
* // function's parameter is not NULL, so the function will not attempt any * // function's parameter is not NULL, so the function will not attempt any
* // dynamic memory allocation, and therefore the function will not return * // dynamic memory allocation, and therefore the function will not return
* // return NULL. * // return NULL.
* xSemaphore = xSemaphoreCreateBinary( &xSemaphoreBuffer ); * xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
* *
* // Rest of task code goes here. * // Rest of task code goes here.
* } * }