aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanicampora2015-11-29 18:34:00 +0100
committerdanicampora2015-11-29 18:34:51 +0100
commit5d8164167ee9911b25af5eb42e7d7190ba0c33f6 (patch)
treea5d8a109dd410aa8064a39e3b3f5a92cca11f330
parentb8cfb0d7b2c91ea1e17f6caeabfc9cb23166cdc1 (diff)
cc3200: Correct buffer offset in serial flash diskio module.
-rw-r--r--cc3200/fatfs/src/drivers/sflash_diskio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cc3200/fatfs/src/drivers/sflash_diskio.c b/cc3200/fatfs/src/drivers/sflash_diskio.c
index d0cfe0f98..7fb2c97a7 100644
--- a/cc3200/fatfs/src/drivers/sflash_diskio.c
+++ b/cc3200/fatfs/src/drivers/sflash_diskio.c
@@ -96,7 +96,7 @@ DRESULT sflash_disk_status(void) {
if (!sflash_init_done) {
return STA_NOINIT;
}
- return 0;
+ return RES_OK;
}
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
memcpy (buff, &sflash_block_cache[(secindex * SFLASH_SECTOR_SIZE)], SFLASH_SECTOR_SIZE);
- buff += SFLASH_BLOCK_SIZE;
+ buff += SFLASH_SECTOR_SIZE;
}
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
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;
} while (++index < count);