From 34a6fc82a37221e6098a6d1d3a1537b211ba425e Mon Sep 17 00:00:00 2001 From: nvt-se Date: Tue, 21 Jul 2009 16:56:33 +0000 Subject: [PATCH] Backup all the infomem before erasing the segment. Thanks to Frederik Hermans for reporting this. --- platform/msb430/dev/infomem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/msb430/dev/infomem.c b/platform/msb430/dev/infomem.c index 93160b437..1bb0da23d 100644 --- a/platform/msb430/dev/infomem.c +++ b/platform/msb430/dev/infomem.c @@ -80,7 +80,7 @@ infomem_write(unsigned int offset, unsigned char count, ...) return FALSE; } - flash = (uint8_t *)INFOMEM_START + offset; + flash = (uint8_t *)INFOMEM_START; s = splhigh(); @@ -90,9 +90,9 @@ infomem_write(unsigned int offset, unsigned char count, ...) /* merge backup with new data */ va_start(argp, count); - buffer = (uint8_t *)backup; + buffer = (uint8_t *)backup + offset; for(i = 0; i < count; i++) { - data = va_arg(argp, uint8_t*); + data = va_arg(argp, uint8_t *); size = va_arg(argp, uint16_t); memcpy(buffer, data, size); buffer += size;