]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/atm1281/McuSleepC.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / chips / atm1281 / McuSleepC.nc
index ad4a4ab0aca11e3a6ed9817cff84602efa288908..65f1389c334dab50047b057bd72db380d4e1f444 100644 (file)
@@ -106,10 +106,10 @@ implementation {
       return ATM128_POWER_IDLE;
     }
     // UARTs are active
-    else if (UCSR0B & (1 << TXCIE0 | 1 << RXCIE0)) { // UART
+    else if (UCSR0B & (1 << TXCIE0 | 1 << RXCIE0 | 1 << UDRIE0)) { // UART
       return ATM128_POWER_IDLE;
     }
-    else if (UCSR1B & (1 << TXCIE1 | 1 << RXCIE1)) { // UART
+    else if (UCSR1B & (1 << TXCIE1 | 1 << RXCIE1 | 1 << UDRIE1)) { // UART
       return ATM128_POWER_IDLE;
     }
     // I2C (Two-wire) is active
@@ -132,7 +132,8 @@ implementation {
     SMCR =
       (SMCR & 0xf0) | 1 << SE | read_uint8_t(&atm128PowerBits[powerState]);
     sei();
-    asm volatile ("sleep");
+    // All of memory may change at this point...
+    asm volatile ("sleep" : : : "memory");
     cli();
 
     CLR_BIT(SMCR, SE);