main: fix write_lba fail

the input file of write lba command may not 128 aligned. that may cause write
lba command fail. remove the judge to fix this issue.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
This commit is contained in:
Eddie Cai 2017-03-15 10:12:30 +08:00
parent 92fb760b97
commit 9908df895e

View File

@ -682,10 +682,6 @@ bool write_lba(STRUCT_RKDEVICE_DESC &dev, UINT uiBegin, char *szFile)
while(iTotalWrite < iFileSize) {
memset(pBuf, 0, nSectorSize * DEFAULT_RW_LBA);
iWrite = iRead= fread(pBuf, 1, nSectorSize * DEFAULT_RW_LBA, file);
if ((int)iRead != nSectorSize * DEFAULT_RW_LBA) {
printf("Write LBA failed,err=%d,read=%d,total=%d!\r\n", errno, iRead, nSectorSize * DEFAULT_RW_LBA);
goto Exit_WriteLBA;
}
uiLen = ((iWrite % 512) == 0) ? (iWrite / 512) : (iWrite / 512 + 1);
iRet = pComm->RKU_WriteLBA( uiBegin, uiLen, pBuf);
if(ERR_SUCCESS == iRet) {