From ac25baa53ea15fbbd2a322e91a0d4d2cf9525e3c Mon Sep 17 00:00:00 2001 From: smckown Date: Thu, 4 Sep 2008 22:03:11 +0000 Subject: [PATCH] Better ifdefs around peripheral specific bits in McuSleepC.nc. --- tos/chips/msp430/McuSleepC.nc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tos/chips/msp430/McuSleepC.nc b/tos/chips/msp430/McuSleepC.nc index 504e9add..77a638da 100644 --- a/tos/chips/msp430/McuSleepC.nc +++ b/tos/chips/msp430/McuSleepC.nc @@ -69,18 +69,22 @@ implementation { if ((((TACCTL0 & CCIE) || (TACCTL1 & CCIE) || (TACCTL2 & CCIE)) && - ((TACTL & TASSEL_3) == TASSEL_2)) || - ((ME1 & (UTXE0 | URXE0)) && (U0TCTL & SSEL1)) || - ((ME2 & (UTXE1 | URXE1)) && (U1TCTL & SSEL1)) -#ifdef __msp430_have_usart0_with_i2c + ((TACTL & TASSEL_3) == TASSEL_2)) +#ifdef __MSP430_HAS_UART0__ + || ((ME1 & (UTXE0 | URXE0)) && (U0TCTL & SSEL1)) +#endif +#ifdef __MSP430_HAS_UART1__ + || ((ME2 & (UTXE1 | URXE1)) && (U1TCTL & SSEL1)) +#endif +#ifdef __MSP430_HAS_I2C__ // registers end in "nr" to prevent nesC race condition detection - || ((U0CTLnr & I2CEN) && (I2CTCTLnr & SSEL1) && + || ((U0CTLnr & I2CEN) && (I2CTCTLnr & SSEL1) && (I2CDCTLnr & I2CBUSY) && (U0CTLnr & SYNC) && (U0CTLnr & I2C)) #endif ) pState = MSP430_POWER_LPM1; -#ifdef __msp430_have_adc12 +#ifdef __MSP430_HAS_ADC12 // ADC12 check, pre-condition: pState != MSP430_POWER_ACTIVE if (ADC12CTL0 & ADC12ON){ if (ADC12CTL1 & ADC12SSEL_2){ -- 2.39.2