lm3s: fix flash_lm3s_seek() end position.
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 26 May 2010 13:36:32 +0000 (13:36 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 26 May 2010 13:36:32 +0000 (13:36 +0000)
The current position of the flash is stored internally using the
absolute memory address, so KSM_SEEK_END should sum the flash base
address (FLASH_BASE) to the flash size.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3838 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/flash_lm3s.c

index 9d2baf9d88b8d27e95647d3fff08444b48d5f49d..1bebb5354c5136497426d4c6f5ead49d87c2f5b0 100644 (file)
@@ -189,7 +189,7 @@ static kfile_off_t flash_lm3s_seek(struct KFile *_fd, kfile_off_t offset, KSeekM
                seek_pos = FLASH_BASE;
                break;
        case KSM_SEEK_END:
-               seek_pos = fd->fd.size;
+               seek_pos = FLASH_BASE + fd->fd.size;
                break;
        case KSM_SEEK_CUR:
                seek_pos = fd->fd.seek_pos;