[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/diku/mcs51/apps/BlinkTimer BlinkTimer.nc, NONE, 1.1 BlinkTimerM.nc, NONE, 1.1 Makefile, NONE, 1.1 SingleTimer.nc, NONE, 1.1

Martin Leopold mleopold at users.sourceforge.net
Fri Apr 7 05:49:58 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/diku/mcs51/apps/BlinkTimer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20038/apps/BlinkTimer

Added Files:
	BlinkTimer.nc BlinkTimerM.nc Makefile SingleTimer.nc 
Log Message:
A first go at an mcs51 port

--- NEW FILE: BlinkTimer.nc ---
/* 
*/

configuration BlinkTimer {
}
implementation {
  components Main, BlinkTimerM, LedsC, SingleTimer;
  Main.StdControl -> BlinkTimerM.StdControl;
  Main.StdControl -> SingleTimer.StdControl;
  BlinkTimerM.Timer -> SingleTimer.Timer;
  BlinkTimerM.Leds -> LedsC;
}

--- NEW FILE: BlinkTimerM.nc ---
/*
  The Blink application using Timer
  
  Toggles the three LEDs and show counter on P0.0 - P0.3
*/

module BlinkTimerM {
  provides {
     interface StdControl;
  }
  uses {
     interface Leds;
     interface Timer;
  }
}

implementation {
//  uint8_t y=0;

  command result_t StdControl.init() {
    call Leds.init();
    return SUCCESS;
  }

  command result_t StdControl.start() {
    call Leds.redOff();
    call Leds.greenOff();
    call Leds.yellowOff();
    return call Timer.start(TIMER_REPEAT, 400);
  }

  command result_t StdControl.stop() {
    return call Timer.stop();
  }

  event result_t Timer.fired() {
    call Leds.yellowToggle();
    return SUCCESS;
  }
}

--- NEW FILE: Makefile ---
COMPONENT=BlinkTimer
PFLAGS=-I%T/lib/Counters 

ifdef IM_SENDER
 PFLAGS += "-DIM_SENDER"
endif

include ../Makerules

--- NEW FILE: SingleTimer.nc ---
// $Id: SingleTimer.nc,v 1.1 2006/04/07 12:49:54 mleopold Exp $

/*									tab:4
 * "Copyright (c) 2000-2003 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.
 */
/*
 *
 * Authors:		Phil Levis
 * Date last modified:  7/30/03
 * Description:         This component provides a single timer, it is used in
 *                      the TinyOS tutorials to provide a Timer without
 *			requiring all of the mechanisms of parameterized
 *			interfaces.
 */

/**
 * @author Phil Levis
 */


configuration SingleTimer {
  provides interface Timer;
  provides interface StdControl;
}

implementation {
  components TimerC;
  
  Timer = TimerC.Timer[unique("Timer")];
  StdControl = TimerC;
}



More information about the Tinyos-contrib-commits mailing list