[Tinyos-devel] Msp430RefVoltArbiterImplP.nc switchOff loop

Maxime Muller - s h o c k f i s h / maxime at shockfish.com
Wed Apr 4 08:37:15 PDT 2007


Hi all,

On tos 2.x, file $TOSDIR/chips/msp430/adc12/Msp430RefVoltArbiterImplP.nc
during event void AdcResource.granted[uint8_t client]()
If your sref is not REFERENCE_VREFplus_AVss ||  
REFERENCE_VREFplus_VREFnegterm
then you will never call Refvolt_1/2_5V.start()

Now while releasing the resource, imho, we should do the same check
else we end up with a post switchOff() loop
as call RefVolt_1_5V.stop() will fail.

 async command error_t ClientResource.release[uint8_t client]()
  {
      const msp430adc12_channel_config_t* settings  = call 
Config.getConfiguration[client]();
      atomic {
      if (owner == client){         
          owner = NO_OWNER;
          if (settings->sref == REFERENCE_VREFplus_AVss ||
          settings->sref == REFERENCE_VREFplus_VREFnegterm)
          post switchOff();
      }
      }
    return call AdcResource.release[client]();
  }
seems better or did i miss something?

Regards,
maxime


More information about the Tinyos-devel mailing list