From: scipio Date: Thu, 13 Sep 2007 19:56:51 +0000 (+0000) Subject: This application is no longer useful: Blink suffices. X-Git-Tag: release_tinyos_2_1_0_0~747 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=9e06ac4cbfd0938f6ec46760be84c6c35a3f647d;p=tinyos-2.x.git This application is no longer useful: Blink suffices. --- diff --git a/apps/tests/mica2/Timer/BlinkC.nc b/apps/tests/mica2/Timer/BlinkC.nc deleted file mode 100644 index 15d4314b..00000000 --- a/apps/tests/mica2/Timer/BlinkC.nc +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -/** - * Copyright (c) 2004-2005 Crossbow Technology, Inc. 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 CROSSBOW TECHNOLOGY OR ANY OF ITS LICENSORS 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 CROSSBOW OR ITS LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * CROSSBOW TECHNOLOGY AND ITS LICENSORS SPECIFICALLY DISCLAIM ALL 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 NEITHER CROSSBOW NOR ANY LICENSOR HAS ANY - * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR - * MODIFICATIONS. - */ - -/// @author Martin Turon - -/** This version of Blink is designed to test ATmega128 AVR timers. */ -configuration BlinkC -{ -} -implementation -{ - components MainC, new BlinkM(uint8_t), LedsC, HplTimerC; - - BlinkM.Boot -> MainC; - - BlinkM.Leds -> LedsC; - - BlinkM.Timer -> HplTimerC.Timer0; - BlinkM.Compare -> HplTimerC.Compare0; - - BlinkM.FastTimer -> HplTimerC.Timer1; - BlinkM.FastCompare -> HplTimerC.Compare1A; -} - diff --git a/apps/tests/mica2/Timer/BlinkM.nc b/apps/tests/mica2/Timer/BlinkM.nc deleted file mode 100644 index 47999db9..00000000 --- a/apps/tests/mica2/Timer/BlinkM.nc +++ /dev/null @@ -1,127 +0,0 @@ -// $Id$ - -/** - * Copyright (c) 2004-2005 Crossbow Technology, Inc. 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 CROSSBOW TECHNOLOGY OR ANY OF ITS LICENSORS 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 CROSSBOW OR ITS LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * CROSSBOW TECHNOLOGY AND ITS LICENSORS SPECIFICALLY DISCLAIM ALL 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 NEITHER CROSSBOW NOR ANY LICENSOR HAS ANY - * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR - * MODIFICATIONS. - */ - -/// @author Martin Turon - -#define SLOW_COMPARE 50 -#define SLOW_COMPARE_ON_CYCLE 320 -#define SLOW_OVERFLOW_CYCLES 500 - -#define FAST_COMPARE 16000 -#define FAST_COMPARE_ON_CYCLE 4 -#define FAST_OVERFLOW_CYCLES 5 - -#include - -/** - * This version of Blink is designed to test ATmega128 AVR timers. - */ -generic module BlinkM(typedef timer_size @integer()) -{ - uses interface HplTimer as Timer; - uses interface HplCompare as Compare; - uses interface HplTimer as FastTimer; - uses interface HplCompare as FastCompare; - uses interface Boot; - uses interface Leds; -} -implementation -{ - norace int scycle = SLOW_OVERFLOW_CYCLES; - norace int fcycle = FAST_OVERFLOW_CYCLES; - - void slow_timer_init() { - atomic { - CLR_BIT(ASSR, AS0); // set Timer/Counter0 to use 32,768khz crystal - - call Timer.setScale(ATM128_CLK8_DIVIDE_32); - call Compare.set(SLOW_COMPARE); // trigger compare in middle of range - call Compare.start(); - - call Timer.start(); - call Timer.set(0); // overflow after 256-6 = 250 cycles - } - } - - void fast_timer_init() { - - atomic { - call FastTimer.setScale(AVR_CLOCK_DIVIDE_8); - call FastCompare.set(FAST_COMPARE); // trigger compare mid pulse - call FastCompare.start(); - - call FastTimer.start(); - call FastTimer.set(0); // overflow after 256-6 = 250 cycles - } - } - - event void Boot.booted() { - slow_timer_init(); - fast_timer_init(); - - while(1) {} - } - - async event void Compare.fired() { - call Leds.led0On(); - call Compare.stop(); - } - - async event void Timer.overflow() { - call Timer.reset(); - - if (scycle == SLOW_COMPARE_ON_CYCLE) { - call Compare.reset(); - call Compare.start(); - } - - if (scycle++ > SLOW_OVERFLOW_CYCLES) { - scycle = 0; - call Leds.led0Off(); - } - } - - async event void FastCompare.fired() { - if (fcycle == FAST_COMPARE_ON_CYCLE) { - call Leds.led2On(); - call FastCompare.stop(); - } - } - - async event void FastTimer.overflow() { - call FastTimer.reset(); - - if (fcycle == FAST_COMPARE_ON_CYCLE) { - call FastCompare.reset(); - call FastCompare.start(); - } - - if (fcycle++ > FAST_OVERFLOW_CYCLES) { - fcycle = 0; - call Leds.led1Toggle(); // toggle overflow led - call Leds.led2Off(); // clear compare led - } - } -} - diff --git a/apps/tests/mica2/Timer/Makefile b/apps/tests/mica2/Timer/Makefile deleted file mode 100644 index 57038bd6..00000000 --- a/apps/tests/mica2/Timer/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -COMPONENT=BlinkC -include $(MAKERULES) -