summaryrefslogtreecommitdiff
path: root/firmware/src/dfu/dfu.c
diff options
context:
space:
mode:
authormeri <meri@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-04-10 17:34:53 +0000
committermeri <meri@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-04-10 17:34:53 +0000
commitf21e08aa9f22d873e938cd3f021c3fc33d06d286 (patch)
tree16edb533cae24c19d3f0ee9c997f761a594e3009 /firmware/src/dfu/dfu.c
parent5492d0e34bec1c7b66b3781ce0e026c562336dfb (diff)
moved flash code to seperate file
git-svn-id: https://svn.openpcd.org:2342/trunk@294 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware/src/dfu/dfu.c')
-rw-r--r--firmware/src/dfu/dfu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/src/dfu/dfu.c b/firmware/src/dfu/dfu.c
index 20778bd..58062a0 100644
--- a/firmware/src/dfu/dfu.c
+++ b/firmware/src/dfu/dfu.c
@@ -30,7 +30,7 @@
#include <dfu/dfu.h>
#include <dfu/dbgu.h>
-#include <dfu/flash.h>
+#include <os/flash.h>
#include <os/pcd_enumerate.h>
#include "../openpcd.h"
@@ -234,7 +234,7 @@ static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len)
dfu_state = DFU_STATE_dfuMANIFEST_SYNC;
return RET_ZLP;
}
- if (ptr + len > (u_int8_t *) AT91C_IFLASH + AT91C_IFLASH_SIZE) {
+ if (ptr + len >= (u_int8_t *) AT91C_IFLASH + AT91C_IFLASH_SIZE - ENVIRONMENT_SIZE ) {
DEBUGP("end of write exceeds flash end ");
dfu_state = DFU_STATE_dfuERROR;
dfu_status = DFU_STATUS_errADDRESS;
personal git repositories of Harald Welte. Your mileage may vary