[Tinyos-devel] McuSleepC powerState in atm128

Daniel Widyanto danielw at wireless-people.com
Thu Aug 2 18:54:51 PDT 2007


Hi,

I've looked the McuSleepC.nc for atm128 implementation. 

IMHO, I think the correct way to determine the lowest SLEEP
mode from the available McuPowerOverride fan-in is suppose to be
like this :

//////////////////////////////////
--- McuSleepC.nc.v2.0.2	2007-08-03 09:35:38.000000000 +0800
+++ McuSleepC.nc.mine	2007-08-03 09:45:36.000000000 +0800
@@ -96,8 +96,9 @@
   
   async command void McuSleep.sleep() {
     uint8_t powerState;
-
-    powerState = mcombine(getPowerState(), call McuPowerOverride.lowestState());
+    
+    powerState = getPowerState();
+    powerState = mcombine(powerState, call McuPowerOverride.lowestState());
     MCUCR =
       (MCUCR & 0xe3) | 1 << SE | read_uint8_t(&atm128PowerBits[powerState]);
////////////////////////////////////

The previous implementation only works if we have single fan-in McuPowerOverride 
component. 

Regards,

-daniel






More information about the Tinyos-devel mailing list