X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2Flpl%2FDefaultLplP.nc;h=90d60cd169de357c1bffd115b09a0a4bd5900620;hb=36f6b8dd8eeae0ff6a10824cd5863fc1d383f780;hp=689199528c025dde61f3c0e69a52519c0e943980;hpb=79eb6b24acb56f21deaf15f0235a20a3d20455bd;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/lpl/DefaultLplP.nc b/tos/chips/cc2420/lpl/DefaultLplP.nc index 68919952..90d60cd1 100644 --- a/tos/chips/cc2420/lpl/DefaultLplP.nc +++ b/tos/chips/cc2420/lpl/DefaultLplP.nc @@ -83,11 +83,13 @@ implementation { bool dutyCycling; /** - * Radio State + * Radio Power State */ enum { - S_OFF, + S_OFF, // off by default + S_TURNING_ON, S_ON, + S_TURNING_OFF, }; /** @@ -347,9 +349,7 @@ implementation { // just a little longer in case there is more than one lpl transmitter on // the channel. - if(call SendState.isIdle()) { - startOffTimer(); - } + startOffTimer(); } @@ -426,13 +426,15 @@ implementation { /***************** Timer Events ****************/ event void OffTimer.fired() { + call Leds.led1Toggle(); + /* * Only stop the radio if the radio is supposed to be off permanently * or if the duty cycle is on and our sleep interval is not 0 */ if(call SplitControlState.getState() == S_OFF || (call PowerCycle.getSleepInterval() > 0 - && call SplitControlState.getState() == S_ON + && call SplitControlState.getState() != S_OFF && call SendState.getState() == S_LPL_NOT_SENDING)) { post stopRadio(); }