From c5e8dcff38bfa15d26a79f6ff1d77227fbe15571 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 29 Feb 2016 23:04:55 +0100 Subject: [PATCH] DMA used when reading/writing from SD card to SDRAM --- radio/src/targets/horus/diskio.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/horus/diskio.cpp b/radio/src/targets/horus/diskio.cpp index e28f04a52..1f067c834 100644 --- a/radio/src/targets/horus/diskio.cpp +++ b/radio/src/targets/horus/diskio.cpp @@ -129,7 +129,8 @@ DRESULT disk_read ( return RES_NOTRDY; } - if ((DWORD)buff < 0x20000000 || (DWORD)buff >= 0x20030000 || ((DWORD)buff & 3)) { + if ((DWORD)buff < 0x20000000 /*|| (DWORD)buff >= 0x20030000*/ || ((DWORD)buff & 3)) { + TRACE("disk_read bad alignment (%p)", buff); while(count--) { res = disk_read(drv, (BYTE *)scratch, sector++, 1); @@ -207,7 +208,8 @@ DRESULT disk_write ( if (SD_Detect() != SD_PRESENT) return(RES_NOTRDY); - if ((DWORD)buff < 0x20000000 || (DWORD)buff >= 0x20030000 || ((DWORD)buff & 3)) { + if ((DWORD)buff < 0x20000000 /*|| (DWORD)buff >= 0x20030000*/ || ((DWORD)buff & 3)) { + TRACE("disk_write bad alignment (%p)", buff); while(count--) { memcpy(scratch, buff, BLOCK_SIZE);