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:
parent
b37abcd94f
commit
725ad9b88e
|
@ -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;
|
status = MSD_RESPONSE_NO_ERROR;
|
||||||
// rt_kprintf("write: 0x%x, size %d\n", pos, size);
|
// rt_kprintf("write: 0x%x, size %d\n", pos, size);
|
||||||
|
|
||||||
/* read all sectors */
|
/* write all sectors */
|
||||||
for (i = 0; i < size / SECTOR_SIZE; i ++)
|
for (i = 0; i < size; i ++)
|
||||||
{
|
{
|
||||||
status = MSD_WriteBuffer((rt_uint8_t*)((rt_uint8_t*)buffer + i * SECTOR_SIZE),
|
status = MSD_WriteBuffer((rt_uint8_t*)((rt_uint8_t*)buffer + i * SECTOR_SIZE),
|
||||||
(part.offset + pos + i)* SECTOR_SIZE, SECTOR_SIZE);
|
(part.offset + pos + i)* SECTOR_SIZE, SECTOR_SIZE);
|
||||||
|
|
Loading…
Reference in New Issue