[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/atm128 McuSleepC.nc,
1.3, 1.4
David Gay
idgay at users.sourceforge.net
Fri Aug 11 13:49:02 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15907
Modified Files:
McuSleepC.nc
Log Message:
use per-platform/per-clock-rate timer 0 threshold for selecting power save
vs ext standby
Index: McuSleepC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/McuSleepC.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** McuSleepC.nc 9 Aug 2006 22:43:38 -0000 1.3
--- McuSleepC.nc 11 Aug 2006 20:49:00 -0000 1.4
***************
*** 49,53 ****
implementation {
/* There is no dirty bit management because the sleep mode depends on
! the amount of time remaining in timer0. */
/* Note that the power values are maintained in an order
--- 49,54 ----
implementation {
/* There is no dirty bit management because the sleep mode depends on
! the amount of time remaining in timer0. Note also that the
! sleep cost depends typically depends on waiting for ASSR to clear. */
/* Note that the power values are maintained in an order
***************
*** 91,100 ****
// How soon for the timer to go off?
else if (TIMSK & (1 << OCIE0 | 1 << TOIE0)) {
! // force waiting for timer0 update (overflow glitches otherwise)
! TCCR0 = TCCR0;
while (ASSR & (1 << TCN0UB | 1 << OCR0UB | 1 << TCR0UB))
;
diff = OCR0 - TCNT0;
! if (diff < 16 || TCNT0 > 240)
return ATM128_POWER_EXT_STANDBY;
return ATM128_POWER_SAVE;
--- 92,104 ----
// How soon for the timer to go off?
else if (TIMSK & (1 << OCIE0 | 1 << TOIE0)) {
! // need to wait for timer 0 updates propagate before sleeping
! // (we don't need to worry about reentering sleep mode too early,
! // as the wake ups from timer0 wait at least one TOSC1 cycle
! // anyway - see the stabiliseTimer0 function in HplAtm128Timer0AsyncC)
while (ASSR & (1 << TCN0UB | 1 << OCR0UB | 1 << TCR0UB))
;
diff = OCR0 - TCNT0;
! if (diff < EXT_STANDBY_T0_THRESHOLD ||
! TCNT0 > 256 - EXT_STANDBY_T0_THRESHOLD)
return ATM128_POWER_EXT_STANDBY;
return ATM128_POWER_SAVE;
More information about the Tinyos-2-commits
mailing list