mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 11:17:20 +02:00
Merge branch 'bugfix/ringbuf_send_semaphore_release_order_v4.3' into 'release/v4.3'
esp_ringbuf: Fix order of semaphore release in xRingbufferSend (v4.3) See merge request espressif/esp-idf!16230
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
|
// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
@ -1041,13 +1041,13 @@ BaseType_t xRingbufferSend(RingbufHandle_t xRingbuffer,
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (xReturnSemaphore == pdTRUE) {
|
||||||
|
xSemaphoreGive(rbGET_TX_SEM_HANDLE(pxRingbuffer)); //Give back semaphore so other tasks can send
|
||||||
|
}
|
||||||
if (xReturn == pdTRUE) {
|
if (xReturn == pdTRUE) {
|
||||||
//Indicate item was successfully sent
|
//Indicate item was successfully sent
|
||||||
xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
xSemaphoreGive(rbGET_RX_SEM_HANDLE(pxRingbuffer));
|
||||||
}
|
}
|
||||||
if (xReturnSemaphore == pdTRUE) {
|
|
||||||
xSemaphoreGive(rbGET_TX_SEM_HANDLE(pxRingbuffer)); //Give back semaphore so other tasks can send
|
|
||||||
}
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1083,13 +1083,13 @@ BaseType_t xRingbufferSendFromISR(RingbufHandle_t xRingbuffer,
|
|||||||
}
|
}
|
||||||
portEXIT_CRITICAL_ISR(&pxRingbuffer->mux);
|
portEXIT_CRITICAL_ISR(&pxRingbuffer->mux);
|
||||||
|
|
||||||
|
if (xReturnSemaphore == pdTRUE) {
|
||||||
|
xSemaphoreGiveFromISR(rbGET_TX_SEM_HANDLE(pxRingbuffer), pxHigherPriorityTaskWoken); //Give back semaphore so other tasks can send
|
||||||
|
}
|
||||||
if (xReturn == pdTRUE) {
|
if (xReturn == pdTRUE) {
|
||||||
//Indicate item was successfully sent
|
//Indicate item was successfully sent
|
||||||
xSemaphoreGiveFromISR(rbGET_RX_SEM_HANDLE(pxRingbuffer), pxHigherPriorityTaskWoken);
|
xSemaphoreGiveFromISR(rbGET_RX_SEM_HANDLE(pxRingbuffer), pxHigherPriorityTaskWoken);
|
||||||
}
|
}
|
||||||
if (xReturnSemaphore == pdTRUE) {
|
|
||||||
xSemaphoreGiveFromISR(rbGET_TX_SEM_HANDLE(pxRingbuffer), pxHigherPriorityTaskWoken); //Give back semaphore so other tasks can send
|
|
||||||
}
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user