[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestScheduler Makefile, NONE, 1.1.4.2 README.txt, NONE, 1.1.4.2 TestSchedulerAppC.nc, NONE, 1.1.4.2 TestSchedulerC.nc, NONE, 1.1.4.2

Kevin Klues klueska at users.sourceforge.net
Mon May 15 11:35:27 PDT 2006


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

Added Files:
      Tag: tos-2-resource-pm-eval-cand
	Makefile README.txt TestSchedulerAppC.nc TestSchedulerC.nc 
Log Message:
Merging the development branch with the resource/power management evaluation branch.  After this merge all files except those already commited should be identical.

--- NEW FILE: Makefile ---
COMPONENT=TestSchedulerAppC
OPTFLAGS = -O0
include $(MAKERULES)


--- NEW FILE: README.txt ---
TestScheduler is a simple test application for a Scheduler's implementation
of the TaskBasic interface. The application has three tasks, each of
which toggles a different LED after a brief spin loop.

This application has little (if any) use to a TinyOS user; it is intended
to be a basic sanity test for schedulers.

Author:  tinyos-help at millenium.berkeley.edu



--- NEW FILE: TestSchedulerAppC.nc ---
// $Id: TestSchedulerAppC.nc,v 1.1.4.2 2006/05/15 18:35:24 klueska Exp $

/*									tab:4
 * "Copyright (c) 2000-2005 The Regents of the University  of California.  
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 *
 * Copyright (c) 2002-2005 Intel Corporation
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached INTEL-LICENSE     
 * file. If you do not find these files, copies can be found by writing to
 * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
 * 94704.  Attention:  Intel License Inquiry.
 */

/**
 * TestScheduler is a simple scheduler test that posts three CPU
 * intensive tasks of different durations. It is not intended to be
 * of great use to TinyOS programmers; rather, it is a sanity check
 * for schedulers.
 *
 * @author Philip Levis
 * @date Aug 10 2005
 */

configuration TestSchedulerAppC {}
implementation {
  components MainC, TestSchedulerC, LedsC, TinySchedulerC;
  
  
  TestSchedulerC -> MainC.Boot;

  TestSchedulerC.Leds -> LedsC;

  TestSchedulerC.TaskRed -> TinySchedulerC.TaskBasic[unique("TinySchedulerC.TaskBasic")];
  TestSchedulerC.TaskGreen -> TinySchedulerC.TaskBasic[unique("TinySchedulerC.TaskBasic")];
  TestSchedulerC.TaskBlue -> TinySchedulerC.TaskBasic[unique("TinySchedulerC.TaskBasic")];
}


--- NEW FILE: TestSchedulerC.nc ---
// $Id: TestSchedulerC.nc,v 1.1.4.2 2006/05/15 18:35:24 klueska Exp $

/*									tab:4
 * "Copyright (c) 2000-2005 The Regents of the University  of California.  
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 *
 * Copyright (c) 2002-2003 Intel Corporation
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached INTEL-LICENSE     
 * file. If you do not find these files, copies can be found by writing to
 * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
 * 94704.  Attention:  Intel License Inquiry.
 */

/**
 * Implementation for Blink application.  Toggle the red LED when a
 * Timer fires.
 **/

#include "Timer.h"

module TestSchedulerC {
  uses interface Leds;
  uses interface Boot;
  uses interface TaskBasic as TaskRed;
  uses interface TaskBasic as TaskGreen;
  uses interface TaskBasic as TaskBlue;
}
implementation {

  event void TaskRed.runTask() {
    uint16_t i, j;
    for (i= 0; i < 50; i++) {
      for (j = 0; j < 10000; j++) {}
    }
    call Leds.led0Toggle();

    if (call TaskRed.postTask() == FAIL) {
      call Leds.led0Off();
    }
    else {
      call TaskRed.postTask();
    }
  }

  event void TaskGreen.runTask() {
    uint16_t i, j;
    for (i= 0; i < 25; i++) {
      for (j = 0; j < 10000; j++) {}
    }
    call Leds.led1Toggle();

    if (call TaskGreen.postTask() == FAIL) {
      call Leds.led1Off();
    }
  }

  event void TaskBlue.runTask() {
    uint16_t i, j;
    for (i= 0; i < 5; i++) {
      for (j = 0; j < 10000; j++) {}
    }
    call Leds.led2Toggle();

    if (call TaskBlue.postTask() == FAIL) {
      call Leds.led2Off();
    }
  }

  
  
  /**
   * Event from Main that TinyOS has booted: start the timer at 1Hz.
   */
  event void Boot.booted() {
    call Leds.led2Toggle();
    call TaskRed.postTask();
    call TaskGreen.postTask();
    call TaskBlue.postTask();
  }

}





More information about the Tinyos-2-commits mailing list