Fix assert to check flash programming offset

The assert introduced in 00c8648351 checks
whether the programming offset equals to page_size of the flash, while it
wants to check whether the offset is a multiple of the page_size.

Change-Id: I794d021951a28c1cc520b5eea5d500f097721b06
Signed-off-by: Attila Kinali <attila@kinali.ch>
Reviewed-on: http://openocd.zylin.com/482
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
__archive__
Attila Kinali 2012-02-24 11:18:12 +01:00 committed by Spencer Oliver
parent 14f51c0a32
commit cea4842207
1 changed files with 1 additions and 1 deletions

View File

@ -2845,7 +2845,7 @@ static int sam3_write(struct flash_bank *bank,
/* By checking that offset is correct here, we also /* By checking that offset is correct here, we also
fix a clang warning */ fix a clang warning */
assert(offset == pPrivate->page_size); assert(offset % pPrivate->page_size == 0);
/* intermediate large pages */ /* intermediate large pages */
/* also - the final *terminal* */ /* also - the final *terminal* */