Use splhigh and splx.

This commit is contained in:
nvt-se 2007-09-14 19:20:54 +00:00
parent 290f41db06
commit 6955e028da
2 changed files with 9 additions and 4 deletions

View file

@ -74,13 +74,14 @@ infomem_write(unsigned int offset, unsigned char count, ...)
va_list argp;
uint16_t size;
uint8_t *data;
int s;
if (offset > (2 * INFOMEM_BLOCK_SIZE))
return FALSE;
flash = (uint8_t *) INFOMEM_START + offset;
_DINT();
s = splhigh();
// backup into RAM
memcpy(backup, flash, INFOMEM_BLOCK_SIZE);
@ -116,6 +117,7 @@ infomem_write(unsigned int offset, unsigned char count, ...)
FCTL1 = FWKEY;
FCTL3 = FWKEY + LOCK;
_EINT();
splx(s);
return TRUE;
}