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;
|
va_list argp;
|
||||||
uint16_t size;
|
uint16_t size;
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
|
int s;
|
||||||
|
|
||||||
if (offset > (2 * INFOMEM_BLOCK_SIZE))
|
if (offset > (2 * INFOMEM_BLOCK_SIZE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
flash = (uint8_t *) INFOMEM_START + offset;
|
flash = (uint8_t *) INFOMEM_START + offset;
|
||||||
|
|
||||||
_DINT();
|
s = splhigh();
|
||||||
|
|
||||||
// backup into RAM
|
// backup into RAM
|
||||||
memcpy(backup, flash, INFOMEM_BLOCK_SIZE);
|
memcpy(backup, flash, INFOMEM_BLOCK_SIZE);
|
||||||
|
@ -116,6 +117,7 @@ infomem_write(unsigned int offset, unsigned char count, ...)
|
||||||
FCTL1 = FWKEY;
|
FCTL1 = FWKEY;
|
||||||
FCTL3 = FWKEY + LOCK;
|
FCTL3 = FWKEY + LOCK;
|
||||||
|
|
||||||
_EINT();
|
splx(s);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,9 @@ uart_unlock(unsigned char mode)
|
||||||
static void
|
static void
|
||||||
uart_configure(unsigned char mode)
|
uart_configure(unsigned char mode)
|
||||||
{
|
{
|
||||||
_DINT();
|
int s;
|
||||||
|
|
||||||
|
s = splhigh();
|
||||||
|
|
||||||
UART_WAIT_TXDONE();
|
UART_WAIT_TXDONE();
|
||||||
|
|
||||||
|
@ -162,7 +164,8 @@ uart_configure(unsigned char mode)
|
||||||
UMCTL1 = uart_speed_bmn[mode]; // set modulation
|
UMCTL1 = uart_speed_bmn[mode]; // set modulation
|
||||||
|
|
||||||
UCTL1 &= ~SWRST; // clear reset flag
|
UCTL1 &= ~SWRST; // clear reset flag
|
||||||
_EINT(); // enable interrupts
|
|
||||||
|
splx(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue