as3525: fix capacity sanity check
adjust logical starting sector to physical starting sector after the check number of blocks is already adjusted from physical to logical don't panic anymore when accessing the last part of storage git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26050 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
338e4d76aa
commit
0f77db7346
2 changed files with 8 additions and 8 deletions
|
@ -669,10 +669,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned loops = 0;
|
unsigned loops = 0;
|
||||||
|
|
||||||
/* skip SanDisk OF */
|
|
||||||
if (drive == INTERNAL_AS3525)
|
|
||||||
start += AMS_OF_SIZE;
|
|
||||||
|
|
||||||
mutex_lock(&sd_mtx);
|
mutex_lock(&sd_mtx);
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
sd_enable(true);
|
sd_enable(true);
|
||||||
|
@ -692,6 +688,10 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
|
||||||
goto sd_transfer_error;
|
goto sd_transfer_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* skip SanDisk OF */
|
||||||
|
if (drive == INTERNAL_AS3525)
|
||||||
|
start += AMS_OF_SIZE;
|
||||||
|
|
||||||
last_disk_activity = current_tick;
|
last_disk_activity = current_tick;
|
||||||
|
|
||||||
dma_retain();
|
dma_retain();
|
||||||
|
|
|
@ -795,10 +795,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
|
||||||
const int drive = 0;
|
const int drive = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* skip SanDisk OF */
|
|
||||||
if (drive == INTERNAL_AS3525)
|
|
||||||
start += AMS_OF_SIZE;
|
|
||||||
|
|
||||||
mutex_lock(&sd_mtx);
|
mutex_lock(&sd_mtx);
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
sd_enable(true);
|
sd_enable(true);
|
||||||
|
@ -821,6 +817,10 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
|
||||||
goto sd_transfer_error;
|
goto sd_transfer_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* skip SanDisk OF */
|
||||||
|
if (drive == INTERNAL_AS3525)
|
||||||
|
start += AMS_OF_SIZE;
|
||||||
|
|
||||||
/* CMD7 w/rca: Select card to put it in TRAN state */
|
/* CMD7 w/rca: Select card to put it in TRAN state */
|
||||||
if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_NO_RESP, NULL))
|
if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_NO_RESP, NULL))
|
||||||
return -19;
|
return -19;
|
||||||
|
|
Loading…
Reference in a new issue