[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/deluge/Blink BlinkAppC.nc, NONE, 1.1 BlinkC.nc, NONE, 1.1 Makefile, NONE, 1.1 burn, NONE, 1.1 volumes-stm25p.xml, NONE, 1.1

Razvan Musaloiu-E. razvanm at users.sourceforge.net
Tue May 22 13:34:22 PDT 2007


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

Added Files:
	BlinkAppC.nc BlinkC.nc Makefile burn volumes-stm25p.xml 
Log Message:
Initial commit of the Deluge T2. Some notes:
- TOSBoot includes some code to allow the MicaZ version to compile but it's not support for it it's not done yet.
- tools/tinyos/misc/Makefile.am is not updated yet so the new tools will not be installed by default.


--- NEW FILE: BlinkAppC.nc ---
/*
 * "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.
 */

/**
 * Blink is a basic application that toggles the a mote LED periodically.
 * It does so by starting a Timer that fires every second. It uses the
 * OSKI TimerMilli service to achieve this goal.
 *
 * @author tinyos-help at millennium.berkeley.edu
 * @author Chieh-Jan Mike Liang <cliang4 at cs.jhu.edu>
 * @author Razvan Musaloiu-E. <razvanm at cs.jhu.edu>
 **/

configuration BlinkAppC
{
}
implementation
{
  components MainC, BlinkC, LedsC, DelugeC;
  components new TimerMilliC() as Timer0;

  BlinkC -> MainC.Boot;

  BlinkC.Timer0 -> Timer0;
  BlinkC.Leds -> LedsC;
}


--- NEW FILE: BlinkC.nc ---
/*
 * "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.
 *
 * @author tinyos-help at millennium.berkeley.edu
 * @author Chieh-Jan Mike Liang <cliang4 at cs.jhu.edu>
 * @author Razvan Musaloiu-E. <razvanm at cs.jhu.edu>
 **/

#include "Timer.h"

module BlinkC
{
  uses interface Timer<TMilli> as Timer0;
  uses interface Leds;
  uses interface Boot;
}

implementation
{
  event void Boot.booted()
  {
    call Timer0.startPeriodic( 500 );
  }

  event void Timer0.fired()
  {
    dbg("BlinkC", "Timer 0 fired @ %s.\n", sim_time_string());
#ifndef BLINK_REVERSE
    call Leds.led1Toggle();
#else
    call Leds.led2Toggle();
#endif
  }
}


--- NEW FILE: Makefile ---
COMPONENT=BlinkAppC
TINYOS_NP=BNP

CFLAGS += -DTOSH_DATA_LENGTH=100
CFLAGS += -DDELUGE_BASESTATION

include $(MAKERULES)

--- NEW FILE: burn ---
#!/bin/bash

if [ $# -ne 1 ]; then
  echo "Usage: $0 /dev/ttyUSB0"
  exit 2
fi

PORT=$1
make clean

echo ==================== Compile and load Blink ====================
make telosb install bsl,$PORT

echo ==================== Compile a new Blink ====================
CFLAGS=-DBLINK_REVERSE make telosb 

echo ==================== Upload the image ====================
../../../../tools/tinyos/misc/tos-deluge $PORT -i 0 build/telosb/tos_image.xml

echo ==================== Reboot ====================
../../../../tools/tinyos/misc/tos-deluge $PORT -r 0 

--- NEW FILE: volumes-stm25p.xml ---
<volume_table>
  <volume name="DELUGE0" size="65536"/>
  <volume name="DELUGE1" size="65536"/>
</volume_table>


More information about the Tinyos-2-commits mailing list