mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 19:50:30 +01:00
cc3200: Correct buffer offset in serial flash diskio module.
This commit is contained in:
@@ -96,7 +96,7 @@ DRESULT sflash_disk_status(void) {
|
|||||||
if (!sflash_init_done) {
|
if (!sflash_init_done) {
|
||||||
return STA_NOINIT;
|
return STA_NOINIT;
|
||||||
}
|
}
|
||||||
return 0;
|
return RES_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DRESULT sflash_disk_read(BYTE *buff, DWORD sector, UINT count) {
|
DRESULT sflash_disk_read(BYTE *buff, DWORD sector, UINT count) {
|
||||||
@@ -126,7 +126,7 @@ DRESULT sflash_disk_read(BYTE *buff, DWORD sector, UINT count) {
|
|||||||
}
|
}
|
||||||
// Copy the requested sector from the block cache
|
// Copy the requested sector from the block cache
|
||||||
memcpy (buff, &sflash_block_cache[(secindex * SFLASH_SECTOR_SIZE)], SFLASH_SECTOR_SIZE);
|
memcpy (buff, &sflash_block_cache[(secindex * SFLASH_SECTOR_SIZE)], SFLASH_SECTOR_SIZE);
|
||||||
buff += SFLASH_BLOCK_SIZE;
|
buff += SFLASH_SECTOR_SIZE;
|
||||||
}
|
}
|
||||||
return RES_OK;
|
return RES_OK;
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ DRESULT sflash_disk_write(const BYTE *buff, DWORD sector, UINT count) {
|
|||||||
}
|
}
|
||||||
// Copy the input sector to the block cache
|
// Copy the input sector to the block cache
|
||||||
memcpy (&sflash_block_cache[(secindex * SFLASH_SECTOR_SIZE)], buff, SFLASH_SECTOR_SIZE);
|
memcpy (&sflash_block_cache[(secindex * SFLASH_SECTOR_SIZE)], buff, SFLASH_SECTOR_SIZE);
|
||||||
buff += SFLASH_BLOCK_SIZE;
|
buff += SFLASH_SECTOR_SIZE;
|
||||||
sflash_cache_is_dirty = true;
|
sflash_cache_is_dirty = true;
|
||||||
} while (++index < count);
|
} while (++index < count);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user