mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(ringbuf): allow xRingbufferCreateWithCaps to pass in non-32-bit aligned size
This commit is contained in:
parent
f54e1a8f09
commit
1e6d843e65
@ -1374,6 +1374,11 @@ RingbufHandle_t xRingbufferCreateWithCaps(size_t xBufferSize, RingbufferType_t x
|
||||
StaticRingbuffer_t *pxStaticRingbuffer;
|
||||
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);
|
||||
pucRingbufferStorage = heap_caps_malloc(xBufferSize, (uint32_t)uxMemoryCaps);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user