fix(esp_ringbuf): Updated esp_ringbuf to follow astyle format
This commit updates the esp_ringbuf component to follow astyle formatting.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -44,7 +44,7 @@ typedef struct {
|
||||
typedef struct RingbufferDefinition Ringbuffer_t;
|
||||
typedef BaseType_t (*CheckItemFitsFunction_t)(Ringbuffer_t *pxRingbuffer, size_t xItemSize);
|
||||
typedef void (*CopyItemFunction_t)(Ringbuffer_t *pxRingbuffer, const uint8_t *pcItem, size_t xItemSize);
|
||||
typedef BaseType_t (*CheckItemAvailFunction_t) (Ringbuffer_t *pxRingbuffer);
|
||||
typedef BaseType_t (*CheckItemAvailFunction_t)(Ringbuffer_t *pxRingbuffer);
|
||||
typedef void *(*GetItemFunction_t)(Ringbuffer_t *pxRingbuffer, BaseType_t *pxIsSplit, size_t xMaxSize, size_t *pxItemSize);
|
||||
typedef void (*ReturnItemFunction_t)(Ringbuffer_t *pxRingbuffer, uint8_t *pvItem);
|
||||
typedef size_t (*GetCurMaxSizeFunction_t)(Ringbuffer_t *pxRingbuffer);
|
||||
@@ -98,10 +98,10 @@ static size_t prvGetFreeSize(Ringbuffer_t *pxRingbuffer);
|
||||
static BaseType_t prvCheckItemAvail(Ringbuffer_t *pxRingbuffer);
|
||||
|
||||
//Checks if an item will currently fit in a no-split/allow-split ring buffer
|
||||
static BaseType_t prvCheckItemFitsDefault( Ringbuffer_t *pxRingbuffer, size_t xItemSize);
|
||||
static BaseType_t prvCheckItemFitsDefault(Ringbuffer_t *pxRingbuffer, size_t xItemSize);
|
||||
|
||||
//Checks if an item will currently fit in a byte buffer
|
||||
static BaseType_t prvCheckItemFitsByteBuffer( Ringbuffer_t *pxRingbuffer, size_t xItemSize);
|
||||
static BaseType_t prvCheckItemFitsByteBuffer(Ringbuffer_t *pxRingbuffer, size_t xItemSize);
|
||||
|
||||
/*
|
||||
Copies an item to a no-split ring buffer
|
||||
@@ -276,7 +276,7 @@ static size_t prvGetFreeSize(Ringbuffer_t *pxRingbuffer)
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
static BaseType_t prvCheckItemFitsDefault( Ringbuffer_t *pxRingbuffer, size_t xItemSize)
|
||||
static BaseType_t prvCheckItemFitsDefault(Ringbuffer_t *pxRingbuffer, size_t xItemSize)
|
||||
{
|
||||
//Check arguments and buffer state
|
||||
configASSERT(rbCHECK_ALIGNED(pxRingbuffer->pucAcquire)); //pucAcquire is always aligned in no-split/allow-split ring buffers
|
||||
@@ -304,7 +304,7 @@ static BaseType_t prvCheckItemFitsDefault( Ringbuffer_t *pxRingbuffer, size_t xI
|
||||
}
|
||||
}
|
||||
|
||||
static BaseType_t prvCheckItemFitsByteBuffer( Ringbuffer_t *pxRingbuffer, size_t xItemSize)
|
||||
static BaseType_t prvCheckItemFitsByteBuffer(Ringbuffer_t *pxRingbuffer, size_t xItemSize)
|
||||
{
|
||||
//Check arguments and buffer state
|
||||
configASSERT(pxRingbuffer->pucAcquire >= pxRingbuffer->pucHead && pxRingbuffer->pucAcquire < pxRingbuffer->pucTail); //Check acquire pointer is within bounds
|
||||
@@ -1246,7 +1246,7 @@ void vRingbufferDelete(RingbufHandle_t xRingbuffer)
|
||||
configASSERT(pxRingbuffer);
|
||||
|
||||
//Ring buffer was not statically allocated. Free its memory.
|
||||
if ( !( pxRingbuffer->uxRingbufferFlags & rbBUFFER_STATIC_FLAG ) ) {
|
||||
if (!(pxRingbuffer->uxRingbufferFlags & rbBUFFER_STATIC_FLAG)) {
|
||||
free(pxRingbuffer->pucHead);
|
||||
free(pxRingbuffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user