mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Merge branch 'bugfix/esp_ringbuf_32_bit_alignment_v5.2' into 'release/v5.2'
fix(ringbuf): allow xRingbufferCreateWithCaps to pass in non-32-bit aligned size (v5.2) See merge request espressif/esp-idf!33521
This commit is contained in:
@ -1384,6 +1384,11 @@ RingbufHandle_t xRingbufferCreateWithCaps(size_t xBufferSize, RingbufferType_t x
|
|||||||
StaticRingbuffer_t *pxStaticRingbuffer;
|
StaticRingbuffer_t *pxStaticRingbuffer;
|
||||||
uint8_t *pucRingbufferStorage;
|
uint8_t *pucRingbufferStorage;
|
||||||
|
|
||||||
|
//Allocate memory
|
||||||
|
if (xBufferType != RINGBUF_TYPE_BYTEBUF) {
|
||||||
|
xBufferSize = rbALIGN_SIZE(xBufferSize); //xBufferSize is rounded up for no-split/allow-split buffers
|
||||||
|
}
|
||||||
|
|
||||||
pxStaticRingbuffer = heap_caps_malloc(sizeof(StaticRingbuffer_t), (uint32_t)uxMemoryCaps);
|
pxStaticRingbuffer = heap_caps_malloc(sizeof(StaticRingbuffer_t), (uint32_t)uxMemoryCaps);
|
||||||
pucRingbufferStorage = heap_caps_malloc(xBufferSize, (uint32_t)uxMemoryCaps);
|
pucRingbufferStorage = heap_caps_malloc(xBufferSize, (uint32_t)uxMemoryCaps);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user