]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/atm128/McuSleepC.nc
Shift timer power state override into McuPowerOverride call.
[tinyos-2.x.git] / tos / chips / atm128 / McuSleepC.nc
index 3f358a27a657e8b66a6b511c1ef41df3fe61a308..6418f739e869182a5d013d5a812a9db2b419ce29 100644 (file)
@@ -64,7 +64,6 @@ implementation {
     (1 << SM1)};               /* power down */
 
   mcu_power_t getPowerState() {
-    uint8_t diff;
     // Note: we go to sleep even if timer 1, 2, or 3's overflow interrupt
     // is enabled - this allows using these timers as TinyOS "Alarm"s
     // while still having power management.
@@ -89,20 +88,6 @@ implementation {
     else if (bit_is_set(ADCSR, ADEN)) { 
       return ATM128_POWER_ADC_NR;
     }
-    // How soon for the timer to go off?
-    else if (TIMSK & (1 << OCIE0 | 1 << TOIE0)) {
-      // need to wait for timer 0 updates propagate before sleeping
-      // (we don't need to worry about reentering sleep mode too early,
-      // as the wake ups from timer0 wait at least one TOSC1 cycle
-      // anyway - see the stabiliseTimer0 function in HplAtm128Timer0AsyncC)
-      while (ASSR & (1 << TCN0UB | 1 << OCR0UB | 1 << TCR0UB))
-       ;
-      diff = OCR0 - TCNT0;
-      if (diff < EXT_STANDBY_T0_THRESHOLD ||
-         TCNT0 > 256 - EXT_STANDBY_T0_THRESHOLD) 
-       return ATM128_POWER_EXT_STANDBY;
-      return ATM128_POWER_SAVE;
-    }
     else {
       return ATM128_POWER_DOWN;
     }