Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/atm1281
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5304
Modified Files:
McuSleepC.nc
Log Message:
bugfix: enable sleep when no alarms are set
Index: McuSleepC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm1281/McuSleepC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** McuSleepC.nc 5 Nov 2007 20:36:41 -0000 1.1
--- McuSleepC.nc 14 Dec 2007 20:29:36 -0000 1.2
***************
*** 87,103 ****
mcu_power_t getPowerState() {
! // Note: we go to sleep even if timer 0, 1, 3, 4, or 5's overflow interrupt
! // is enabled - this allows using these timers as TinyOS "Alarm"s
! // while still having power management.
! // Are external timers running?
if (
! TIMSK0 & (1 << OCIE0A | 1 << OCIE0B | 1 << TOIE0) ||
! TIMSK1 & (1 << ICIE1 | 1 << OCIE1A | 1 << OCIE1B | 1 << OCIE1C | 1 << TOIE1) ||
! TIMSK3 & (1 << ICIE3 | 1 << OCIE3A | 1 << OCIE3B | 1 << OCIE3C | 1 << TOIE3) ||
! // input capture and output compare for timer 4 and 5 are
! // not functional on atm1281
! TIMSK4 & (1 << TOIE4) ||
! TIMSK5 & (1 << TOIE5)
) {
return ATM128_POWER_IDLE;
--- 87,102 ----
mcu_power_t getPowerState() {
! // Note: we go to sleep even if timer 0, 1, 3, 4, or 5's overflow
! // interrupt is enabled - this allows using timers 0, 1 and 3 as TinyOS
! // "Alarm"s while still having power management. (see TEP102 Appendix C)
! // Input capture and output compare for timer 4 and 5 are not functional
! // on the atm1281.
! // Are there any input capture or output compare interrupts enabled
! // for timers 0, 1 or 3?
if (
! TIMSK0 & (1 << OCIE0A | 1 << OCIE0B ) ||
! TIMSK1 & (1 << ICIE1 | 1 << OCIE1A | 1 << OCIE1B | 1 << OCIE1C) ||
! TIMSK3 & (1 << ICIE3 | 1 << OCIE3A | 1 << OCIE3B | 1 << OCIE3C)
) {
return ATM128_POWER_IDLE;