From 6955e028da2aa945e6b0f09ecc991797e46e36c5 Mon Sep 17 00:00:00 2001 From: nvt-se Date: Fri, 14 Sep 2007 19:20:54 +0000 Subject: [PATCH] Use splhigh and splx. --- platform/msb430/dev/infomem.c | 6 ++++-- platform/msb430/dev/msb430-uart1.c | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/msb430/dev/infomem.c b/platform/msb430/dev/infomem.c index 477fa18ba..b5786fd9d 100644 --- a/platform/msb430/dev/infomem.c +++ b/platform/msb430/dev/infomem.c @@ -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; } diff --git a/platform/msb430/dev/msb430-uart1.c b/platform/msb430/dev/msb430-uart1.c index 523fb89b8..6e3c4bfc5 100644 --- a/platform/msb430/dev/msb430-uart1.c +++ b/platform/msb430/dev/msb430-uart1.c @@ -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