[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestPowerManager MyComponentC.nc, 1.1.4.4, 1.1.4.5 TestPowerManagerAppC.nc, 1.1.4.2, 1.1.4.3 TestPowerManagerC.nc, 1.1.4.2, 1.1.4.3

Kevin Klues klueska at users.sourceforge.net
Tue Jun 27 14:09:40 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/TestPowerManager
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23761/apps/tests/TestPowerManager

Modified Files:
      Tag: tos-2-resource-pm-eval-cand
	MyComponentC.nc TestPowerManagerAppC.nc TestPowerManagerC.nc 
Log Message:
Updates to the Reosurce interfaces and test applications.  Reintroduction of the immediateRequest command to the normal Resource interface.  Changes to the ResourceController interface to removing requests of any kind.  It is the job of the arbiter to now simply signal the Controller that it now has control whenever the Resource goes idle.  Making these changes simplifies implementation as well as the state machine needed to perform the arbitration, but doesnt change functionality at all.  

Index: MyComponentC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestPowerManager/Attic/MyComponentC.nc,v
retrieving revision 1.1.4.4
retrieving revision 1.1.4.5
diff -C2 -d -r1.1.4.4 -r1.1.4.5
*** MyComponentC.nc	21 Jun 2006 16:02:05 -0000	1.1.4.4
--- MyComponentC.nc	27 Jun 2006 21:09:38 -0000	1.1.4.5
***************
*** 38,42 ****
  configuration MyComponentC{
    provides {
-     interface Init;
      interface Resource[uint8_t];
    }
--- 38,41 ----
***************
*** 46,62 ****
               new TimerMilliC() as StartTimer, new TimerMilliC() as StopTimer,
               new ControlledFcfsArbiterC(MYCOMPONENT_RESOURCE) as Arbiter,
! //              new AsyncStdControlPowerManagerC() as PowerManager;
  //              new AsyncStdControlDeferredPowerManagerC(750) as PowerManager;
  //              new StdControlPowerManagerC() as PowerManager;
  //              new StdControlDeferredPowerManagerC(750) as PowerManager;
  //              new SplitControlPowerManagerC() as PowerManager;
!              new SplitControlDeferredPowerManagerC(750) as PowerManager;
  
-   Init = PowerManager;
    Resource = Arbiter;
  
! //   PowerManager.AsyncStdControl -> MyComponentP.AsyncStdControl;
  //   PowerManager.StdControl -> MyComponentP.StdControl;
!   PowerManager.SplitControl -> MyComponentP.SplitControl;
    PowerManager.ResourceController -> Arbiter.ResourceController;
    PowerManager.ArbiterInfo -> Arbiter.ArbiterInfo;
--- 45,60 ----
               new TimerMilliC() as StartTimer, new TimerMilliC() as StopTimer,
               new ControlledFcfsArbiterC(MYCOMPONENT_RESOURCE) as Arbiter,
!              new AsyncStdControlPowerManagerC() as PowerManager;
  //              new AsyncStdControlDeferredPowerManagerC(750) as PowerManager;
  //              new StdControlPowerManagerC() as PowerManager;
  //              new StdControlDeferredPowerManagerC(750) as PowerManager;
  //              new SplitControlPowerManagerC() as PowerManager;
! //              new SplitControlDeferredPowerManagerC(750) as PowerManager;
  
    Resource = Arbiter;
  
!   PowerManager.AsyncStdControl -> MyComponentP.AsyncStdControl;
  //   PowerManager.StdControl -> MyComponentP.StdControl;
! //   PowerManager.SplitControl -> MyComponentP.SplitControl;
    PowerManager.ResourceController -> Arbiter.ResourceController;
    PowerManager.ArbiterInfo -> Arbiter.ArbiterInfo;

Index: TestPowerManagerAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestPowerManager/Attic/TestPowerManagerAppC.nc,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -C2 -d -r1.1.4.2 -r1.1.4.3
*** TestPowerManagerAppC.nc	15 May 2006 18:30:57 -0000	1.1.4.2
--- TestPowerManagerAppC.nc	27 Jun 2006 21:09:38 -0000	1.1.4.3
***************
*** 43,48 ****
    TestPowerManagerC -> MainC.Boot;
    
-   MainC.SoftwareInit -> MyComponentC;
-   
    TestPowerManagerC.TimerMilli -> TimerMilliC;
    TestPowerManagerC.Resource0 -> MyComponentC.Resource[unique("MyComponent.Resource")];
--- 43,46 ----

Index: TestPowerManagerC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestPowerManager/Attic/TestPowerManagerC.nc,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -C2 -d -r1.1.4.2 -r1.1.4.3
*** TestPowerManagerC.nc	15 May 2006 18:30:57 -0000	1.1.4.2
--- TestPowerManagerC.nc	27 Jun 2006 21:09:38 -0000	1.1.4.3
***************
*** 76,81 ****
      if(waiting == TRUE) {
        waiting = FALSE;
!       if(whoHasIt == 0)
!         call Resource1.request();
        if(whoHasIt == 1)
          call Resource0.request();
--- 76,88 ----
      if(waiting == TRUE) {
        waiting = FALSE;
!       if(whoHasIt == 0)  {
!         if(call Resource1.immediateRequest() == SUCCESS) {
!           whoHasIt = 1;
!           call Leds.led2On();
!           call TimerMilli.startOneShot(HOLD_PERIOD);
!           return;
!         }
!         else call Resource1.request();
!       }
        if(whoHasIt == 1)
          call Resource0.request();



More information about the Tinyos-2-commits mailing list