[Tinyos-2-commits] [tinyos-main] r5736 committed - atmega: enable/disable sleep just before/after the sleep instruction

tinyos-main at googlecode.com tinyos-main at googlecode.com
Tue Sep 13 15:46:52 PDT 2011


Revision: 5736
Author:   mmaroti
Date:     Tue Sep 13 15:45:52 2011
Log:      atmega: enable/disable sleep just before/after the sleep  
instruction
http://code.google.com/p/tinyos-main/source/detail?r=5736

Modified:
  /trunk/tos/chips/atm128/McuSleepC.nc
  /trunk/tos/platforms/mica/PlatformP.nc
  /trunk/tos/platforms/ucmini/PlatformLedsC.nc
  /trunk/tos/platforms/ucmini/PlatformP.nc

=======================================
--- /trunk/tos/chips/atm128/McuSleepC.nc	Sun Jul 17 06:03:53 2011
+++ /trunk/tos/chips/atm128/McuSleepC.nc	Tue Sep 13 15:45:52 2011
@@ -113,6 +113,8 @@
      // All of memory may change at this point...
      asm volatile ("sleep" : : : "memory");
      cli();
+
+    CLR_BIT(MCUCR, SE);
    }

    async command void McuPowerState.update() {
=======================================
--- /trunk/tos/platforms/mica/PlatformP.nc	Tue Jun 29 15:07:56 2010
+++ /trunk/tos/platforms/mica/PlatformP.nc	Tue Sep 13 15:45:52 2011
@@ -48,13 +48,6 @@
  }
  implementation
  {
-  void power_init() {
-      atomic {
-	MCUCR = _BV(SE);      // Internal RAM, IDLE, rupt vector at 0x0002,
-			      // enable sleep instruction!
-      }
-  }
-
    command error_t Init.init()
    {
      error_t ok;
@@ -63,12 +56,7 @@
      ok = call MeasureClock.init();
      ok = ecombine(ok, call MoteInit.init());

-    if (ok != SUCCESS)
-      return ok;
-
-    power_init();
-
-    return SUCCESS;
+    return ok;
    }
  }

=======================================
--- /trunk/tos/platforms/ucmini/PlatformLedsC.nc	Sun Sep  4 02:04:37 2011
+++ /trunk/tos/platforms/ucmini/PlatformLedsC.nc	Tue Sep 13 15:45:52 2011
@@ -51,15 +51,15 @@

    components PlatformC;
    Init = PlatformC.LedsInit;
-	#if UCMINI_REV == 49
-  Led0 = IO.PortE5;
-  Led1 = IO.PortE6;
-  Led2 = IO.PortE7;
+#if UCMINI_REV == 49
+  Led0 = IO.PortE5;
+  Led1 = IO.PortE6;
+  Led2 = IO.PortE7;
    Led3 = IO.PortE3;
-	#else
-	Led0 = IO.PortE4;
-  Led1 = IO.PortE5;
-  Led2 = IO.PortE6;
+#else
+  Led0 = IO.PortE4;
+  Led1 = IO.PortE5;
+  Led2 = IO.PortE6;
    Led3 = IO.PortE7;
-	#endif
-}
+#endif
+}
=======================================
--- /trunk/tos/platforms/ucmini/PlatformP.nc	Sun Sep  4 02:04:37 2011
+++ /trunk/tos/platforms/ucmini/PlatformP.nc	Tue Sep 13 15:45:52 2011
@@ -57,15 +57,6 @@

  implementation
  {
-  error_t powerInit()
-  {
-    atomic
-    {
-      MCUCR = _BV(SE);	// Internal RAM, IDLE, rupt vector at 0x0002,
-    }
-    return SUCCESS;
-  }
-
    command error_t Init.init()
    {
      error_t ok;
@@ -85,7 +76,6 @@

      ok = call McuInit.init();
      ok = ecombine(ok, call LedsInit.init());
-    ok = ecombine(ok, powerInit());
      ok = ecombine(ok, call RadioInit.init());
      ok = ecombine(ok, call Stm25pInit.init());
      ok = ecombine(ok, call ADCInit.init());


More information about the Tinyos-2-commits mailing list