fix msd write issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1140 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2010-11-29 13:09:39 +00:00
parent b37abcd94f
commit 725ad9b88e
1 changed files with 2 additions and 2 deletions

View File

@ -855,8 +855,8 @@ static rt_size_t rt_msd_write (rt_device_t dev, rt_off_t pos, const void* buffer
status = MSD_RESPONSE_NO_ERROR;
// rt_kprintf("write: 0x%x, size %d\n", pos, size);
/* read all sectors */
for (i = 0; i < size / SECTOR_SIZE; i ++)
/* write all sectors */
for (i = 0; i < size; i ++)
{
status = MSD_WriteBuffer((rt_uint8_t*)((rt_uint8_t*)buffer + i * SECTOR_SIZE),
(part.offset + pos + i)* SECTOR_SIZE, SECTOR_SIZE);