【发布时间】:2013-01-04 21:24:37
【问题描述】:
这里是关于 xSemaphoreTake() 函数的 FreeRTOS api-reference http://www.freertos.org/a00122.html 的摘录:
// See if we can obtain the semaphore. If the semaphore is not available
// wait 10 ticks to see if it becomes free.
if( xSemaphoreTake( xSemaphore, ( portTickType ) 10 ) == pdTRUE )
{
// We were able to obtain the semaphore and can now access the
// shared resource.
我的问题是:我这里已经有信号量还是我必须打电话
xSemaphoreTake( xSemaphore, (portTickType) 10 ) 明确点赞:
// We have finished accessing the shared resource. Release the
// semaphore.
xSemaphoreGive( xSemaphore );
}
【问题讨论】: