mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 13:44:32 +02:00
Merge branch 'bugfix/ringbuf_send_semaphore_release_order' into 'master'
esp_ringbuf: Fix order of semaphore release in xRingbufferSend Closes IDFGH-6030 and IDFGH-6036 See merge request espressif/esp-idf!15657
This commit is contained in:
@@ -1,16 +1,8 @@
|
|||||||
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
|
/*
|
||||||
//
|
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
*
|
||||||
// you may not use this file except in compliance with the License.
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
// You may obtain a copy of the License at
|
*/
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -1041,13 +1033,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 +1075,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -877,7 +877,6 @@ components/esp_pm/pm_locks.c
|
|||||||
components/esp_pm/pm_trace.c
|
components/esp_pm/pm_trace.c
|
||||||
components/esp_pm/test/test_pm.c
|
components/esp_pm/test/test_pm.c
|
||||||
components/esp_ringbuf/include/freertos/ringbuf.h
|
components/esp_ringbuf/include/freertos/ringbuf.h
|
||||||
components/esp_ringbuf/ringbuf.c
|
|
||||||
components/esp_ringbuf/test/test_ringbuf.c
|
components/esp_ringbuf/test/test_ringbuf.c
|
||||||
components/esp_rom/esp32/esp_rom_caps.h
|
components/esp_rom/esp32/esp_rom_caps.h
|
||||||
components/esp_rom/esp32/ld/esp32.rom.api.ld
|
components/esp_rom/esp32/ld/esp32.rom.api.ld
|
||||||
|
Reference in New Issue
Block a user