[X9E] Massstorage OK?

This commit is contained in:
Bertrand Songis
2016-07-29 20:53:01 +02:00
parent e5bbf6766b
commit 85f3bd4ed0
10 changed files with 130 additions and 94 deletions
+3 -5
View File
@@ -29,8 +29,6 @@
#include "opentx.h"
#include "sdio_sd.h"
#define BLOCK_SIZE 512 /* Block Size in Bytes */
/*-----------------------------------------------------------------------*/
/* Lock / unlock functions */
/*-----------------------------------------------------------------------*/
@@ -134,9 +132,9 @@ DRESULT __disk_read (
return RES_NOTRDY;
}
if ((DWORD)buff < 0x20000000 /*|| (DWORD)buff >= 0x20030000*/ || ((DWORD)buff & 3)) {
if ((DWORD)buff < 0x20000000 || ((DWORD)buff & 3)) {
TRACE("disk_read bad alignment (%p)", buff);
while(count--) {
while (count--) {
res = disk_read(drv, (BYTE *)scratch, sector++, 1);
if (res != RES_OK) {
@@ -211,7 +209,7 @@ 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 & 3)) {
TRACE("disk_write bad alignment (%p)", buff);
while(count--) {
memcpy(scratch, buff, BLOCK_SIZE);