Use splhigh and splx.
This commit is contained in:
parent
290f41db06
commit
6955e028da
2 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,9 @@ uart_unlock(unsigned char mode)
|
|||
static void
|
||||
uart_configure(unsigned char mode)
|
||||
{
|
||||
_DINT();
|
||||
int s;
|
||||
|
||||
s = splhigh();
|
||||
|
||||
UART_WAIT_TXDONE();
|
||||
|
||||
|
@ -162,7 +164,8 @@ uart_configure(unsigned char mode)
|
|||
UMCTL1 = uart_speed_bmn[mode]; // set modulation
|
||||
|
||||
UCTL1 &= ~SWRST; // clear reset flag
|
||||
_EINT(); // enable interrupts
|
||||
|
||||
splx(s);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue