[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/Deluge/extra/micaz ReprogramGuardC.nc, NONE, 1.1 ReprogramGuardP.nc, NONE, 1.1

Razvan Musaloiu-E. razvanm at users.sourceforge.net
Mon May 19 14:25:11 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/Deluge/extra/micaz
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21259/tos/lib/net/Deluge/extra/micaz

Added Files:
	ReprogramGuardC.nc ReprogramGuardP.nc 
Log Message:
Merge of the latest Deluge T2.


--- NEW FILE: ReprogramGuardC.nc ---
configuration ReprogramGuardC
{
  provides interface ReprogramGuard;
}

implementation
{
  components ReprogramGuardP;
  components new VoltageC();
  
  ReprogramGuard = ReprogramGuardP;
  ReprogramGuardP.Voltage -> VoltageC;
}

--- NEW FILE: ReprogramGuardP.nc ---
module ReprogramGuardP
{
  provides interface ReprogramGuard;
  uses interface Read<uint16_t> as Voltage;
}

implementation
{
  enum {
    VTHRESH = 0x1CF, // 2.7V
  };

  command error_t ReprogramGuard.okToProgram()
  {
    return call Voltage.read();
  }

  event void Voltage.readDone(error_t result, uint16_t val)
  {
    signal ReprogramGuard.okToProgramDone(result == SUCCESS && val < VTHRESH);
  }
  
}



More information about the Tinyos-2-commits mailing list