From 552749accac737283ec798dc8d49e0e28a8702cf Mon Sep 17 00:00:00 2001 From: Stephane Dallongeville Date: Wed, 29 May 2024 23:51:02 +0200 Subject: [PATCH] Better to avoid transfer when len = 0 --- src/dma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dma.c b/src/dma.c index da19eb74..37e8916d 100644 --- a/src/dma.c +++ b/src/dma.c @@ -321,6 +321,9 @@ u16 DMA_getQueueTransferSize() bool DMA_transfer(TransferMethod tm, u8 location, void* from, u16 to, u16 len, u16 step) { + // nothing to do (avoid transfering 65536 words when len = 0) + if (!len) return TRUE; + switch(tm) { // default = CPU transfer