[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/pxa27x/timer
HalPXA27xSleep.nc, 1.1.2.1, 1.1.2.2 HalPXA27xSleepM.nc,
1.1.2.1, 1.1.2.2
Kaisen Lin
kaisenl at users.sourceforge.net
Tue Aug 8 15:39:17 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7895
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
HalPXA27xSleep.nc HalPXA27xSleepM.nc
Log Message:
Added PXA27X sleep in hours
Index: HalPXA27xSleep.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/Attic/HalPXA27xSleep.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** HalPXA27xSleep.nc 1 Aug 2006 00:02:48 -0000 1.1.2.1
--- HalPXA27xSleep.nc 8 Aug 2006 22:39:15 -0000 1.1.2.2
***************
*** 39,41 ****
--- 39,42 ----
// sleep for 'time' minutes
async command void sleepMinutes(uint16_t time);
+ async command void sleepHours(uint16_t time);
}
Index: HalPXA27xSleepM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/Attic/HalPXA27xSleepM.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** HalPXA27xSleepM.nc 1 Aug 2006 00:02:48 -0000 1.1.2.1
--- HalPXA27xSleepM.nc 8 Aug 2006 22:39:15 -0000 1.1.2.2
***************
*** 71,73 ****
--- 71,88 ----
// this call never returns
}
+
+ async command void HalPXA27xSleep.sleepHours(uint16_t time) {
+ int i;
+ call HplPXA27xPower.setPWER(PWER_WERTC);
+ // let it wrap around itself if necessary
+ call HplPXA27xRTC.setSWCR(0);
+ call HplPXA27xRTC.setSWAR1((time << 19) & 0xF80000); // hours
+ call HplPXA27xRTC.setSWAR2(0x00FFFFFF);
+ for(i = 0; i < 10; i++); // spin for a bit
+ call HplPXA27xRTC.setRTSR(RTSR_SWCE);
+ for(i = 0; i < 5000; i++); // spin for a bit
+
+ call HplPXA27xPower.setPWRMode(PWRMODE_M_SLEEP);
+ // this call never returns
+ }
}
More information about the Tinyos-2-commits
mailing list