On Jul 17, 2007, at 11:55 PM, Daniel Widyanto wrote:


Hi all,

I have a bit questions about mcombine() in McuSleepC.nc .

tos/chips/atm128/McuSleepC.nc:100 :
powerState = mcombine(getPowerState(), call McuPowerOverride.lowestState());

tos/chips/atm128/atm128hardware.h:132
mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) {
  return (m1 < m2)? m1: m2;
}

If the McuPowerOverride.lowestState() if fan-outed to HplAtm128Timer0AsyncP and
my application (AppC), is it going to be :

powerState = ( getPowerState() < call HplAtm128Timer0AsyncP.McuPowerOverride.lowestState() ) ? getPowerState() : HplAtm128Timer0AsyncP.McuPowerOverride.lowestState ();

//and

powerState = ( getPowerState() < call AppC.McuPowerOverride.lowestState() ) ?
getPowerState() : AppC.McuPowerOverride.lowestState();

Is it true ?

If so, according to Sec 5.2 TinyOS Programming, the order of the combined functions is uncertain. How do I know which value that will be passed into the powerState ?

You know because of the < operator.

The fanout and combine will return the lowest value (which is the highest power state).

Phil


_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to