Skip to content

Commit 190b883

Browse files
committed
Better buffer caps defs
1 parent 376c9ed commit 190b883

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

wled00/bus_manager.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ static inline void* allocAlignedBuffer(size_t size, uint32_t caps_primary, uint3
4646
void* ptr = heap_caps_aligned_calloc(PPA_CACHE_LINE, alignedSize, 1, caps_primary);
4747
if (!ptr && caps_fallback) {
4848
ptr = heap_caps_aligned_calloc(PPA_CACHE_LINE, alignedSize, 1, caps_fallback);
49+
USER_PRINTLN("Warning! allocAlignedBuffer hit fallback.");
4950
}
5051
return ptr;
5152
}
@@ -496,8 +497,8 @@ BusNetwork::BusNetwork(BusConfig &bc, const ColorOrderMap &com) : Bus(bc.type, b
496497

497498
_data = (byte*)allocAlignedBuffer(
498499
allocPixels * _UDPchannels,
499-
MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA,
500-
MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA
500+
MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD,
501+
MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD
501502
);
502503

503504
// _data = (byte*)heap_caps_calloc_prefer((bc.count * _UDPchannels) + 15, sizeof(byte), 2, MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA, MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA);
@@ -613,8 +614,8 @@ bool BusNetwork::ensureCapacity(uint32_t requiredPixels) {
613614
uint32_t newSize = (requiredPixels * _UDPchannels) + 15;
614615
byte* newData = (byte*)allocAlignedBuffer(
615616
newSize,
616-
MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA,
617-
MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA
617+
MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD,
618+
MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD
618619
);
619620

620621
if (newData == nullptr) return false;
@@ -689,8 +690,8 @@ BusParallelIO::BusParallelIO(BusConfig& bc, const ColorOrderMap& com) : Bus(bc.t
689690
// _data = (byte*)heap_caps_calloc_prefer((bc.count * _channels) + 15, sizeof(byte), 3, MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD, MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD, MALLOC_CAP_INTERNAL);
690691
_data = (byte*)allocAlignedBuffer(
691692
bc.count * _channels,
692-
MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA,
693-
MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA
693+
MALLOC_CAP_SPIRAM | MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD,
694+
MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA | MALLOC_CAP_32BIT | MALLOC_CAP_CACHE_ALIGNED | MALLOC_CAP_SIMD
694695
);
695696
if (_data == nullptr) return;
696697
_len = bc.count;

0 commit comments

Comments
 (0)