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:
Sudeep Mohanty 2024-01-26 15:20:19 +01:00
parent e8dee79bb5
commit defd3ec220
4 changed files with 11 additions and 14 deletions

View File

@ -91,7 +91,6 @@ RingbufHandle_t xRingbufferCreate(size_t xBufferSize, RingbufferType_t xBufferTy
*/
RingbufHandle_t xRingbufferCreateNoSplit(size_t xItemSize, size_t xItemNum);
/**
* @brief Create a ring buffer but manually provide the required memory
*
@ -450,7 +449,6 @@ size_t xRingbufferGetCurFreeSize(RingbufHandle_t xRingbuffer);
*/
BaseType_t xRingbufferAddToQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHandle_t xQueueSet);
/**
* @brief Check if the selected queue set member is a particular ring buffer
*

View File

@ -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);
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -650,7 +650,7 @@ static void queue_set_receiving_task(void *queue_set_handle)
receive_check_and_return_item_byte_buffer(buffer_handles[2], small_item, SMALL_ITEM_SIZE, 0, false);
items_rec_count[2] ++;
} else {
TEST_ASSERT_MESSAGE( false, "Error with queue set member");
TEST_ASSERT_MESSAGE(false, "Error with queue set member");
}
//Check for completion
@ -1045,7 +1045,7 @@ static IRAM_ATTR __attribute__((noinline)) bool iram_ringbuf_test(void)
TEST_CASE("Test ringbuffer functions work with flash cache disabled", "[esp_ringbuf]")
{
TEST_ASSERT( iram_ringbuf_test() );
TEST_ASSERT(iram_ringbuf_test());
}
#endif /* !CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH && !CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH */
@ -1111,7 +1111,7 @@ TEST_CASE("Test ringbuffer with caps", "[esp_ringbuf]")
StaticRingbuffer_t *rb_obj;
// Create ring buffer with caps
rb_handle = xRingbufferCreateWithCaps(BUFFER_SIZE, RINGBUF_TYPE_NOSPLIT, (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT));
rb_handle = xRingbufferCreateWithCaps(BUFFER_SIZE, RINGBUF_TYPE_NOSPLIT, (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT));
TEST_ASSERT_NOT_EQUAL(NULL, rb_handle);
// Get the ring buffer's memory

View File

@ -70,7 +70,6 @@ components_not_formatted_temporary:
- "/components/esp_partition/"
- "/components/esp_phy/"
- "/components/esp_pm/"
- "/components/esp_ringbuf/"
- "/components/esp_rom/"
- "/components/esp_system/"
- "/components/esp_timer/"