aboutsummaryrefslogtreecommitdiff
path: root/src/lpc11xx.c
diff options
context:
space:
mode:
authorGareth McMullin2014-01-23 10:52:09 -0800
committerGareth McMullin2014-01-23 10:52:09 -0800
commitac0fc8216ad086a350f0478b9d83c7a924fcb94b (patch)
tree73894e19acaa9db51a550724e2356d56a9ee74e5 /src/lpc11xx.c
parenteb2f2afa9a4d6a352c45857e37fd282b4d76b8cc (diff)
parentce17cc2e2b8b5afe79247dcd96f1fc222fed1dfc (diff)
Merge pull request #35 from burgrp/upstream
Fix in checksum calculation condition
Diffstat (limited to 'src/lpc11xx.c')
-rw-r--r--src/lpc11xx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lpc11xx.c b/src/lpc11xx.c
index 01afd87..670bba8 100644
--- a/src/lpc11xx.c
+++ b/src/lpc11xx.c
@@ -216,7 +216,7 @@ lpc11xx_flash_write(struct target_s *target, uint32_t dest, const uint8_t *src,
chunk_offset = 0;
/* if we are programming the vectors, calculate the magic number */
- if (dest == 0) {
+ if (chunk * IAP_PGM_CHUNKSIZE == 0) {
uint32_t *w = (uint32_t *)(&flash_pgm.data[0]);
uint32_t sum = 0;