]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/pxa27x/timer/HalPXA27xSleepM.nc
Swapping HEAD and DEVEL branches
[tinyos-2.x.git] / tos / chips / pxa27x / timer / HalPXA27xSleepM.nc
index f65e8d7901b9fcf647ccb8bbd99238e2bf1dbc1b..fa07c0ea05e3137e86d5c43cd8971decc5996980 100644 (file)
@@ -43,7 +43,7 @@ module HalPXA27xSleepM {
 
 implementation {
 
-  void doSleep(uint32_t swRegVal) {
+  void doSleep(uint32_t swRegVal, bool useDeepSleep) {
     int i;
     call HplPXA27xPower.setPWER(PWER_WERTC);
     // let it wrap around itself if necessary
@@ -54,8 +54,14 @@ implementation {
     call HplPXA27xRTC.setRTSR(RTSR_SWCE);
     for(i = 0; i < 5000; i++); // spin for a bit
 
-    call HplPXA27xPower.setPWRMode(PWRMODE_M_SLEEP);
+    if (useDeepSleep) {
+      call HplPXA27xPower.setPWRMode(PWRMODE_M_DEEPSLEEP);
+      // this call never returns
+    }
+    else {
+      call HplPXA27xPower.setPWRMode(PWRMODE_M_SLEEP);
     // this call never returns
+    }
   }