mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
rename xHoldSemaphore to result
This commit is contained in:
parent
d96121221d
commit
047d75eee5
@ -1354,12 +1354,12 @@ BaseType_t xRingbufferAddToQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHan
|
||||
BaseType_t xReturn;
|
||||
portENTER_CRITICAL(&pxRingbuffer->mux);
|
||||
//Cannot add semaphore to queue set if semaphore is not empty. Temporarily hold semaphore
|
||||
BaseType_t xHoldSemaphore = xSemaphoreTake(rbGET_RX_SEM_HANDLE(pxRingbuffer), 0);
|
||||
BaseType_t result = xSemaphoreTake(rbGET_RX_SEM_HANDLE(pxRingbuffer), 0);
|
||||
xReturn = xQueueAddToSet(rbGET_RX_SEM_HANDLE(pxRingbuffer), xQueueSet);
|
||||
if (xHoldSemaphore == pdTRUE) {
|
||||
if (result == pdTRUE) {
|
||||
//Return semaphore if temporarily held
|
||||
xHoldSemaphore = xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
||||
configASSERT(xHoldSemaphore == pdTRUE);
|
||||
result = xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
||||
configASSERT(result == pdTRUE);
|
||||
}
|
||||
portEXIT_CRITICAL(&pxRingbuffer->mux);
|
||||
return xReturn;
|
||||
@ -1381,12 +1381,12 @@ BaseType_t xRingbufferRemoveFromQueueSetRead(RingbufHandle_t xRingbuffer, QueueS
|
||||
BaseType_t xReturn;
|
||||
portENTER_CRITICAL(&pxRingbuffer->mux);
|
||||
//Cannot remove semaphore from queue set if semaphore is not empty. Temporarily hold semaphore
|
||||
BaseType_t xHoldSemaphore = xSemaphoreTake(rbGET_RX_SEM_HANDLE(pxRingbuffer), 0);
|
||||
BaseType_t result = xSemaphoreTake(rbGET_RX_SEM_HANDLE(pxRingbuffer), 0);
|
||||
xReturn = xQueueRemoveFromSet(rbGET_RX_SEM_HANDLE(pxRingbuffer), xQueueSet);
|
||||
if (xHoldSemaphore == pdTRUE) {
|
||||
if (result == pdTRUE) {
|
||||
//Return semaphore if temporarily held
|
||||
xHoldSemaphore = xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
||||
configASSERT(xHoldSemaphore == pdTRUE);
|
||||
result = xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
||||
configASSERT(result == pdTRUE);
|
||||
}
|
||||
portEXIT_CRITICAL(&pxRingbuffer->mux);
|
||||
return xReturn;
|
||||
|
Loading…
Reference in New Issue
Block a user