mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
26 lines
653 B
C
26 lines
653 B
C
|
/*
|
||
|
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||
|
*
|
||
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
*/
|
||
|
|
||
|
#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 );
|
||
|
}
|