diff --git a/sources/spidma.c b/sources/spidma.c index 1f79f6c..f2eed3f 100644 --- a/sources/spidma.c +++ b/sources/spidma.c @@ -7,11 +7,24 @@ #include "spidma.h" #include +#include "mcd_initiators.h" #include "bas_printf.h" extern char _SYS_SRAM[]; #define SYS_SRAM &_SYS_SRAM[0] +void *dma_memcpy(void *dst, void *src, size_t n) +{ + int ret; + + ret = MCD_startDma(0, src, 1, dst, 1, n, 1, DMA_ALWAYS, 0, MCD_SINGLE_DMA, 0); + __asm__ __volatile__("move.w sr,d0\n\t" + "stop #0x270\n\t" + "move.w d0,sr": : :); /* halt CPU until DMA finished */ + + return dst; +} + int spidma_init(void) { int res;