[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/eyesIFX/Radio/TestHPL Makefile, NONE, 1.2.2.2 TestHPLTDA5250C.nc, NONE, 1.2.2.2 TestHPLTDA5250P.nc, NONE, 1.1.4.2

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


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

Added Files:
      Tag: tos-2-resource-pm-eval-cand
	Makefile TestHPLTDA5250C.nc TestHPLTDA5250P.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=TestHPLTDA5250C
CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
include $(MAKERULES)


--- NEW FILE: TestHPLTDA5250C.nc ---
// $Id: TestHPLTDA5250C.nc,v 1.2.2.2 2006/05/15 18:35:26 klueska 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.
 */
/**
 *
 **/

#include "Timer.h"
configuration TestHPLTDA5250C {
}
implementation {
  components MainC
           , TestHPLTDA5250P
           , new AlarmMilliC() as ModeTimer
           , LedsC
           , HPLTDA5250ConfigC 
  ;

  TestHPLTDA5250P -> MainC.Boot;
  
  
  MainC.SoftwareInit -> HPLTDA5250ConfigC;

  TestHPLTDA5250P.Resource -> HPLTDA5250ConfigC.Resource;
  TestHPLTDA5250P.ModeTimer -> ModeTimer;
  TestHPLTDA5250P.Leds -> LedsC;
  TestHPLTDA5250P.TDA5250Config -> HPLTDA5250ConfigC.HPLTDA5250Config;
}




--- NEW FILE: TestHPLTDA5250P.nc ---
/*
 * Copyright (c) 2004, Technische Universitat Berlin
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 * - Neither the name of the Technische Universitat Berlin nor the names
 *   of its contributors may be used to endorse or promote products derived
 *   from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * - Revision -------------------------------------------------------------
 * $Revision: 1.1.4.2 $
 * $Date: 2006/05/15 18:35:26 $ 
 * ======================================================================== 
 */
 
 /**
 * TestTDA5250M Application
 * Test Application for the HPL layer of the TDA5250 radio
 *
 * @author Kevin Klues (klues at tkn.tu-berlin.de)
  */

module TestHPLTDA5250P {
  uses {
	  interface Boot;
	  interface Leds;
	  interface Alarm<TMilli, uint32_t> as ModeTimer;
	  interface HPLTDA5250Config as TDA5250Config;
	  interface Resource;
  }  
}

implementation {
  
	uint8_t mode;
   
	event void Boot.booted() {
		mode = 0;
		call Resource.request();
	}
  
	event void Resource.granted() {
		call TDA5250Config.reset();
		call ModeTimer.start(50);
	}
  
	event void Resource.requested() {
		call ModeTimer.stop();
		call Resource.release();
		call Resource.request();
	}  

  /***********************************************************************
	* Commands and events
  ***********************************************************************/
	async event void ModeTimer.fired() {
		if(mode == 0) {
			call TDA5250Config.SetRxMode();
			mode = 1;
			call Leds.led0Off();
			call Leds.led1Off();
			call Leds.led2Off();     
		}
		else if(mode == 1) {
			call TDA5250Config.SetTxMode();
			mode = 2;
			call Leds.led0Off();
			call Leds.led1Off();
			call Leds.led2On();       
		}     
		else if(mode == 2) {
			call TDA5250Config.SetTimerMode(5, 5);
			mode = 3;
			call Leds.led0Off();
			call Leds.led1On();
			call Leds.led2Off();    
		}
		else if(mode == 3) {
			call TDA5250Config.SetSelfPollingMode(5, 5);
			mode = 4;
			call Leds.led0Off();
			call Leds.led1On();
			call Leds.led2On(); 
		}    
		else {
			call TDA5250Config.SetSlaveMode();
			call TDA5250Config.SetSleepMode();
			mode = 0;
			call Leds.led0On();
			call Leds.led1Off();
			call Leds.led2Off();
		}   
		call ModeTimer.start(50);
	}
  
	async event void TDA5250Config.PWDDDInterrupt() {
		TOSH_TOGGLE_LED3_PIN();
	} 
	
	async event void TDA5250Config.SetSleepModeDone() {
		// dummy
	} 
	
	async event void TDA5250Config.SetTxModeDone() {
		// dummy
	} 
	
	async event void TDA5250Config.SetRxModeDone() {
		// dummy
	} 
	
	async event void TDA5250Config.RSSIStable() {
		// dummy
	} 
}





More information about the Tinyos-2-commits mailing list