mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'contrib/github_pr_9497_v4.4' into 'release/v4.4'
Move xSemaphoreGive out of configASSERT (GitHub PR) (v4.4) See merge request espressif/esp-idf!19536
This commit is contained in:
commit
0b0ca31386
@ -1354,11 +1354,12 @@ BaseType_t xRingbufferAddToQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHan
|
|||||||
BaseType_t xReturn;
|
BaseType_t xReturn;
|
||||||
portENTER_CRITICAL(&pxRingbuffer->mux);
|
portENTER_CRITICAL(&pxRingbuffer->mux);
|
||||||
//Cannot add semaphore to queue set if semaphore is not empty. Temporarily hold semaphore
|
//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);
|
xReturn = xQueueAddToSet(rbGET_RX_SEM_HANDLE(pxRingbuffer), xQueueSet);
|
||||||
if (xHoldSemaphore == pdTRUE) {
|
if (result == pdTRUE) {
|
||||||
//Return semaphore if temporarily held
|
//Return semaphore if temporarily held
|
||||||
configASSERT(xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer)) == pdTRUE);
|
result = xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
||||||
|
configASSERT(result == pdTRUE);
|
||||||
}
|
}
|
||||||
portEXIT_CRITICAL(&pxRingbuffer->mux);
|
portEXIT_CRITICAL(&pxRingbuffer->mux);
|
||||||
return xReturn;
|
return xReturn;
|
||||||
@ -1380,11 +1381,12 @@ BaseType_t xRingbufferRemoveFromQueueSetRead(RingbufHandle_t xRingbuffer, QueueS
|
|||||||
BaseType_t xReturn;
|
BaseType_t xReturn;
|
||||||
portENTER_CRITICAL(&pxRingbuffer->mux);
|
portENTER_CRITICAL(&pxRingbuffer->mux);
|
||||||
//Cannot remove semaphore from queue set if semaphore is not empty. Temporarily hold semaphore
|
//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);
|
xReturn = xQueueRemoveFromSet(rbGET_RX_SEM_HANDLE(pxRingbuffer), xQueueSet);
|
||||||
if (xHoldSemaphore == pdTRUE) {
|
if (result == pdTRUE) {
|
||||||
//Return semaphore if temporarily held
|
//Return semaphore if temporarily held
|
||||||
configASSERT(xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer)) == pdTRUE);
|
result = xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
||||||
|
configASSERT(result == pdTRUE);
|
||||||
}
|
}
|
||||||
portEXIT_CRITICAL(&pxRingbuffer->mux);
|
portEXIT_CRITICAL(&pxRingbuffer->mux);
|
||||||
return xReturn;
|
return xReturn;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user