mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
Backup all the infomem before erasing the segment. Thanks to Frederik Hermans for reporting this.
This commit is contained in:
parent
31253a29a1
commit
34a6fc82a3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user