From: arighi Date: Wed, 26 May 2010 13:36:32 +0000 (+0000) Subject: lm3s: fix flash_lm3s_seek() end position. X-Git-Tag: 2.5.0~79 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=7b5a8ebc799a5d9486db4c2d89670b7ac7a236b4;p=bertos.git lm3s: fix flash_lm3s_seek() end position. 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 --- diff --git a/bertos/cpu/cortex-m3/drv/flash_lm3s.c b/bertos/cpu/cortex-m3/drv/flash_lm3s.c index 9d2baf9d..1bebb535 100644 --- a/bertos/cpu/cortex-m3/drv/flash_lm3s.c +++ b/bertos/cpu/cortex-m3/drv/flash_lm3s.c @@ -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;