mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
Merge branch 'feature/freertos_add_xQueueGenericReceive' into 'master'
freertos: add `xQueueGenericReceive` for backward compatibility See merge request espressif/esp-idf!11169
This commit is contained in:
@@ -54,7 +54,8 @@ list(APPEND srcs
|
|||||||
"tasks.c"
|
"tasks.c"
|
||||||
"timers.c"
|
"timers.c"
|
||||||
"stream_buffer.c"
|
"stream_buffer.c"
|
||||||
"FreeRTOS-openocd.c")
|
"FreeRTOS-openocd.c"
|
||||||
|
"freertos_v8_compat.c")
|
||||||
|
|
||||||
if(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
|
if(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
|
||||||
list(APPEND srcs "port/xtensa/xtensa_loadstore_handler.S")
|
list(APPEND srcs "port/xtensa/xtensa_loadstore_handler.S")
|
||||||
|
33
components/freertos/freertos_v8_compat.c
Normal file
33
components/freertos/freertos_v8_compat.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// Copyright 2020 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.
|
||||||
|
// 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 "FreeRTOS.h"
|
||||||
|
#include "queue.h"
|
||||||
|
#include "semphr.h"
|
||||||
|
|
||||||
|
/* This API is kept for backward ABI compatibility with prebuilt libraries against FreeRTOS v8/v9 in ESP-IDF */
|
||||||
|
BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xPeek )
|
||||||
|
{
|
||||||
|
if ( xPeek == pdTRUE )
|
||||||
|
{
|
||||||
|
return xQueuePeek( xQueue, pvBuffer, xTicksToWait );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pvBuffer == NULL )
|
||||||
|
{
|
||||||
|
return xQueueSemaphoreTake( xQueue, xTicksToWait );
|
||||||
|
}
|
||||||
|
|
||||||
|
return xQueueReceive( xQueue, pvBuffer, xTicksToWait );
|
||||||
|
}
|
Reference in New Issue
Block a user