提交 725ad9b8 编写于 作者: B bernard.xiong@gmail.com

fix msd write issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1140 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 b37abcd9
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册