From f21e08aa9f22d873e938cd3f021c3fc33d06d286 Mon Sep 17 00:00:00 2001 From: meri Date: Tue, 10 Apr 2007 17:34:53 +0000 Subject: moved flash code to seperate file git-svn-id: https://svn.openpcd.org:2342/trunk@294 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- firmware/src/dfu/dfu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/src/dfu') 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 #include -#include +#include #include #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; -- cgit v1.2.3