summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-26 11:04:20 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-26 11:04:20 +0000
commit6945fb26c833993ed99091e07c8baf2e0f7689c0 (patch)
tree0c8b831acea854b75f62750e395e56cecd75b672 /src
parent3a11ebf86062e103ce8094adda0b1c8f396f1ae9 (diff)
downloadopenocd_libswd-6945fb26c833993ed99091e07c8baf2e0f7689c0.tar.gz
openocd_libswd-6945fb26c833993ed99091e07c8baf2e0f7689c0.tar.bz2
openocd_libswd-6945fb26c833993ed99091e07c8baf2e0f7689c0.tar.xz
openocd_libswd-6945fb26c833993ed99091e07c8baf2e0f7689c0.zip
- corrected error with stm32 page calculation
git-svn-id: svn://svn.berlios.de/openocd/trunk@686 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/flash/stm32x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index d3e167d9..9ce16f7d 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -664,7 +664,8 @@ int stm32x_probe(struct flash_bank_s *bank)
LOG_INFO( "flash size = %dkbytes", num_pages );
/* calculate numbers of pages */
- num_pages /= (page_size - 1024);
+ if (page_size - 1024)
+ num_pages /= (page_size - 1024);
bank->base = 0x08000000;
bank->size = (num_pages * page_size);