diff --git a/BaS_gcc/Makefile b/BaS_gcc/Makefile index 5f1b5fd..5317878 100644 --- a/BaS_gcc/Makefile +++ b/BaS_gcc/Makefile @@ -72,7 +72,7 @@ CSRCS= \ $(SRCDIR)/wait.c \ $(SRCDIR)/s19reader.c \ $(SRCDIR)/flash.c \ - $(SRCDIR)/spidma.c \ + $(SRCDIR)/dma.c \ $(SRCDIR)/xhdi_sd.c \ $(SRCDIR)/xhdi_interface.c diff --git a/BaS_gcc/bas.lk.in b/BaS_gcc/bas.lk.in index 30bef81..96ee374 100644 --- a/BaS_gcc/bas.lk.in +++ b/BaS_gcc/bas.lk.in @@ -30,7 +30,7 @@ SECTIONS objs/supervisor.o(.text) objs/illegal_instruction.o(.text) objs/exceptions.o(.text) - objs/spidma.o(.text) + objs/dma.o(.text) mcdapi/MCD_dmaApi.o(.text) mcdapi/MCD_tasks.o(.text) mcdapi/MCD_tasksInit.o(.text) diff --git a/BaS_gcc/include/spidma.h b/BaS_gcc/include/dma.h similarity index 100% rename from BaS_gcc/include/spidma.h rename to BaS_gcc/include/dma.h diff --git a/BaS_gcc/sources/BaS.c b/BaS_gcc/sources/BaS.c index 7fd0829..3477b65 100644 --- a/BaS_gcc/sources/BaS.c +++ b/BaS_gcc/sources/BaS.c @@ -37,7 +37,7 @@ #include "diskio.h" #include "ff.h" #include "s19reader.h" -#include "spidma.h" +#include "dma.h" /* imported routines */ extern int mmu_init(); diff --git a/BaS_gcc/sources/spidma.c b/BaS_gcc/sources/dma.c similarity index 93% rename from BaS_gcc/sources/spidma.c rename to BaS_gcc/sources/dma.c index 6d3577d..6ca731d 100644 --- a/BaS_gcc/sources/spidma.c +++ b/BaS_gcc/sources/dma.c @@ -1,11 +1,11 @@ /* - * spidma.c + * dma.c * * Created on: 27.07.2013 * Author: mfro */ -#include "spidma.h" +#include "dma.h" #include #include "mcd_initiators.h" #include "bas_printf.h" @@ -34,6 +34,7 @@ void *dma_memcpy(void *dst, void *src, size_t n) { case MCD_NO_DMA: xprintf("MCD_NO_DMA: no DMA active on this channel\r\n"); + return NULL; break; case MCD_IDLE: xprintf("MCD_IDLE: DMA defined but not active (initiator not ready)\r\n"); @@ -46,12 +47,14 @@ void *dma_memcpy(void *dst, void *src, size_t n) break; case MCD_HALTED: xprintf("MCD_HALTED: DMA killed\r\n"); + return NULL; break; case MCD_DONE: xprintf("MCD_DONE: DMA finished\r\n"); break; case MCD_CHANNEL_INVALID: xprintf("MCD_CHANNEL_INVALID: invalid DMA channel\r\n"); + return NULL; break; default: xprintf("unknown DMA status %d\r\n", ret); @@ -62,7 +65,7 @@ void *dma_memcpy(void *dst, void *src, size_t n) end = MCF_SLT_SCNT(0); - xprintf("took %d seconds (1 Mbyte)\r\n", (end - start) / 132 / 1000); + xprintf("took %d ms (1 Mbyte)\r\n", (end - start) / 132); #ifdef _NOT_USED_ __asm__ __volatile__("move.w sr,d0\n\t" "stop #0x270\n\t"