dma: wrap realloc in atomic block
@@ -160,6 +160,7 @@ void dma_free(void *ptr) {
}
void *dma_realloc(void *ptr, uint32_t min_size) {
+ ATOMIC_BLOCK_ALL {
dma_allocation_t *alloc = (dma_allocation_t *)(ptr - sizeof(dma_allocation_t));
if (alloc->size >= min_size) {
return ptr;
@@ -175,6 +176,10 @@ void *dma_realloc(void *ptr, uint32_t min_size) {
return new_ptr;
}
+ failloop(FAILLOOP_FAULT);
+ return NULL;
+}
+
void dma_prepare_tx_memory(void *addr, uint32_t size) {
#if defined(STM32F7) || defined(STM32H7)
if (!WITHIN_DTCM_RAM(addr) && !WITHIN_DMA_RAM(addr)) {
