Skip to content

Commit 5d81641

Browse files
author
danicampora
committed
cc3200: Correct buffer offset in serial flash diskio module.
1 parent b8cfb0d commit 5d81641

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cc3200/fatfs/src/drivers/sflash_diskio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ DRESULT sflash_disk_status(void) {
9696
if (!sflash_init_done) {
9797
return STA_NOINIT;
9898
}
99-
return 0;
99+
return RES_OK;
100100
}
101101

102102
DRESULT sflash_disk_read(BYTE *buff, DWORD sector, UINT count) {
@@ -126,7 +126,7 @@ DRESULT sflash_disk_read(BYTE *buff, DWORD sector, UINT count) {
126126
}
127127
// Copy the requested sector from the block cache
128128
memcpy (buff, &sflash_block_cache[(secindex * SFLASH_SECTOR_SIZE)], SFLASH_SECTOR_SIZE);
129-
buff += SFLASH_BLOCK_SIZE;
129+
buff += SFLASH_SECTOR_SIZE;
130130
}
131131
return RES_OK;
132132
}
@@ -161,7 +161,7 @@ DRESULT sflash_disk_write(const BYTE *buff, DWORD sector, UINT count) {
161161
}
162162
// Copy the input sector to the block cache
163163
memcpy (&sflash_block_cache[(secindex * SFLASH_SECTOR_SIZE)], buff, SFLASH_SECTOR_SIZE);
164-
buff += SFLASH_BLOCK_SIZE;
164+
buff += SFLASH_SECTOR_SIZE;
165165
sflash_cache_is_dirty = true;
166166
} while (++index < count);
167167

0 commit comments

Comments
 (0)