|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2013-10-10 18:49:51
|
显示全部楼层
原来是
DRESULT disk_read (
BYTE drv, /* Physical drive nmuber (0..) */
BYTE *buff, /* Data buffer to store read data */
DWORD sector, /* Sector address (LBA) */
BYTE count /* Number of sectors to read (1..255) */
)
{
DRESULT res;
int Status;
switch (drv)
{
case ATA :
return res;
case MMC :
return res;
case USB :
return res;
case SDCard :
{
if ( count == 1 )
{
Status = SD_ReadBlock(buff,(sector)<<9,SDCardInfo.CardBlockSize );
//Status = SD_ReadBlock(buff,(sector+HidDsector)<<9,SDCardInfo.CardBlockSize );
Status = SD_WaitReadOperation();
while(SD_GetStatus() != SD_TRANSFER_OK);
if ( Status == 0 ) {return RES_OK;}
else {return RES_PARERR;}
}
else
{
//Status = SD_ReadMultiBlocks( buff,(sector)<<9,SDCardInfo.CardBlockSize, count );
Status = SD_ReadMultiBlocks( buff,(sector+HidDsector)<<9,SDCardInfo.CardBlockSize, count );
Status = SD_WaitReadOperation();
while(SD_GetStatus() != SD_TRANSFER_OK);
if ( Status == 0 ) {return RES_OK;}
else {return RES_PARERR;}
}
}
}
return RES_PARERR;
}
HidDsector 引起的。。
执行上斌函数时候 找隐藏扇区。。
fmt = check_fs(fs, bsect = 0);
HidDsector = LD_WORD(fs->win+HidAddress);
fmt = check_fs(fs, bsect = 0);
|
|