From 5258c407b5cdd992c87f3b99e8634fbfbbcf7f2c Mon Sep 17 00:00:00 2001 From: beutel Date: Thu, 21 Jun 2007 21:44:16 +0000 Subject: [PATCH] fixed platform definition for btnode3 working apps are Null and Blink (on 4 leds!) - RadioCountToLed still has some weirdness... --- tos/platforms/btnode3/.platform | 10 +++--- tos/platforms/btnode3/PlatformLedsC.nc | 8 ++--- tos/platforms/btnode3/VoltageC.nc | 43 -------------------------- tos/platforms/btnode3/hardware.h | 10 ++++-- 4 files changed, 18 insertions(+), 53 deletions(-) delete mode 100644 tos/platforms/btnode3/VoltageC.nc diff --git a/tos/platforms/btnode3/.platform b/tos/platforms/btnode3/.platform index f76588ce..439fdd74 100644 --- a/tos/platforms/btnode3/.platform +++ b/tos/platforms/btnode3/.platform @@ -9,6 +9,7 @@ # # $Id$ # + push( @includes, qw( %T/platforms/btnode3 @@ -16,20 +17,21 @@ push( @includes, qw( %T/platforms/mica %T/platforms/mica2 %T/platforms/mica2/chips/cc1000 - %T/chips/cc1000 + %T/chips/cc1000_lpl %T/chips/atm128 %T/chips/atm128/adc + %T/chips/atm128/i2c %T/chips/atm128/pins %T/chips/atm128/spi %T/chips/atm128/timer + %T/lib/timer %T/lib/serial %T/lib/power - %T/lib/timer - + # %T/platforms/mica2/chips/at45db not existent on btnode3 # %T/platforms/mica/chips/at45db not existent on btnode3 # %T/chips/at45db - + ) ); @opts = qw( diff --git a/tos/platforms/btnode3/PlatformLedsC.nc b/tos/platforms/btnode3/PlatformLedsC.nc index 085768b5..32d83774 100644 --- a/tos/platforms/btnode3/PlatformLedsC.nc +++ b/tos/platforms/btnode3/PlatformLedsC.nc @@ -1,7 +1,7 @@ // $Id$ /** - * Copyright (c) 2006 ETH Zurich. + * Copyright (c) 2006-2007 ETH Zurich. * Copyright (c) 2004-2005 Crossbow Technology, Inc. All rights reserved. * * Permission to use, copy, modify, and distribute this software and its @@ -45,9 +45,9 @@ implementation Init = PlatformP.MoteInit; - Led0 = IO.PortC1; // Pin C1 = Red LED - Led1 = IO.PortC3; // Pin C3 = Green LED + Led0 = IO.PortC0; // Pin C0 = Blue LED + Led1 = IO.PortC1; // Pin C1 = Red LED Led2 = IO.PortC2; // Pin C2 = Yellow LED - Led3 = IO.PortC0; // Pin C0 = Blue LED + Led3 = IO.PortC3; // Pin C3 = Green LED } diff --git a/tos/platforms/btnode3/VoltageC.nc b/tos/platforms/btnode3/VoltageC.nc deleted file mode 100644 index 8786d043..00000000 --- a/tos/platforms/btnode3/VoltageC.nc +++ /dev/null @@ -1,43 +0,0 @@ -/// $Id$ - -/** - * Copyright (c) 2006 ETH Zurich. - * 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 Hu Siquan - * @author Jan Beutel - */ -configuration VoltageC -{ - provides interface StdControl; - provides interface Read; -} -implementation -{ - components VoltageP, new AdcReadClientC() as VoltageChannel, - HplAtm128GeneralIOC as Pins; - - StdControl = VoltageP; - Read = VoltageChannel; - VoltageChannel.Atm128AdcConfig -> VoltageP; - VoltageP.BAT_MON -> Pins.PortF3; -} diff --git a/tos/platforms/btnode3/hardware.h b/tos/platforms/btnode3/hardware.h index 4a872291..37732a76 100644 --- a/tos/platforms/btnode3/hardware.h +++ b/tos/platforms/btnode3/hardware.h @@ -4,7 +4,7 @@ * this license. If you do not agree to this license, do not download, * install, copy or use the software. * - * Copyright (c) 2006 ETH Zurich. + * Copyright (c) 2006-2007 ETH Zurich. * Copyright (c) 2004-2005 Crossbow Technology, Inc. * Copyright (c) 2002-2003 Intel Corporation. * Copyright (c) 2000-2003 The Regents of the University of California. @@ -43,6 +43,12 @@ #ifndef HARDWARE_H #define HARDWARE_H +#ifndef MHZ +/* Clock rate is ~8MHz except if specified by user + (this value must be a power of 2, see MicaTimer.h and MeasureClockC.nc) */ +#define MHZ 8 +#endif + #include #include @@ -54,7 +60,7 @@ enum { }; enum { - PLATFORM_MHZ = 8 // Approximate clock frequency (closest power of 2) + PLATFORM_BAUDRATE = 57600L }; #endif //HARDWARE_H -- 2.39.2