tinyos8051wg-commit Mailing List for tinyos8051wg (Page 3)
Status: Alpha
Brought to you by:
mleopold
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
(23) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(20) |
Oct
(4) |
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mle...@us...> - 2009-03-16 16:48:33
|
Revision: 1058 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1058&view=rev Author: mleopold Date: 2009-03-16 16:48:12 +0000 (Mon, 16 Mar 2009) Log Message: ----------- Updated example env file Modified Paths: -------------- trunk/diku/env trunk/diku/mcs51/doc/ChangeLog trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh trunk/diku/mcs51/tos/chips/cip51/spi/HalCip51SimpleSPIP.nc Modified: trunk/diku/env =================================================================== --- trunk/diku/env 2009-03-16 16:17:45 UTC (rev 1057) +++ trunk/diku/env 2009-03-16 16:48:12 UTC (rev 1058) @@ -9,8 +9,8 @@ # If using wine set the path to the wine directory containing the # compiler -MCS51_WINE_IAR_PATH=$HOME/.wine.iar -MCS51_WINE_KEIL_PATH=$HOME/.wine.keil +export MCS51_WINE_IAR_PATH=$HOME/.wine.iar +export MCS51_WINE_KEIL_PATH=$HOME/.wine.keil # If using IAR set the path to the executable export MCS51_IAR_PATH=Program\ Files/IAR\ Systems/Embedded\ Workbench\ 4.0\ Evaluation\ version/common/bin/ Modified: trunk/diku/mcs51/doc/ChangeLog =================================================================== --- trunk/diku/mcs51/doc/ChangeLog 2009-03-16 16:17:45 UTC (rev 1057) +++ trunk/diku/mcs51/doc/ChangeLog 2009-03-16 16:48:12 UTC (rev 1058) @@ -12,6 +12,7 @@ * TestAll compiles for all platforms * USBSerialEcho warns that it only works on platforms with USB * c8051F340TB uninitialized variable in PlatformP + * Added mcs51_env_check.sh to check env variables 0.1 pre4 * .platform updated to include all library directories Modified: trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh =================================================================== --- trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh 2009-03-16 16:17:45 UTC (rev 1057) +++ trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh 2009-03-16 16:48:12 UTC (rev 1058) @@ -25,17 +25,17 @@ fi done -MC=`echo $MCS51_COMPILER | tr "[:upper:]" "[:lower:]"` +#MC=`echo $MCS51_COMPILER | tr "[:upper:]" "[:lower:]"` if [ "$MC" = "keil" ]; then KP='' - if [ ! -z "$MCS51_WINE_KEIL_PATH" ]; then + if [ -z "$MCS51_WINE_KEIL_PATH" ]; then + echo "MCS51_WINE_KEIL_PATH not set (using $MCS51_WINE_KEIL_PATH_DEFAULT)" + KP=$MCS51_WINE_KEIL_PATH_DEFAULT + else if [ ! "$VERBOSE" -eq 0 ]; then echo "MCS51_WINE_KEIL_PATH=$MCS51_WINE_KEIL_PATH" fi KP=$MCS51_WINE_KEIL_PATH - else - echo "MCS51_WINE_KEIL_PATH not set (using $MCS51_WINE_KEIL_PATH_DEFAULT)" - KP=$MCS51_WINE_KEIL_PATH_DEFAULT fi if [ ! -e "$KP/dosdevices/c:/Keil" ]; then echo "Keil not found ($KP/dosdevices/c:/Keil)." Modified: trunk/diku/mcs51/tos/chips/cip51/spi/HalCip51SimpleSPIP.nc =================================================================== --- trunk/diku/mcs51/tos/chips/cip51/spi/HalCip51SimpleSPIP.nc 2009-03-16 16:17:45 UTC (rev 1057) +++ trunk/diku/mcs51/tos/chips/cip51/spi/HalCip51SimpleSPIP.nc 2009-03-16 16:48:12 UTC (rev 1058) @@ -70,14 +70,14 @@ mode = _BV(SPI_4WIRE) | _BV(SPI_AUTO_SS) | _BV(SPI_MASTER) | _BV(SPI_INTERRUPT); atomic { - P0MDOUT = 0x0D; // Make SCK, MOSI, and NSS push-pull - P2MDOUT = 0x04; // Make the LED push-pull + P0MDOUT |= 0x0D; // Make SCK, MOSI, and NSS push-pull + P0MDOUT &= 0x02; // Make MISO input + P0MDIN |= 0x02; // Make MISO input - XBR0 |= 2; // Enable the SPI on the XBAR - XBR1 = 0x40; // Enable the XBAR and weak pull-ups + XBR0 |= 2; // Enable the SPI on the XBAR + XBR1 = 0x40; // Enable the XBAR and weak pull-ups - SPI0CKR = 0x0;//(SYSCLK/(2*SPI_CLOCK))-1; - //SPI0CKR = 0xFF;//(SYSCLK/(2*SPI_CLOCK))-1; + SPI0CKR = 0x0;//(SYSCLK/(2*SPI0CKR+1))-1; call SpiControl.setMode(mode); SPIEN = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mle...@us...> - 2009-03-16 16:18:07
|
Revision: 1057 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1057&view=rev Author: mleopold Date: 2009-03-16 16:17:45 +0000 (Mon, 16 Mar 2009) Log Message: ----------- Added script to check environment (til aandeligt udfordrede brugere) Modified Paths: -------------- trunk/diku/mcs51/support/make/mcs51/mcs51.rules Added Paths: ----------- trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh Modified: trunk/diku/mcs51/support/make/mcs51/mcs51.rules =================================================================== --- trunk/diku/mcs51/support/make/mcs51/mcs51.rules 2009-03-09 09:20:38 UTC (rev 1056) +++ trunk/diku/mcs51/support/make/mcs51/mcs51.rules 2009-03-16 16:17:45 UTC (rev 1057) @@ -52,6 +52,9 @@ BUILD_DEPS += exe +# pre ncc deps +BUILD_EXTRA_DEPS += env_check + ifndef MCS51_COMPILER MCS51_COMPILER=keil endif @@ -75,6 +78,9 @@ MCS51_WINE_KEIL=env WINEPREFIX=$(MCS51_WINE_KEIL_PATH) LC_ALL=en_US wine cmd /c endif +.PHONY: env_check +env_check: + $(MCS51_MAKE_PATH)/mcs51/mcs51_env_check.sh ##### # $(APP_C) moves to app.preMangle.c @@ -94,7 +100,7 @@ .PHONY: ncc ncc: builddir $(BUILD_EXTRA_DEPS) - @echo " compiling $(COMPONENT) to a $(PLATFORM) binary" + @echo " compiling $(COMPONENT) to a $(PLATFORM) binary" $(NCC) -S $(OPTFLAGS) $(CFLAGS) $(PFLAGS) $(WIRING_CHECK_FLAGS) $(COMPONENT).nc 2>&1 | \ grep -v "attribute directive ignored" ifdef WIRING_CHECK_FILE Added: trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh =================================================================== --- trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh (rev 0) +++ trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh 2009-03-16 16:17:45 UTC (rev 1057) @@ -0,0 +1,90 @@ +#!/bin/bash + +MCS51_WINE_KEIL_PATH_DEFAULT=~/.wine.keil +MCS51_WINE_IAR_PATH_DEFAULT=~/.wine.iar +RETURN=0 + +VERBOSE=0 +if [ ! -z $1 ]; then + if [ $1 = "-v" ]; then + VERBOSE=1 + fi +fi + +for var in TOSROOT TOSDIR MAKERULES CONTRIBROOT TOSMAKE_PATH MCS51_COMPILER +do +if [ -z "${!var}" ]; then + RETURN=1 + if [ ! "$VERBOSE" -eq 0 ]; then + echo "$var not set" + fi +else + if [ ! "$VERBOSE" -eq 0 ]; then + echo "$var=${!var}" + fi +fi +done + +MC=`echo $MCS51_COMPILER | tr "[:upper:]" "[:lower:]"` +if [ "$MC" = "keil" ]; then + KP='' + if [ ! -z "$MCS51_WINE_KEIL_PATH" ]; then + if [ ! "$VERBOSE" -eq 0 ]; then + echo "MCS51_WINE_KEIL_PATH=$MCS51_WINE_KEIL_PATH" + fi + KP=$MCS51_WINE_KEIL_PATH + else + echo "MCS51_WINE_KEIL_PATH not set (using $MCS51_WINE_KEIL_PATH_DEFAULT)" + KP=$MCS51_WINE_KEIL_PATH_DEFAULT + fi + if [ ! -e "$KP/dosdevices/c:/Keil" ]; then + echo "Keil not found ($KP/dosdevices/c:/Keil)." + RETURN=1 + else + if [ ! "$VERBOSE" -eq 0 ]; then + echo "Keil found ($KP/dosdevices/c:/Keil)." + fi + fi + +fi + +if [ "$MC" = "iar" ]; then + IP='' + if [ ! -z "$MCS51_WINE_IAR_PATH" ]; then + if [ ! "$VERBOSE" -eq 0 ]; then + echo "MCS51_WINE_IAR_PATH=$MCS51_WINE_IAR_PATH" + fi + IP=$MCS51_WINE_IAR_PATH + else + echo "MCS51_WINE_IAR_PATH not set (using $MCS51_WINE_IAR_PATH_DEFAULT)" + IP=$MCS51_WINE_IAR_PATH_DEFAULT + fi + if [ ! -e "$IP/dosdevices/c:/$MCS51_IAR_PATH" ]; then + echo "Keil not found ($IP/dosdevices/c:/$MCS51_IAR_PATH)." + RETURN=1 + else + if [ ! "$VERBOSE" -eq 0 ]; then + echo "IAR found ($KP/dosdevices/c:/$MCS51_IAR_PATH)." + fi + fi +fi + +#if [ "$MC" = "sdcc" ]; then +#fi + + + +if [ ! "$VERBOSE" -eq 0 ]; then + if [ ! "$RETURN" -eq "0" ]; then + echo "Environment check FAILED" + else + echo "Environment check OK" + fi +fi + +if [ -e "$CONTRIBROOT/diku/VERSION" ]; then + echo -n "Found tinyos8051wg version: " + cat "$CONTRIBROOT/diku/VERSION" +fi + +exit "$RETURN" Property changes on: trunk/diku/mcs51/support/make/mcs51/mcs51_env_check.sh ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qz...@us...> - 2009-03-09 09:21:06
|
Revision: 1056 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1056&view=rev Author: qzban Date: 2009-03-09 09:20:38 +0000 (Mon, 09 Mar 2009) Log Message: ----------- Updated the test applications to support TinyOS 2.x Modified Paths: -------------- trunk/diku/tiny15four/apps/beacon_test/ping/Makefile trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc trunk/diku/tiny15four/apps/beacon_test/pong/Makefile trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc trunk/diku/tiny15four/apps/gts_test/ping/Makefile trunk/diku/tiny15four/apps/gts_test/ping/ping.nc trunk/diku/tiny15four/apps/gts_test/ping/pingM.nc trunk/diku/tiny15four/apps/gts_test/pong/Makefile trunk/diku/tiny15four/apps/gts_test/pong/pong.nc trunk/diku/tiny15four/apps/gts_test/pong/pongM.nc trunk/diku/tiny15four/apps/non_beacon_test/ping/Makefile trunk/diku/tiny15four/apps/non_beacon_test/ping/ping.nc trunk/diku/tiny15four/apps/non_beacon_test/ping/pingM.nc trunk/diku/tiny15four/apps/non_beacon_test/pong/Makefile trunk/diku/tiny15four/apps/non_beacon_test/pong/pong.nc trunk/diku/tiny15four/apps/non_beacon_test/pong/pongM.nc trunk/diku/tiny15four/apps/p2p_test/ping/Makefile trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc trunk/diku/tiny15four/apps/p2p_test/pong/Makefile trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc trunk/diku/tiny15four/tos/lib/mac/BeaconGeneratorM.nc trunk/diku/tiny15four/tos/lib/mac/BeaconTrackerM.nc trunk/diku/tiny15four/tos/lib/mac/CfpControlM.nc trunk/diku/tiny15four/tos/lib/mac/StartM.nc Property Changed: ---------------- trunk/diku/tiny15four/apps/beacon_test/ping/ trunk/diku/tiny15four/apps/beacon_test/pong/ trunk/diku/tiny15four/apps/gts_test/ping/ trunk/diku/tiny15four/apps/gts_test/pong/ trunk/diku/tiny15four/apps/non_beacon_test/ping/ trunk/diku/tiny15four/apps/non_beacon_test/pong/ Property changes on: trunk/diku/tiny15four/apps/beacon_test/ping ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/beacon_test/ping/Makefile =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/ping/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/beacon_test/ping/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,8 @@ COMPONENT=ping + +# Only set environment when using freescale 802.15.4 +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) ENVIRONMENT=RFD +endif -include ../../Makerules +include $(MAKERULES) \ No newline at end of file Modified: trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,10 +25,11 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ -#define DBG_OFF 1 +/** + * @author Jan Flora <jan...@di...> + */ + +#define DBG_OFF 0 #define BEACON_SUPPORT configuration ping @@ -36,46 +38,47 @@ } implementation { - components Main, - pingM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pingM; // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pingM.StdControl; + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pingM.Init; - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pingM.Debug -> ConsoleDebugM.Debug; + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pingM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pingM.Debug -> DebugC.Debug; + pingM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pingM.IeeePanDescriptor -> Ieee802154C; - pingM.IeeePibAttribute -> Ieee802154C; - pingM.IeeeSdu -> Ieee802154C; - pingM.IeeeAddress -> Ieee802154C; + pingM.IeeePanDescriptor -> Tiny15FourC; + pingM.IeeePibAttribute -> Tiny15FourC; + pingM.IeeeSdu -> Tiny15FourC; + pingM.IeeeAddress -> Tiny15FourC; // MCPS - pingM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pingM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pingM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pingM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pingM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pingM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pingM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pingM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pingM.MlmeRequestConfirmAssociate -> Ieee802154C.MlmeRequestConfirmAssociate; - pingM.MlmeRequestConfirmScan -> Ieee802154C.MlmeRequestConfirmScan; - pingM.MlmeRequestConfirmSet -> Ieee802154C.MlmeRequestConfirmSet; - pingM.MlmeRequestSync -> Ieee802154C.MlmeRequestSync; - pingM.MlmeIndicationSyncLoss -> Ieee802154C.MlmeIndicationSyncLoss; + pingM.MlmeRequestConfirmAssociate -> Tiny15FourC.MlmeRequestConfirmAssociate; + pingM.MlmeRequestConfirmScan -> Tiny15FourC.MlmeRequestConfirmScan; + pingM.MlmeRequestConfirmSet -> Tiny15FourC.MlmeRequestConfirmSet; + pingM.MlmeRequestSync -> Tiny15FourC.MlmeRequestSync; + pingM.MlmeIndicationSyncLoss -> Tiny15FourC.MlmeIndicationSyncLoss; - pingM.MlmeAssociateRequestConfirm -> Ieee802154C.MlmeAssociateRequestConfirm; - pingM.MlmeScanRequestConfirm -> Ieee802154C.MlmeScanRequestConfirm; - pingM.MlmeSetRequestConfirm -> Ieee802154C.MlmeSetRequestConfirm; - pingM.MlmeSyncRequest -> Ieee802154C.MlmeSyncRequest; - pingM.MlmeSyncLossIndication -> Ieee802154C.MlmeSyncLossIndication; + pingM.MlmeAssociateRequestConfirm -> Tiny15FourC.MlmeAssociateRequestConfirm; + pingM.MlmeScanRequestConfirm -> Tiny15FourC.MlmeScanRequestConfirm; + pingM.MlmeSetRequestConfirm -> Tiny15FourC.MlmeSetRequestConfirm; + pingM.MlmeSyncRequest -> Tiny15FourC.MlmeSyncRequest; + pingM.MlmeSyncLossIndication -> Tiny15FourC.MlmeSyncLossIndication; } - Modified: trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,22 +25,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pingM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeePanDescriptor; interface IeeeMacSdu as IeeeSdu; @@ -65,12 +64,13 @@ interface IeeeRequest<Mlme_SyncRequest> as MlmeRequestSync; interface IeeeIndication<Mlme_SyncLossIndication> as MlmeIndicationSyncLoss; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - //#define DBG_OFF 0 #define DBG_LEVEL 1 #include "Debug.h" @@ -100,18 +100,18 @@ // Forward declarations of helper functions. task void doPing(); - task void doScan(); task void associate(); task void sync(); + void doScan(); void processScan(Mlme_ScanRequestConfirm scanconfirm); void setCoordAddrInfo(); void setBeaconOrder(); void setSuperframeOrder(); void setAutoRequest(bool autoRequest); - result_t setAttribute(Ieee_PibAttribute attribute); + error_t setAttribute(Ieee_PibAttribute attribute); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -137,21 +137,17 @@ TOSH_CLR_PROFILING9_PIN(); #endif + call CommandInterpreter.addCommand("ping", doScan); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x1D, 0x00, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post doScan(); - return SUCCESS; + call CommandInterpreter.prompt(); } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -352,7 +348,7 @@ } } - task void doScan() + void doScan() { Mlme_ScanRequestConfirm request; @@ -477,7 +473,7 @@ setAttribute(attribute); } - result_t setAttribute(Ieee_PibAttribute attribute) + error_t setAttribute(Ieee_PibAttribute attribute) { Mlme_SetRequestConfirm request; Ieee_Status status; Property changes on: trunk/diku/tiny15four/apps/beacon_test/pong ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/beacon_test/pong/Makefile =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/pong/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/beacon_test/pong/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,8 @@ COMPONENT=pong + +# Only set environment when using freescale 802.15.4 +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) ENVIRONMENT=FFDNGTS +endif -include ../../Makerules +include $(MAKERULES) \ No newline at end of file Modified: trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,10 +25,11 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ -#define DBG_OFF 1 +/** + * @author Jan Flora <jan...@di...> + */ + +#define DBG_OFF 0 #define COORDINATOR_SUPPORT #define BEACON_SUPPORT @@ -37,42 +39,44 @@ } implementation { - components Main, - pongM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pongM; - // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pongM.StdControl; - - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pongM.Debug -> ConsoleDebugM.Debug; + // Wire init. + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pongM.Init; + + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pongM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pongM.Debug -> DebugC.Debug; + pongM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pongM.IeeePibAttribute -> Ieee802154C; - pongM.IeeeSdu -> Ieee802154C; - pongM.IeeeAddress -> Ieee802154C; + pongM.IeeePibAttribute -> Tiny15FourC; + pongM.IeeeSdu -> Tiny15FourC; + pongM.IeeeAddress -> Tiny15FourC; // MCPS - pongM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pongM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pongM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pongM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pongM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pongM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pongM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pongM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pongM.MlmeIndicationResponseAssociate -> Ieee802154C.MlmeIndicationResponseAssociate; - pongM.MlmeRequestConfirmSet -> Ieee802154C.MlmeRequestConfirmSet; - pongM.MlmeRequestConfirmStart -> Ieee802154C.MlmeRequestConfirmStart; - pongM.MlmeIndicationCommStatus -> Ieee802154C.MlmeIndicationCommStatus; + pongM.MlmeIndicationResponseAssociate -> Tiny15FourC.MlmeIndicationResponseAssociate; + pongM.MlmeRequestConfirmSet -> Tiny15FourC.MlmeRequestConfirmSet; + pongM.MlmeRequestConfirmStart -> Tiny15FourC.MlmeRequestConfirmStart; + pongM.MlmeIndicationCommStatus -> Tiny15FourC.MlmeIndicationCommStatus; - pongM.MlmeAssociateIndicationResponse -> Ieee802154C.MlmeAssociateIndicationResponse; - pongM.MlmeSetRequestConfirm -> Ieee802154C.MlmeSetRequestConfirm; - pongM.MlmeStartRequestConfirm -> Ieee802154C.MlmeStartRequestConfirm; - pongM.MlmeCommStatusIndication -> Ieee802154C.MlmeCommStatusIndication; + pongM.MlmeAssociateIndicationResponse -> Tiny15FourC.MlmeAssociateIndicationResponse; + pongM.MlmeSetRequestConfirm -> Tiny15FourC.MlmeSetRequestConfirm; + pongM.MlmeStartRequestConfirm -> Tiny15FourC.MlmeStartRequestConfirm; + pongM.MlmeCommStatusIndication -> Tiny15FourC.MlmeCommStatusIndication; } \ No newline at end of file Modified: trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,22 +25,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pongM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeeMacSdu as IeeeSdu; interface IeeeAddress; @@ -62,12 +61,13 @@ interface IeeeRequestConfirm<Mlme_StartRequestConfirm> as MlmeRequestConfirmStart; interface IeeeIndication<Mlme_CommStatusIndication> as MlmeIndicationCommStatus; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - //#define DBG_OFF 0 #define DBG_LEVEL 1 #include "Debug.h" @@ -92,14 +92,14 @@ // Forward declarations of helper functions. task void pingReply(); - task void startPan(); - result_t setAttribute(Ieee_PibAttribute attribute); + void startPan(); + error_t setAttribute(Ieee_PibAttribute attribute); void setShort(uint16_t myShort); void setAssoc(bool allow); void setRxOnWhenIdle(bool status); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -126,21 +126,18 @@ #endif call IeeeAddress.create(&pingReplyAddr); + + call CommandInterpreter.addCommand("start", startPan); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x61, 0x03, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post startPan(); - return SUCCESS; + call CommandInterpreter.prompt(); } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -287,7 +284,7 @@ PAN coordinator role handling *******************************/ - task void startPan() + void startPan() { Mlme_StartRequestConfirm request; @@ -364,7 +361,7 @@ setAttribute(attribute); } - result_t setAttribute(Ieee_PibAttribute attribute) + error_t setAttribute(Ieee_PibAttribute attribute) { Mlme_SetRequestConfirm request; Ieee_Status status; Property changes on: trunk/diku/tiny15four/apps/gts_test/ping ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/gts_test/ping/Makefile =================================================================== --- trunk/diku/tiny15four/apps/gts_test/ping/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/gts_test/ping/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,8 @@ COMPONENT=ping + +# Only set environment when using freescale 802.15.4 +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) ENVIRONMENT=FFD +endif -include ../../Makerules +include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/gts_test/ping/ping.nc =================================================================== --- trunk/diku/tiny15four/apps/gts_test/ping/ping.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/gts_test/ping/ping.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,11 +25,12 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ -#define DBG_OFF 1 +/** + * @author Jan Flora <jan...@di...> + */ +#define DBG_OFF 0 + #define BEACON_SUPPORT #define GTS_SUPPORT @@ -38,49 +40,51 @@ } implementation { - components Main, - pingM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pingM; - // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pingM.StdControl; - - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pingM.Debug -> ConsoleDebugM.Debug; + // Wire init. + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pingM.Init; + + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pingM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pingM.Debug -> DebugC.Debug; + pingM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pingM.IeeePanDescriptor -> Ieee802154C; - pingM.IeeePibAttribute -> Ieee802154C; - pingM.IeeeSdu -> Ieee802154C; - pingM.IeeeAddress -> Ieee802154C; + pingM.IeeePanDescriptor -> Tiny15FourC; + pingM.IeeePibAttribute -> Tiny15FourC; + pingM.IeeeSdu -> Tiny15FourC; + pingM.IeeeAddress -> Tiny15FourC; // MCPS - pingM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pingM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pingM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pingM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pingM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pingM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pingM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pingM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pingM.MlmeRequestConfirmAssociate -> Ieee802154C.MlmeRequestConfirmAssociate; - pingM.MlmeRequestConfirmGts -> Ieee802154C.MlmeRequestConfirmGts; - pingM.MlmeIndicationGts -> Ieee802154C.MlmeIndicationGts; - pingM.MlmeRequestConfirmScan -> Ieee802154C.MlmeRequestConfirmScan; - pingM.MlmeRequestConfirmSet -> Ieee802154C.MlmeRequestConfirmSet; - pingM.MlmeRequestSync -> Ieee802154C.MlmeRequestSync; - pingM.MlmeIndicationSyncLoss -> Ieee802154C.MlmeIndicationSyncLoss; + pingM.MlmeRequestConfirmAssociate -> Tiny15FourC.MlmeRequestConfirmAssociate; + pingM.MlmeRequestConfirmGts -> Tiny15FourC.MlmeRequestConfirmGts; + pingM.MlmeIndicationGts -> Tiny15FourC.MlmeIndicationGts; + pingM.MlmeRequestConfirmScan -> Tiny15FourC.MlmeRequestConfirmScan; + pingM.MlmeRequestConfirmSet -> Tiny15FourC.MlmeRequestConfirmSet; + pingM.MlmeRequestSync -> Tiny15FourC.MlmeRequestSync; + pingM.MlmeIndicationSyncLoss -> Tiny15FourC.MlmeIndicationSyncLoss; - pingM.MlmeAssociateRequestConfirm -> Ieee802154C.MlmeAssociateRequestConfirm; - pingM.MlmeGtsRequestConfirm -> Ieee802154C.MlmeGtsRequestConfirm; - pingM.MlmeGtsIndication -> Ieee802154C.MlmeGtsIndication; - pingM.MlmeScanRequestConfirm -> Ieee802154C.MlmeScanRequestConfirm; - pingM.MlmeSetRequestConfirm -> Ieee802154C.MlmeSetRequestConfirm; - pingM.MlmeSyncRequest -> Ieee802154C.MlmeSyncRequest; - pingM.MlmeSyncLossIndication -> Ieee802154C.MlmeSyncLossIndication; + pingM.MlmeAssociateRequestConfirm -> Tiny15FourC.MlmeAssociateRequestConfirm; + pingM.MlmeGtsRequestConfirm -> Tiny15FourC.MlmeGtsRequestConfirm; + pingM.MlmeGtsIndication -> Tiny15FourC.MlmeGtsIndication; + pingM.MlmeScanRequestConfirm -> Tiny15FourC.MlmeScanRequestConfirm; + pingM.MlmeSetRequestConfirm -> Tiny15FourC.MlmeSetRequestConfirm; + pingM.MlmeSyncRequest -> Tiny15FourC.MlmeSyncRequest; + pingM.MlmeSyncLossIndication -> Tiny15FourC.MlmeSyncLossIndication; } Modified: trunk/diku/tiny15four/apps/gts_test/ping/pingM.nc =================================================================== --- trunk/diku/tiny15four/apps/gts_test/ping/pingM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/gts_test/ping/pingM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,22 +25,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pingM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeePanDescriptor; interface IeeeMacSdu as IeeeSdu; @@ -69,12 +68,13 @@ interface IeeeRequest<Mlme_SyncRequest> as MlmeRequestSync; interface IeeeIndication<Mlme_SyncLossIndication> as MlmeIndicationSyncLoss; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - //#define DBG_OFF 0 #define DBG_LEVEL 1 #include "Debug.h" @@ -104,19 +104,19 @@ // Forward declarations of helper functions. task void doPing(); - task void doScan(); task void associate(); task void sync(); task void allocateGts(); + void doScan(); void processScan(Mlme_ScanRequestConfirm scanconfirm); void setCoordAddrInfo(); void setBeaconOrder(); void setSuperframeOrder(); void setAutoRequest(bool autoRequest); - result_t setAttribute(Ieee_PibAttribute attribute); + error_t setAttribute(Ieee_PibAttribute attribute); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -142,21 +142,17 @@ TOSH_CLR_PROFILING9_PIN(); #endif + call CommandInterpreter.addCommand("ping", doScan); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x1D, 0x00, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post doScan(); - return SUCCESS; + call CommandInterpreter.prompt(); } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -419,7 +415,7 @@ } } - task void doScan() + void doScan() { Mlme_ScanRequestConfirm request; @@ -544,7 +540,7 @@ setAttribute(attribute); } - result_t setAttribute(Ieee_PibAttribute attribute) + error_t setAttribute(Ieee_PibAttribute attribute) { Mlme_SetRequestConfirm request; Ieee_Status status; Property changes on: trunk/diku/tiny15four/apps/gts_test/pong ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/gts_test/pong/Makefile =================================================================== --- trunk/diku/tiny15four/apps/gts_test/pong/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/gts_test/pong/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,8 @@ COMPONENT=pong + +# Only set environment when using freescale 802.15.4 +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) ENVIRONMENT=FFD +endif -include ../../Makerules +include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/gts_test/pong/pong.nc =================================================================== --- trunk/diku/tiny15four/apps/gts_test/pong/pong.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/gts_test/pong/pong.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,10 +25,11 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ -#define DBG_OFF 1 +/** + * @author Jan Flora <jan...@di...> + */ + +#define DBG_OFF 0 #define COORDINATOR_SUPPORT #define BEACON_SUPPORT #define GTS_SUPPORT @@ -38,44 +40,46 @@ } implementation { - components Main, - pongM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pongM; - // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pongM.StdControl; - - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pongM.Debug -> ConsoleDebugM.Debug; + // Wire init. + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pongM.Init; + + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pongM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pongM.Debug -> DebugC.Debug; + pongM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pongM.IeeePibAttribute -> Ieee802154C; - pongM.IeeeSdu -> Ieee802154C; - pongM.IeeeAddress -> Ieee802154C; + pongM.IeeePibAttribute -> Tiny15FourC; + pongM.IeeeSdu -> Tiny15FourC; + pongM.IeeeAddress -> Tiny15FourC; // MCPS - pongM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pongM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pongM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pongM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pongM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pongM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pongM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pongM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pongM.MlmeIndicationResponseAssociate -> Ieee802154C.MlmeIndicationResponseAssociate; - pongM.MlmeRequestConfirmSet -> Ieee802154C.MlmeRequestConfirmSet; - pongM.MlmeRequestConfirmStart -> Ieee802154C.MlmeRequestConfirmStart; - pongM.MlmeIndicationCommStatus -> Ieee802154C.MlmeIndicationCommStatus; - pongM.MlmeIndicationGts -> Ieee802154C.MlmeIndicationGts; + pongM.MlmeIndicationResponseAssociate -> Tiny15FourC.MlmeIndicationResponseAssociate; + pongM.MlmeRequestConfirmSet -> Tiny15FourC.MlmeRequestConfirmSet; + pongM.MlmeRequestConfirmStart -> Tiny15FourC.MlmeRequestConfirmStart; + pongM.MlmeIndicationCommStatus -> Tiny15FourC.MlmeIndicationCommStatus; + pongM.MlmeIndicationGts -> Tiny15FourC.MlmeIndicationGts; - pongM.MlmeAssociateIndicationResponse -> Ieee802154C.MlmeAssociateIndicationResponse; - pongM.MlmeSetRequestConfirm -> Ieee802154C.MlmeSetRequestConfirm; - pongM.MlmeStartRequestConfirm -> Ieee802154C.MlmeStartRequestConfirm; - pongM.MlmeCommStatusIndication -> Ieee802154C.MlmeCommStatusIndication; - pongM.MlmeGtsIndication -> Ieee802154C.MlmeGtsIndication; + pongM.MlmeAssociateIndicationResponse -> Tiny15FourC.MlmeAssociateIndicationResponse; + pongM.MlmeSetRequestConfirm -> Tiny15FourC.MlmeSetRequestConfirm; + pongM.MlmeStartRequestConfirm -> Tiny15FourC.MlmeStartRequestConfirm; + pongM.MlmeCommStatusIndication -> Tiny15FourC.MlmeCommStatusIndication; + pongM.MlmeGtsIndication -> Tiny15FourC.MlmeGtsIndication; } Modified: trunk/diku/tiny15four/apps/gts_test/pong/pongM.nc =================================================================== --- trunk/diku/tiny15four/apps/gts_test/pong/pongM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/gts_test/pong/pongM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,22 +25,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pongM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeeMacSdu as IeeeSdu; interface IeeeAddress; @@ -64,13 +63,13 @@ interface IeeeIndication<Mlme_CommStatusIndication> as MlmeIndicationCommStatus; interface IeeeIndication<Mlme_GtsIndication> as MlmeIndicationGts; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - #define PROFILING - //#define DBG_OFF 0 #define DBG_LEVEL 1 #include "Debug.h" @@ -95,14 +94,14 @@ // Forward declarations of helper functions. task void pingReply(); - task void startPan(); - result_t setAttribute(Ieee_PibAttribute attribute); + void startPan(); + error_t setAttribute(Ieee_PibAttribute attribute); void setShort(uint16_t myShort); void setAssoc(bool allow); void setRxOnWhenIdle(bool status); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -129,21 +128,18 @@ #endif call IeeeAddress.create(&pingReplyAddr); + + call CommandInterpreter.addCommand("start", startPan); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x61, 0x03, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post startPan(); - return SUCCESS; + call CommandInterpreter.prompt(); } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -339,7 +335,7 @@ PAN coordinator role handling *******************************/ - task void startPan() + void startPan() { Mlme_StartRequestConfirm request; @@ -421,7 +417,7 @@ setAttribute(attribute); } - result_t setAttribute(Ieee_PibAttribute attribute) + error_t setAttribute(Ieee_PibAttribute attribute) { Mlme_SetRequestConfirm request; Ieee_Status status; Property changes on: trunk/diku/tiny15four/apps/non_beacon_test/ping ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/non_beacon_test/ping/Makefile =================================================================== --- trunk/diku/tiny15four/apps/non_beacon_test/ping/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/non_beacon_test/ping/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,8 @@ COMPONENT=ping + +# Only set environment when using freescale 802.15.4 +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) ENVIRONMENT=RFDNBNS +endif -include ../../Makerules +include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/non_beacon_test/ping/ping.nc =================================================================== --- trunk/diku/tiny15four/apps/non_beacon_test/ping/ping.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/non_beacon_test/ping/ping.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,11 +25,12 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#define DBG_OFF 1 +//#define PROFILING +#define DBG_OFF 0 configuration ping { @@ -36,41 +38,43 @@ } implementation { - components Main, - pingM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pingM; // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pingM.StdControl; + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pingM.Init; - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pingM.Debug -> ConsoleDebugM.Debug; + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pingM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pingM.Debug -> DebugC.Debug; + pingM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pingM.IeeePanDescriptor -> Ieee802154C; - pingM.IeeePibAttribute -> Ieee802154C; - pingM.IeeeSdu -> Ieee802154C; - pingM.IeeeAddress -> Ieee802154C; + pingM.IeeePanDescriptor -> Tiny15FourC; + pingM.IeeePibAttribute -> Tiny15FourC; + pingM.IeeeSdu -> Tiny15FourC; + pingM.IeeeAddress -> Tiny15FourC; // MCPS - pingM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pingM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pingM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pingM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pingM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pingM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pingM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pingM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pingM.MlmeRequestConfirmAssociate -> Ieee802154C.MlmeRequestConfirmAssociate; - pingM.MlmeRequestConfirmPoll -> Ieee802154C.MlmeRequestConfirmPoll; - pingM.MlmeRequestConfirmScan -> Ieee802154C.MlmeRequestConfirmScan; + pingM.MlmeRequestConfirmAssociate -> Tiny15FourC.MlmeRequestConfirmAssociate; + pingM.MlmeRequestConfirmPoll -> Tiny15FourC.MlmeRequestConfirmPoll; + pingM.MlmeRequestConfirmScan -> Tiny15FourC.MlmeRequestConfirmScan; - pingM.MlmeAssociateRequestConfirm -> Ieee802154C.MlmeAssociateRequestConfirm; - pingM.MlmePollRequestConfirm -> Ieee802154C.MlmePollRequestConfirm; - pingM.MlmeScanRequestConfirm -> Ieee802154C.MlmeScanRequestConfirm; + pingM.MlmeAssociateRequestConfirm -> Tiny15FourC.MlmeAssociateRequestConfirm; + pingM.MlmePollRequestConfirm -> Tiny15FourC.MlmePollRequestConfirm; + pingM.MlmeScanRequestConfirm -> Tiny15FourC.MlmeScanRequestConfirm; } \ No newline at end of file Modified: trunk/diku/tiny15four/apps/non_beacon_test/ping/pingM.nc =================================================================== --- trunk/diku/tiny15four/apps/non_beacon_test/ping/pingM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/non_beacon_test/ping/pingM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,22 +25,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pingM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeePanDescriptor; interface IeeeMacSdu as IeeeSdu; @@ -61,13 +60,13 @@ interface IeeeRequestConfirm<Mlme_PollRequestConfirm> as MlmeRequestConfirmPoll; interface IeeeRequestConfirm<Mlme_ScanRequestConfirm> as MlmeRequestConfirmScan; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - #define PROFILING - //#define DBG_OFF 0 #define DBG_LEVEL 1 #include "Debug.h" @@ -93,12 +92,12 @@ // Forward declarations of helper functions. task void doPing(); task void doPoll(); - task void doScan(); task void associate(); + void doScan(); void processScan(Mlme_ScanRequestConfirm scanconfirm); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -124,21 +123,17 @@ TOSH_CLR_PROFILING9_PIN(); #endif + call CommandInterpreter.addCommand("ping", doScan); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x1D, 0x00, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post doScan(); - return SUCCESS; + call CommandInterpreter.prompt(); } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -335,7 +330,7 @@ } } - task void doScan() + void doScan() { Mlme_ScanRequestConfirm request; Property changes on: trunk/diku/tiny15four/apps/non_beacon_test/pong ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/non_beacon_test/pong/Makefile =================================================================== --- trunk/diku/tiny15four/apps/non_beacon_test/pong/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/non_beacon_test/pong/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,8 @@ COMPONENT=pong + +# Only set environment when using freescale 802.15.4 +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) ENVIRONMENT=FFDNBNS +endif -include ../../Makerules +include $(MAKERULES) \ No newline at end of file Modified: trunk/diku/tiny15four/apps/non_beacon_test/pong/pong.nc =================================================================== --- trunk/diku/tiny15four/apps/non_beacon_test/pong/pong.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/non_beacon_test/pong/pong.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,10 +25,11 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ -#define DBG_OFF 1 +/** + * @author Jan Flora <jan...@di...> + */ + +#define DBG_OFF 0 #define COORDINATOR_SUPPORT configuration pong @@ -36,42 +38,44 @@ } implementation { - components Main, - pongM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pongM; - // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pongM.StdControl; - - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pongM.Debug -> ConsoleDebugM.Debug; + // Wire init. + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pongM.Init; + + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pongM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pongM.Debug -> DebugC.Debug; + pongM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pongM.IeeePibAttribute -> Ieee802154C; - pongM.IeeeSdu -> Ieee802154C; - pongM.IeeeAddress -> Ieee802154C; + pongM.IeeePibAttribute -> Tiny15FourC; + pongM.IeeeSdu -> Tiny15FourC; + pongM.IeeeAddress -> Tiny15FourC; // MCPS - pongM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pongM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pongM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pongM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pongM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pongM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pongM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pongM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pongM.MlmeIndicationResponseAssociate -> Ieee802154C.MlmeIndicationResponseAssociate; - pongM.MlmeRequestConfirmSet -> Ieee802154C.MlmeRequestConfirmSet; - pongM.MlmeRequestConfirmStart -> Ieee802154C.MlmeRequestConfirmStart; - pongM.MlmeIndicationCommStatus -> Ieee802154C.MlmeIndicationCommStatus; + pongM.MlmeIndicationResponseAssociate -> Tiny15FourC.MlmeIndicationResponseAssociate; + pongM.MlmeRequestConfirmSet -> Tiny15FourC.MlmeRequestConfirmSet; + pongM.MlmeRequestConfirmStart -> Tiny15FourC.MlmeRequestConfirmStart; + pongM.MlmeIndicationCommStatus -> Tiny15FourC.MlmeIndicationCommStatus; - pongM.MlmeAssociateIndicationResponse -> Ieee802154C.MlmeAssociateIndicationResponse; - pongM.MlmeSetRequestConfirm -> Ieee802154C.MlmeSetRequestConfirm; - pongM.MlmeStartRequestConfirm -> Ieee802154C.MlmeStartRequestConfirm; - pongM.MlmeCommStatusIndication -> Ieee802154C.MlmeCommStatusIndication; + pongM.MlmeAssociateIndicationResponse -> Tiny15FourC.MlmeAssociateIndicationResponse; + pongM.MlmeSetRequestConfirm -> Tiny15FourC.MlmeSetRequestConfirm; + pongM.MlmeStartRequestConfirm -> Tiny15FourC.MlmeStartRequestConfirm; + pongM.MlmeCommStatusIndication -> Tiny15FourC.MlmeCommStatusIndication; } \ No newline at end of file Modified: trunk/diku/tiny15four/apps/non_beacon_test/pong/pongM.nc =================================================================== --- trunk/diku/tiny15four/apps/non_beacon_test/pong/pongM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/non_beacon_test/pong/pongM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,22 +25,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pongM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeeMacSdu as IeeeSdu; interface IeeeAddress; @@ -62,12 +61,13 @@ interface IeeeRequestConfirm<Mlme_StartRequestConfirm> as MlmeRequestConfirmStart; interface IeeeIndication<Mlme_CommStatusIndication> as MlmeIndicationCommStatus; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - //#define DBG_OFF 0 #define DBG_LEVEL 1 #include "Debug.h" @@ -92,14 +92,14 @@ // Forward declarations of helper functions. task void pingReply(); - task void startPan(); - result_t setAttribute(Ieee_PibAttribute attribute); + void startPan(); + error_t setAttribute(Ieee_PibAttribute attribute); void setShort(uint16_t myShort); void setAssoc(bool allow); void setRxOnWhenIdle(bool status); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -126,21 +126,18 @@ #endif call IeeeAddress.create(&pingReplyAddr); + + call CommandInterpreter.addCommand("start", startPan); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x61, 0x03, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post startPan(); - return SUCCESS; + call CommandInterpreter.prompt(); } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -287,7 +284,7 @@ PAN coordinator role handling *******************************/ - task void startPan() + void startPan() { Mlme_StartRequestConfirm request; @@ -364,7 +361,7 @@ setAttribute(attribute); } - result_t setAttribute(Ieee_PibAttribute attribute) + error_t setAttribute(Ieee_PibAttribute attribute) { Mlme_SetRequestConfirm request; Ieee_Status status; Modified: trunk/diku/tiny15four/apps/p2p_test/ping/Makefile =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/ping/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/p2p_test/ping/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,5 +1,8 @@ COMPONENT=ping + # Only set environment when using freescale 802.15.4 -#ENVIRONMENT=RFDNBNS +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) +ENVIRONMENT=RFDNBNS +endif include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -28,6 +29,7 @@ * @author Jan Flora <jan...@di...> */ +//#define PROFILING #define DBG_OFF 0 configuration ping Modified: trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -62,7 +62,6 @@ } implementation { - //#define PROFILING #define DBG_LEVEL 1 #include "Debug.h" @@ -129,6 +128,7 @@ { uint8_t myAddr[8] = {0x1D, 0x00, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); + call CommandInterpreter.prompt(); } /******************************* Modified: trunk/diku/tiny15four/apps/p2p_test/pong/Makefile =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/pong/Makefile 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/p2p_test/pong/Makefile 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,8 @@ COMPONENT=pong + +# Only set environment when using freescale 802.15.4 +ifneq ($(filter $(MAKECMDGOALS),freescale802154),) ENVIRONMENT=RFDNBNS +endif include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -130,6 +130,7 @@ { uint8_t myAddr[8] = {0x61, 0x03, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); + call CommandInterpreter.prompt(); } /******************************* Modified: trunk/diku/tiny15four/tos/lib/mac/BeaconGeneratorM.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/mac/BeaconGeneratorM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/tos/lib/mac/BeaconGeneratorM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -106,7 +106,7 @@ #ifdef BEACON_SUPPORT - command result_t BeaconGenerator.start() + command error_t BeaconGenerator.start() { if (macPanCoordinator) { firstBeacon = TRUE; @@ -119,7 +119,7 @@ return SUCCESS; } - command result_t BeaconGenerator.stop() + command error_t BeaconGenerator.stop() { return SUCCESS; } @@ -291,17 +291,16 @@ } } - async event result_t BeaconAlarm.alarm() + async event void BeaconAlarm.alarm() { // Time to transmit beacon. coordCapActive = FALSE; generateBeacon(); transmitBeacon(); - return SUCCESS; } #ifdef GTS_SUPPORT - async event result_t CfpAlarm.alarm() + async event void CfpAlarm.alarm() { if (waitingForCapEnd) { // CAP has ended. @@ -326,7 +325,6 @@ // Idle period. waitingForCfpEnd = FALSE; } - return SUCCESS; } #endif #endif Modified: trunk/diku/tiny15four/tos/lib/mac/BeaconTrackerM.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/mac/BeaconTrackerM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/tos/lib/mac/BeaconTrackerM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -79,8 +79,6 @@ task void poll(); task void missedBeacon(); task void syncLoss(); - task void processBeaconPayload(); - task void processGtsSpecs(); task void processPendingAddrs(); #ifdef GTS_SUPPORT task void processGtsSpecs(); @@ -118,7 +116,7 @@ } } - command result_t MlmeRequestSync.request( Mlme_SyncRequest request ) + command error_t MlmeRequestSync.request( Mlme_SyncRequest request ) { // TODO: Make a queue so that we can have more than one sync request at // a time. @@ -283,7 +281,7 @@ } #ifdef GTS_SUPPORT - async event result_t CfpAlarm.alarm() + async event void CfpAlarm.alarm() { if (waitingForCapEnd) { // CAP has ended. @@ -310,11 +308,10 @@ // Idle period. waitingForCfpEnd = FALSE; } - return SUCCESS; } #endif - async event result_t TrackAlarm.alarm() + async event void TrackAlarm.alarm() { bool wasListening; DBG_STR("TrackAlarm",2); @@ -345,7 +342,6 @@ disableBeaconMode(); } } - return SUCCESS; } async event void PanConflict.conflictDetected() Modified: trunk/diku/tiny15four/tos/lib/mac/CfpControlM.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/mac/CfpControlM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/tos/lib/mac/CfpControlM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -328,7 +328,7 @@ tendDataSlots(slot+1); } - command result_t MlmeRequestConfirmGts.request(Mlme_GtsRequestConfirm request) + command error_t MlmeRequestConfirmGts.request(Mlme_GtsRequestConfirm request) { // We just transmit the gts request. txHeader_t *myTxHeader; @@ -728,18 +728,16 @@ call CallbackService.enqueue((uint8_t*)myGtsIndication, indicateGts); } - async event result_t RxOffAlarm.alarm() + async event void RxOffAlarm.alarm() { // Turn off the receiver. call FrameRx.trxOff(TRUE); - return SUCCESS; } - async event result_t CfpAlarm.alarm() + async event void CfpAlarm.alarm() { cfpTimerArmed = FALSE; tendDataSlots(nextActiveSlot); - return SUCCESS; } // Gts indication callback. Modified: trunk/diku/tiny15four/tos/lib/mac/StartM.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/mac/StartM.nc 2009-03-08 20:20:28 UTC (rev 1055) +++ trunk/diku/tiny15four/tos/lib/mac/StartM.nc 2009-03-09 09:20:38 UTC (rev 1056) @@ -1,4 +1,5 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> +/** + * Copyright (c) 2006, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,9 +25,9 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ module StartM { @@ -54,7 +55,7 @@ void confirmStart(uint8_t *primitive); - command result_t MlmeRequestConfirmStart.request(Mlme_StartRequestConfirm request) + command error_t MlmeRequestConfirmStart.request(Mlme_StartRequestConfirm request) { mlmeStartRequestMsg_t *req = &(request->msg.request); mlmeStartConfirmMsg_t *conf = &(request->msg.confirm); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qz...@us...> - 2009-03-08 20:20:48
|
Revision: 1055 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1055&view=rev Author: qzban Date: 2009-03-08 20:20:28 +0000 (Sun, 08 Mar 2009) Log Message: ----------- Restructured some code in the Tiny15Four tree. The timerTest application is now working properly. Modified Paths: -------------- trunk/diku/tiny15four/apps/timerTest/TimerTestC.nc trunk/diku/tiny15four/apps/timerTest/TimerTestP.nc trunk/diku/tiny15four/tos/chips/cc2430/HPLTimerP.nc trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourTimerC.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/HplSpiP.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourTimerC.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc trunk/diku/tiny15four/tos/lib/Tiny15FourC.nc trunk/diku/tiny15four/tos/lib/debug/BufferedUartP.nc trunk/diku/tiny15four/tos/lib/debug/CommandInterpreterP.nc trunk/diku/tiny15four/tos/lib/debug/DebugConsoleC.nc trunk/diku/tiny15four/tos/lib/mac/CsmaM.nc Added Paths: ----------- trunk/diku/tiny15four/tos/chips/mc13192/mc13192RadioInitM.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/UartControlP.nc trunk/diku/tiny15four/tos/lib/tools/NoPlatformInitP.nc trunk/diku/tiny15four/tos/platforms/dig528/ClockSetupP.nc trunk/diku/tiny15four/tos/platforms/dig528/PlatformInitC.nc trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192InterruptRegisters.h trunk/diku/tiny15four/tos/platforms/nano/PlatformInitC.nc trunk/diku/tiny15four/tos/platforms/skel/PlatformInitC.nc Removed Paths: ------------- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc trunk/diku/tiny15four/tos/lib/debug/CommandInterpreterC.nc trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h Property Changed: ---------------- trunk/diku/tiny15four/apps/timerTest/ Property changes on: trunk/diku/tiny15four/apps/timerTest ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/timerTest/TimerTestC.nc =================================================================== --- trunk/diku/tiny15four/apps/timerTest/TimerTestC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/apps/timerTest/TimerTestC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -34,32 +34,20 @@ implementation { components MainC, - //Tiny15FourTimerC, AsyncAlarmC, - Tiny15FourPhyC, - MacTimerP, + PlatformInitC, DebugC, - //HPLTimerP, TimerTestP; + MainC.SoftwareInit -> PlatformInitC.Init; + MainC.SoftwareInit -> AsyncAlarmC.Init; + MainC.SoftwareInit -> TimerTestP.Init; TimerTestP.Boot -> MainC.Boot; + + TimerTestP.CommandInterpreter -> DebugC.CommandInterpreter; TimerTestP.Debug -> DebugC.Debug; AsyncAlarmC.Debug -> DebugC.Debug; - - //TimerTestP.Counter -> Tiny15FourTimerC.SymbolCounter; - //TimerTestP.Channel -> Tiny15FourTimerC.SymbolChannel; + TimerTestP.LocalTime -> AsyncAlarmC.LocalTime; TimerTestP.TestAlarm -> AsyncAlarmC.Alarm[unique("AsyncAlarm")]; - - TimerTestP.RadioMicroTime -> MacTimerP.MacCounter; - TimerTestP.RadioSymbolTime -> MacTimerP.OverflowCounter; - TimerTestP.PhyEnergyDetect -> Tiny15FourPhyC.PhyEnergyDetect; - //MainC.SoftwareInit -> Tiny15FourTimerC.Init; - MainC.SoftwareInit -> AsyncAlarmC.Init; - MainC.SoftwareInit -> Tiny15FourPhyC.Init; - MainC.SoftwareInit -> MacTimerP.Init; - //TimerTestP.Counter -> HPLTimerP.Counter; - //TimerTestP.Channel -> HPLTimerP.Channel; - //MainC.SoftwareInit -> HPLTimerP.Init; - //HPLTimerP.Debug ->DebugC.Debug; } \ No newline at end of file Modified: trunk/diku/tiny15four/apps/timerTest/TimerTestP.nc =================================================================== --- trunk/diku/tiny15four/apps/timerTest/TimerTestP.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/apps/timerTest/TimerTestP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -25,6 +25,14 @@ */ /** + * This is a small application that tests, that the timers on + * your platform is setup to provide symbol period time. + * For testing the timer configuration, you will need a stop watch. + * Issue the command "start" in the debug console. If the timers + * are configured correctly, the program will output the word + * "stop" exactly 2 minutes after it was started. In the mean time + * a "tick" will be issued every 10 seconds. + * * @author Jan Flora <jan...@di...> */ @@ -37,16 +45,12 @@ uses { interface Boot; - interface Debug; - //interface SymbolChannel<uint32_t> as Channel; - //interface SymbolCounter<uint32_t> as Counter; + interface LocalTime<time_t> as LocalTime; interface AsyncAlarm<time_t> as TestAlarm; - interface SymbolCounter<uint16_t> as RadioMicroTime; - interface SymbolCounter<uint32_t> as RadioSymbolTime; - interface PhyEnergyDetect; - //interface SymbolChannel<uint16_t> as Channel; - //interface SymbolCounter<uint16_t> as Counter; + + interface CommandInterpreter; + interface Debug; } } implementation @@ -54,120 +58,51 @@ #define DBG_LEVEL 1 #include "Debug.h" - uint32_t backoffCount = 0; - // Forward declaration. - task void doOutput(); - //task void wrapTask(); - //task void doTimerProgram(); + void startTimer(); + void showTime(); + time_t startTime; + time_t targetTime; + time_t interval = 0x98968; + uint8_t iteration = 1; + command error_t Init.init() { + call CommandInterpreter.addCommand("start", startTimer); + call CommandInterpreter.addCommand("time", showTime); return SUCCESS; } event void Boot.booted() { - uint32_t i = 0; - uint32_t now; - - while (i<100000) i++; - // Synchronize the two timers - call RadioSymbolTime.setTime(call LocalTime.getTime() + 1); - - DBG_STR("Program started!", 1); - i = 0; - while (i<100000) i++; - now = call LocalTime.getTime(); - call TestAlarm.armAlarmClock(now+0xA3880); - //call Channel.arm(0, now+0xA3880); - //call Channel.arm(1, now+0x9C400); - //call Channel.arm(2, now+0x84700); - //call Channel.arm(3, now+0xAA09A); + DBG_STR("TimerTest Booted...",1); } - async event void TestAlarm.alarm() + void startTimer() { - uint32_t now = call LocalTime.getTime(); - uint32_t macNow = call RadioSymbolTime.getTime(); - - call TestAlarm.armAlarmClock(now+0xA3880); - - DBG_STRINT("15.4 timer: ",now, 1); - DBG_STRINT("Mac timer: ",macNow,1); - call PhyEnergyDetect.ed(); + startTime = call LocalTime.getTime(); + targetTime = startTime+0x7270E0; + call TestAlarm.armAlarmClock(startTime+interval); } -/* async event void Channel.fired(uint8_t id) + void showTime() { - uint32_t now = call Counter.getTime(); - uint32_t macNow = call RadioSymbolTime.getTime(); - - if (id == 0) { - call Channel.arm(0, now+0xA3880); - DBG_STRINT("15.4 timer: ",now, 1); - DBG_STRINT("Mac timer: ",macNow,1); - call PhyEnergyDetect.ed(); - } else if (id == 1) { - call Channel.arm(1, now+0x9C400); - } else if (id == 2) { - call Channel.arm(2, now+0x84700); - call Channel.arm(3, now+0xAA09A); - } else if (id == 3) { - } - - //post doTimerProgram(); - }*/ + time_t now = call LocalTime.getTime(); + DBG_STRINT("Local time is now: ",now,1); + call CommandInterpreter.prompt(); + } -/* task void doTimerProgram() + async event void TestAlarm.alarm() { - uint32_t now = call Counter.getTime(); - call Channel.arm(0, now+0x00010000); - DBG_STR("Timer fired: ", 1); - DBG_STRINT("At time: ",now,1); - }*/ - -/* async event void Counter.wrap() - { - post wrapTask(); - }*/ - -/* task void wrapTask() - { - DBG_STR("Counter wrapped!",1); - }*/ - - task void doOutput() - { - // Wait.. - uint32_t i = 0; - uint16_t j = 0; - while (i < 200000) { - while (j < 65500) j++; - i++; + time_t now = call LocalTime.getTime(); + iteration++; + if (call LocalTime.compare(TIME_GTE, now, targetTime)) { + DBG_STR("Stop",1); + call CommandInterpreter.prompt(); + } else { + DBG_STR("Tick",1); + call TestAlarm.armAlarmClock(startTime+(iteration*interval)); } - DBG_STR("In doOutput...", 1); - post doOutput(); } - - async event void RadioMicroTime.wrap() - { - /*atomic { - backoffCount++; - if (backoffCount == 0x2DC6C) { - backoffCount = 0; - DBG_STR("MacCounter: 1 minute passed...",1); - } - }*/ - } - - async event void RadioSymbolTime.wrap() - { - - } - - async event void PhyEnergyDetect.edDone(phy_error_t error, uint8_t energy) - { - DBG_STRINT("Detected energy was: ",energy,1); - } } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/cc2430/HPLTimerP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/HPLTimerP.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/cc2430/HPLTimerP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -72,6 +72,11 @@ T1CCTL1 |= (1 << CC2430_T1CCTLx_MODE); T1CCTL2 |= (1 << CC2430_T1CCTLx_MODE); + // Disable channel interrupts. + T1CCTL0 &= ~_BV(CC2430_T1CCTLx_IM); + T1CCTL1 &= ~_BV(CC2430_T1CCTLx_IM); + T1CCTL2 &= ~_BV(CC2430_T1CCTLx_IM); + // Enable Timer1 interrupts T1IE = 1; // Enable overflow interrupts. Modified: trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourTimerC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourTimerC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourTimerC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -44,8 +44,7 @@ components HPLTimerP, new VirtualSymbolChannelM(16,3,uint16_t,10,time_t) as VirtualSymbolChannel, new VirtualSymbolCounterM(16,uint16_t,time_t) as VirtualSymbolCounter, - DebugC, - MainC; + DebugC; Init = VirtualSymbolChannel.Init; Init = VirtualSymbolCounter.Init; Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -251,4 +251,9 @@ RFD = 0; //DBG_STR("Done transfering frame to tx buffer.",1); } + + default async event void PhyTransmit.txDone(phy_error_t error, uint8_t txId) + { + DBG_STR("PhyTransmit.txDone not connected!",1); + } } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -29,7 +29,7 @@ * @author Jan Flora <jan...@di...> */ -#include "mc13192Registers.h" +#include "mc13192InterruptRegisters.h" #include "mc13192Pins.h" #include "mc13192Const.h" #include <time.h> @@ -55,14 +55,13 @@ implementation { components mc13192PhyDriverM, - mc13192PhyInitM, mc13192PhyInterruptM, mc13192PhyTimerM, // Provided by the MCU implementation. mc13192SpiC; - Init = mc13192PhyInitM.Init; Init = mc13192PhyTimerM.Init; + Init = mc13192PhyDriverM.Init; PhyReceive = mc13192PhyDriverM.PhyReceive; PhyTransmit = mc13192PhyDriverM.PhyTransmit; @@ -71,17 +70,12 @@ PhyControl = mc13192PhyDriverM.PhyControl; PhyReset = mc13192PhyDriverM.PhyReset; - PhyReset = mc13192PhyInitM.PhyReset; mc13192PhyDriverM.Interrupt -> mc13192PhyInterruptM.Interrupt; mc13192PhyDriverM.Timer -> mc13192PhyTimerM.Timer; - mc13192PhyInitM.RadioTime -> mc13192PhyTimerM.Timer; - mc13192PhyInitM.MCUTime = LocalTime; mc13192PhyDriverM.MCUTime = LocalTime; // Wire up the SPI. - mc13192PhyInitM.SpiControl -> mc13192SpiC.SpiControl; - mc13192PhyInitM.SPI -> mc13192SpiC.Spi; mc13192PhyDriverM.SPI -> mc13192SpiC.Spi; mc13192PhyInterruptM.SPI -> mc13192SpiC.Spi; mc13192PhyTimerM.SPI -> mc13192SpiC.Spi; Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h 2009-03-08 20:20:28 UTC (rev 1055) @@ -191,11 +191,6 @@ #define TIMER2 1 #define TIMER3 2 #define TIMER4 3 - - // This is where the MAC address is stored in flash. - #define MAC_ADDR_LOCATION 0xFDB6 - // The MAC address - uint8_t *radioMACAddr; /* #define RX_QUEUE_SIZE 3 #define RX_BUFFER_QUEUE_SIZE 3 Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -37,6 +37,7 @@ { provides { + interface Init; interface PhyReceive; interface PhyTransmit; interface PhyEnergyDetect; @@ -142,8 +143,18 @@ inline void writeTXPacketLength(uint8_t length); + command error_t Init.init() + { + // Synchronize radio and MCU time. + call Timer.resetEventTime(); + call MCUTime.reset(); + return SUCCESS; + } + command void PhyReset.reset() { + call Init.init(); + ccaMode = TX_CCA_MODE1; backoffAligned = FALSE; } @@ -255,6 +266,12 @@ } } + default async event uint8_t *PhyReceive.dataReady(rxdata_t *data) + { + DBG_STR("PhyReceive.dataReady is not connected!",1); + return data->frame; + } + async command phy_error_t PhyReceive.rxOn(uint32_t commenceTime, bool immediateCommence) { if (immediateCommence) { @@ -291,6 +308,11 @@ return PHY_TRX_BUSY; } + default async event void PhyTransmit.txDone(phy_error_t error, uint8_t myTxId) + { + DBG_STR("PhyTransmit.txDone not connected",1); + } + async command phy_error_t PhyTransmit.tx(txdata_t *data) { bool ack = (data->frame[0] & 0x20); Deleted: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -1,191 +0,0 @@ -/** - * Copyright (c) 2006, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/** - * @author Jan Flora <jan...@di...> - */ -#include <time.h> -#include "macConstants.h" -#include "endianconv.h" - -module mc13192PhyInitM -{ - provides - { - interface Init; - interface PhyReset; - } - uses - { - interface LocalTime<time_t> as MCUTime; - interface mc13192PhyTimer as RadioTime; - interface FastSPI as SPI; - interface StdControl as SpiControl; - interface Debug; - } -} -implementation -{ - // Methods for fast register access. - #include "mc13192RegisterAccess.h" - - #define DBG_LEVEL 1 - #include "Debug.h" - - void initialize() - { - // Enable interrupts. - ENABLE_IRQ; - - // Time to setup the radio registers. - // Please refer to document MC13192RM for hidden register initialization - // Register 0x11 is hidden. bit 8-9 should be initialized to 00. - writeRegister(0x11,0xA0FF); - - writeRegister(GPIO_DIR, 0x3F80); - writeRegister(CCA_THRESH,0x9674); // WAS: 0xA08D - // Register 0x08 is hidden. bit 1 and 4 should be initialized to 1. - // Preferred injection - writeRegister(0x08,0xFFF7); - - // ATTN masks, LO1 - writeRegister(IRQ_MASK,0x8240); - - // Register 0x06 has some hidden bits. bit 14 should be initialized to 1. - writeRegister(CONTROL_A,0x4010); - - // Secret register settings snatched from Freescale implementation - writeRegister(0x13, 0x1843); - writeRegister(0x31, 0xA000); - writeRegister(0x38, 0x0008); - - // These should fix excess power consumption during hibernate and doze. - writeRegister(CONTROL_B, 0x7D00); // Was: 0x7D1C (xx00) - - // Timer prescale = 5 - // Enable alt_GPIO - // Enable clock output. - writeRegister(CONTROL_C, 0xF3FD); // Was: 0xF3FA (xxxD) - - // Use Freescale xtal trim value. - // clock rate = 5 (62.5 KHz) - writeRegister(CLKO_CTL, 0x3645); - - // Sets the reset indicator bit - readRegister(RST_IND); - // Read the status register to clear any undesired IRQs. - readRegister(IRQ_STATUS); - //call State.setRXTXStateMirror(IDLE_MODE); - } - - command void PhyReset.reset() - { - // Synchronize radio and MCU time. - call RadioTime.resetEventTime(); - call MCUTime.reset(); - } - - command error_t Init.init() __attribute__((noinline)) - { - uint16_t irq_reg, attn_irq = FALSE; - - // Set the pin directions. - TOSH_PULLUP_RADIO_RESET_DISABLE(); - TOSH_MAKE_RADIO_CE_OUTPUT(); - TOSH_MAKE_RADIO_ATTN_OUTPUT(); - TOSH_MAKE_RADIO_RXTXEN_OUTPUT(); - TOSH_MAKE_RADIO_RESET_OUTPUT(); - TOSH_MAKE_RADIO_OOI_INPUT(); - TOSH_PULLUP_RADIO_OOI_ENABLE(); - TOSH_MAKE_RADIO_CRC_INPUT(); - TOSH_PULLUP_RADIO_CRC_ENABLE(); - TOSH_MAKE_RADIO_ANT_CTRL_OUTPUT(); - TOSH_MAKE_RADIO_LNA_CTRL_OUTPUT(); - - // Start up the SPI. - call SpiControl.start(); - - // Initialize GPIO pins. - TOSH_SET_RADIO_CE_PIN(); - TOSH_SET_RADIO_ATTN_PIN(); - TOSH_CLR_RADIO_RXTXEN_PIN(); - TOSH_CLR_RADIO_RESET_PIN(); - TOSH_CLR_RADIO_ANT_CTRL_PIN(); - TOSH_CLR_RADIO_LNA_CTRL_PIN(); - - return SUCCESS; -/* } - - command result_t StdControl.start() __attribute__((noinline)) - {*/ - - - // We then power up the radio and wait for it to init. - ACK_IRQ; - SETUP_IRQ_PIN; - // Detect IRQ on both level and edge to prevent fast double IRQ bug. - IRQ_LEVEL_EDGE; - - // Take MC13192 out of reset - TOSH_SET_RADIO_RESET_PIN(); - - while (attn_irq == FALSE) { - // Check to see if IRQ is asserted - if (IRQ_FLAG_SET) { - // Clear MC13192 interrupts and check for ATTN IRQ from 13192. - irq_reg = readRegister(IRQ_STATUS); - irq_reg &= 0x400; - if (irq_reg != 0) attn_irq = TRUE; - // ACK the pending interrupt. - ACK_IRQ; - } - } - - initialize(); - - // Use external clock. - extClock = 62500; - enterFEEMode(0,8,1); // FLL engaged, 32 MHz MCUclk / 16 MHz BUSclk. - - // Set MAC address - // TODO: This should be done in a nicer way! - radioMACAddr = (uint8_t*)MAC_ADDR_LOCATION; - NTOUH64(radioMACAddr, aExtendedAddress); - - // Synchronize radio and MCU time. - call RadioTime.resetEventTime(); - call MCUTime.reset(); - return SUCCESS; - } - -/* command result_t StdControl.stop() - { - //ASSERT_RESET; // Power off the radio. - TOSH_CLR_RADIO_RESET_PIN(); - return SUCCESS; - }*/ -} Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -60,16 +60,6 @@ return SUCCESS; } -/* command result_t StdControl.stop() - { - // Stop all timers. - call Timer.stopAckTimer(); - call Timer.stopEventTimer(); - call Timer.stopDeferTimer1(); - call Timer.stopDeferTimer2(); - return SUCCESS; - }*/ - /******************************/ /* Event triggering functions */ /******************************/ Copied: trunk/diku/tiny15four/tos/chips/mc13192/mc13192RadioInitM.nc (from rev 1054, trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc) =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192RadioInitM.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192RadioInitM.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,153 @@ +/** + * Copyright (c) 2006, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#include "mc13192Pins.h" +#include "mc13192InterruptRegisters.h" +#include "mc13192Const.h" + +module mc13192RadioInitM +{ + provides + { + interface Init; + } + uses + { + interface FastSPI as SPI; + } +} +implementation +{ + // Methods for fast register access. + #include "mc13192RegisterAccess.h" + + void initialize() + { + // Enable interrupts. + ENABLE_IRQ; + + // Time to setup the radio registers. + // Please refer to document MC13192RM for hidden register initialization + // Register 0x11 is hidden. bit 8-9 should be initialized to 00. + writeRegister(0x11,0xA0FF); + + writeRegister(GPIO_DIR, 0x3F80); + writeRegister(CCA_THRESH,0x9674); // WAS: 0xA08D + // Register 0x08 is hidden. bit 1 and 4 should be initialized to 1. + // Preferred injection + writeRegister(0x08,0xFFF7); + + // ATTN masks, LO1 + writeRegister(IRQ_MASK,0x8240); + + // Register 0x06 has some hidden bits. bit 14 should be initialized to 1. + writeRegister(CONTROL_A,0x4010); + + // Secret register settings snatched from Freescale implementation + writeRegister(0x13, 0x1843); + writeRegister(0x31, 0xA000); + writeRegister(0x38, 0x0008); + + // These should fix excess power consumption during hibernate and doze. + writeRegister(CONTROL_B, 0x7D00); // Was: 0x7D1C (xx00) + + // Timer prescale = 5 + // Enable alt_GPIO + // Enable clock output. + writeRegister(CONTROL_C, 0xF3FD); // Was: 0xF3FA (xxxD) + + // Use Freescale xtal trim value. + // Set the radio clock rate = 5 (62.5 KHz) + // This provides a symbol time counter to the radio event timers. + writeRegister(CLKO_CTL, 0x3645); + + // Sets the reset indicator bit + readRegister(RST_IND); + // Read the status register to clear any undesired IRQs. + readRegister(IRQ_STATUS); + //call State.setRXTXStateMirror(IDLE_MODE); + } + + void bootup() + { + uint16_t irq_reg, attn_irq = FALSE; + + // We then power up the radio and wait for it to init. + ACK_IRQ; + SETUP_IRQ_PIN; + // Detect IRQ on both level and edge to prevent fast double IRQ bug. + IRQ_LEVEL_EDGE; + + // Take MC13192 out of reset + TOSH_SET_RADIO_RESET_PIN(); + + while (attn_irq == FALSE) { + // Check to see if IRQ is asserted + if (IRQ_FLAG_SET) { + // Clear MC13192 interrupts and check for ATTN IRQ from 13192. + irq_reg = readRegister(IRQ_STATUS); + irq_reg &= 0x400; + if (irq_reg != 0) attn_irq = TRUE; + // ACK the pending interrupt. + ACK_IRQ; + } + } + } + + command error_t Init.init() __attribute__((noinline)) + { + // Set the pin directions. + TOSH_PULLUP_RADIO_RESET_DISABLE(); + TOSH_MAKE_RADIO_CE_OUTPUT(); + TOSH_MAKE_RADIO_ATTN_OUTPUT(); + TOSH_MAKE_RADIO_RXTXEN_OUTPUT(); + TOSH_MAKE_RADIO_RESET_OUTPUT(); + TOSH_MAKE_RADIO_OOI_INPUT(); + TOSH_PULLUP_RADIO_OOI_ENABLE(); + TOSH_MAKE_RADIO_CRC_INPUT(); + TOSH_PULLUP_RADIO_CRC_ENABLE(); + TOSH_MAKE_RADIO_ANT_CTRL_OUTPUT(); + TOSH_MAKE_RADIO_LNA_CTRL_OUTPUT(); + + // Initialize GPIO pins. + TOSH_SET_RADIO_CE_PIN(); + TOSH_SET_RADIO_ATTN_PIN(); + TOSH_CLR_RADIO_RXTXEN_PIN(); + TOSH_CLR_RADIO_RESET_PIN(); + TOSH_CLR_RADIO_ANT_CTRL_PIN(); + TOSH_CLR_RADIO_LNA_CTRL_PIN(); + + bootup(); + initialize(); + + return SUCCESS; + } +} Property changes on: trunk/diku/tiny15four/tos/chips/mc13192/mc13192RadioInitM.nc ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -1,4 +1,5 @@ -/* Copyright (c) 2009, Jan Flora <jan...@di...> +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -40,9 +41,9 @@ implementation { components DebugConsoleC, - Hcs08Serial0ByteCommC; - - DebugConsoleC.SerialByteComm -> Hcs08Serial0ByteCommC.SerialByteComm; + Hcs08Serial1ByteCommC; + + DebugConsoleC.SerialByteComm -> Hcs08Serial1ByteCommC.SerialByteComm; Debug = DebugConsoleC.Debug; CommandInterpreter = DebugConsoleC.CommandInterpreter; } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -40,8 +40,8 @@ provides { interface Init; - interface SymbolCounter<uint16_t> as Counter; - interface SymbolChannel<uint16_t> as Channel; + interface SymbolCounter<uint32_t> as Counter; + interface SymbolChannel<uint32_t> as Channel; } uses { @@ -56,6 +56,7 @@ command error_t Init.init() { // Initialize timer ports in output compare mode with software compare only. + // Channel interrupts are disabled as well. TPM2C0SC = 0x10; TPM2C1SC = 0x10; TPM2C2SC = 0x10; @@ -63,9 +64,10 @@ TPM2C4SC = 0x10; // Enable overflow interrupts. - TPM2SC_TOIE = 1; + //TPM2SC_TOIE = 1; // Using XCLK. - TPM2SC |= 0x10; + //TPM2SC |= 0x10; + TPM2SC = 0x50; return SUCCESS; } @@ -73,14 +75,15 @@ /*************************************** * HCS08 SymbolCounter implementation. **************************************/ - async command uint16_t Counter.getTime() + async command uint32_t Counter.getTime() { - return TPM2CNT; + // Shift to make symbol time. + return TPM2CNT<<1; } - async command void Counter.setTime(uint16_t timestamp) + async command void Counter.setTime(uint32_t timestamp) { - // Not implemented. + TPM2CNT = timestamp>>1; } async command void Counter.reset() @@ -92,31 +95,31 @@ /*************************************** * HCS08 SymbolChannel implementation. **************************************/ - async command error_t Channel.arm(uint8_t id, uint16_t timeStamp) + async command error_t Channel.arm(uint8_t id, uint32_t timeStamp) { if (id == 0) { TPM2C0SC &= 0x7F; - TPM2C0V = timeStamp; + TPM2C0V = timeStamp>>1; TPM2C0SC_CH0IE = 1; return SUCCESS; } else if (id == 1) { TPM2C1SC &= 0x7F; - TPM2C1V = timeStamp; + TPM2C1V = timeStamp>>1; TPM2C1SC_CH1IE = 1; return SUCCESS; } else if (id == 2) { TPM2C2SC &= 0x7F; - TPM2C2V = timeStamp; + TPM2C2V = timeStamp>>1; TPM2C2SC_CH2IE = 1; return SUCCESS; } else if (id == 3) { TPM2C3SC &= 0x7F; - TPM2C3V = timeStamp; + TPM2C3V = timeStamp>>1; TPM2C3SC_CH3IE = 1; return SUCCESS; } else if (id == 4) { TPM2C4SC &= 0x7F; - TPM2C4V = timeStamp; + TPM2C4V = timeStamp>>1; TPM2C4SC_CH4IE = 1; return SUCCESS; } Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/HplSpiP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/HplSpiP.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/HplSpiP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -3,6 +3,7 @@ { provides { + interface Init; interface StdControl; interface FastSPI as SPI; } @@ -12,6 +13,13 @@ void wait(); + command error_t Init.init() + { + // Here we just boot up the SPI driver. + call StdControl.start(); + return SUCCESS; + } + command error_t StdControl.start() { PTED = 0x04; Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourTimerC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourTimerC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourTimerC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -42,10 +42,9 @@ implementation { components HPLTimerP, - new VirtualSymbolChannelM(15,5,uint16_t,10,time_t) as VirtualSymbolChannel, - new VirtualSymbolCounterM(15,uint16_t,time_t) as VirtualSymbolCounter, - DebugC, - MainC; + new VirtualSymbolChannelM(17,5,uint32_t,10,time_t) as VirtualSymbolChannel, + new VirtualSymbolCounterM(17,uint32_t,time_t) as VirtualSymbolCounter, + DebugC; SymbolChannel = VirtualSymbolChannel.nChannel; SymbolCounter = VirtualSymbolCounter.nCounter; @@ -62,5 +61,4 @@ Init = VirtualSymbolChannel.Init; Init = VirtualSymbolCounter.Init; - Init = HPLTimerP.Init; } \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/mc9s08gb60/UartControlP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/UartControlP.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/UartControlP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Wrapper for starting the Uart on initialization. + * @author Jan Flora <jan...@di...> + */ + +module UartControlP +{ + provides + { + interface Init; + } + uses + { + interface StdControl; + } +} +implementation +{ + command error_t Init.init() + { + return call StdControl.start(); + } +} \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -35,7 +35,6 @@ provides { interface FastSPI as Spi; - interface StdControl as SpiControl; } } implementation @@ -43,5 +42,4 @@ components HplSpiP as mcuSPI; Spi = mcuSPI.SPI; - SpiControl = mcuSPI.StdControl; } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/lib/Tiny15FourC.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/Tiny15FourC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/lib/Tiny15FourC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -119,7 +119,8 @@ implementation { - components Tiny15FourPhyC, + components PlatformInitC, + Tiny15FourPhyC, Tiny15FourRandomC, Tiny15FourMacC, AsyncAlarmC, @@ -127,10 +128,12 @@ new FIFOQueueM(uint8_t*) as MyQueue; // Wire standard control + Init = PlatformInitC.Init; Init = AsyncAlarmC.Init; Init = Tiny15FourPhyC.Init; Init = Tiny15FourMacC.Init; Init = SimpleBufferManM.Init; + PlatformInitC.Boot = Boot; Tiny15FourMacC.Boot = Boot; // Connect debug. Modified: trunk/diku/tiny15four/tos/lib/debug/BufferedUartP.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/debug/BufferedUartP.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/lib/debug/BufferedUartP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -1,4 +1,5 @@ -/* Copyright (c) 2008, Jan Flora <jan...@di...> +/** + * Copyright (c) 2008, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -114,9 +115,7 @@ moveDataToUart(); } } - - - + async event void Uart.get( uint8_t data ) { signal BufferedUart.get(data); Modified: trunk/diku/tiny15four/tos/lib/debug/CommandInterpreterP.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/debug/CommandInterpreterP.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/lib/debug/CommandInterpreterP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -28,7 +28,6 @@ * @author Jan Flora <jan...@di...> */ -#define MAX_ #define MAX_INTERPRETED_COMMANDS 10 module CommandInterpreterP Modified: trunk/diku/tiny15four/tos/lib/debug/DebugConsoleC.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/debug/DebugConsoleC.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/lib/debug/DebugConsoleC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -29,7 +29,7 @@ * @author Jan Flora <jan...@di...> */ -typedef uint8_t* queueBuffer_t; +//typedef uint8_t* queueBuffer_t; configuration DebugConsoleC { Modified: trunk/diku/tiny15four/tos/lib/mac/CsmaM.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/mac/CsmaM.nc 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/lib/mac/CsmaM.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -123,6 +123,7 @@ if (backoffDuration > 0) { // Calculate commence time. myTxData.commenceTime = call LocalTime.getTime()+backoffDuration; + //DBG_STRINT("CommenceTime: ",myTxData.commenceTime,1); } else { // commence ASAP myTxData.immediateCommence = TRUE; @@ -145,7 +146,8 @@ backoff = (call Random.rand() % (backoff+1)); } // TODO: We need to be able to handle backoff periods < 3 slots. - backoff = (backoff < 3)?3 : backoff; + //backoff = (backoff < 3)?3 : backoff; + backoff = (backoff < 10)?10 : backoff; return backoff; } Added: trunk/diku/tiny15four/tos/lib/tools/NoPlatformInitP.nc =================================================================== --- trunk/diku/tiny15four/tos/lib/tools/NoPlatformInitP.nc (rev 0) +++ trunk/diku/tiny15four/tos/lib/tools/NoPlatformInitP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Dummy platform initialization module. + * + * @author Jan Flora <jan...@di...> + */ + +module NoPlatformInitP +{ + provides + { + interface Init; + } + uses + { + interface Boot; + } +} +implementation +{ + command error_t Init.init() + { + // Do nothing. + return SUCCESS; + } + + event void Boot.booted() + { + // Do nothing. + } +} \ No newline at end of file Added: trunk/diku/tiny15four/tos/platforms/dig528/ClockSetupP.nc =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/ClockSetupP.nc (rev 0) +++ trunk/diku/tiny15four/tos/platforms/dig528/ClockSetupP.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Initialize the platform. Here we make sure that the clock + * is set up as desired. + * + * @author Jan Flora <jan...@di...> + */ + +//#include "endianconv.h" +//#include "macConstants.h" + +module ClockSetupP +{ + provides + { + interface Init; + } + uses + { + interface Boot; + } +} +implementation +{ + // This is where the MAC address is stored in flash. + //#define MAC_ADDR_LOCATION 0xFDB6 + // The MAC address + //uint8_t *radioMACAddr; + + command error_t Init.init() + { + // Setup the MCU clock to use the high precision external + // clock signal provided by the MC13192 radio chip. + extClock = 62500; + // FLL engaged, 32 MHz MCUclk / 16 MHz BUSclk. + enterFEEMode(FALSE,8,1); + + // Set MAC address + // TODO: This should be done in a nicer way! + //radioMACAddr = (uint8_t*)MAC_ADDR_LOCATION; + //NTOUH64(radioMACAddr, aExtendedAddress); + } + + event void Boot.booted() + { + } +} \ No newline at end of file Added: trunk/diku/tiny15four/tos/platforms/dig528/PlatformInitC.nc =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/PlatformInitC.nc (rev 0) +++ trunk/diku/tiny15four/tos/platforms/dig528/PlatformInitC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Handle the initialization order of the hardware modules. This is highly + * platform dependent. + * + * @author Jan Flora <jan...@di...> + */ + +configuration PlatformInitC +{ + provides + { + interface Init; + } + uses + { + interface Boot; + } +} +implementation +{ + components ClockSetupP, + HPLTimerP, + HplSpiP, + mc13192RadioInitM, + Hcs08Serial1ByteCommC, + UartControlP; + + Init = HplSpiP.Init; + Init = mc13192RadioInitM.Init; + Init = ClockSetupP.Init; + // All modules depending on the MCU clock can now be initialized. + Init = UartControlP.Init; + Init = HPLTimerP.Init; + + ClockSetupP.Boot = Boot; + + // The radio uses the SPI for initialization. + mc13192RadioInitM.SPI -> HplSpiP.SPI; + + // Start the Uart module on init. + UartControlP.StdControl -> Hcs08Serial1ByteCommC.StdControl; +} \ No newline at end of file Copied: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192InterruptRegisters.h (from rev 1054, trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h) =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192InterruptRegisters.h (rev 0) +++ trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192InterruptRegisters.h 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _MC13192_INTERRUPT_REGS_H_ +#define _MC13192_INTERRUPT_REGS_H_ + + // MCU Interrupt control. + #define MC13192_IRQ_SOURCE IRQSC + #define MC13192_IRQ_MOD_BIT IRQSC_IRQMOD + #define MC13192_IRQ_PE_BIT IRQSC_IRQPE + #define MC13192_IRQ_IE_BIT IRQSC_IRQIE + #define MC13192_IRQ_ACK_BIT IRQSC_IRQACK + #define MC13192_IRQ_FLAG_BIT IRQSC_IRQF + + #define SETUP_IRQ_PIN MC13192_IRQ_PE_BIT = 1 + + #define ACK_IRQ MC13192_IRQ_ACK_BIT = 1 // Dependent upon interrupt source chosen. + #define ENABLE_IRQ MC13192_IRQ_IE_BIT = 1 + #define DISABLE_IRQ MC13192_IRQ_IE_BIT = 0 + #define IRQ_LEVEL_EDGE MC13192_IRQ_MOD_BIT = 1 + #define IRQ_EDGE_ONLY MC13192_IRQ_MOD_BIT = 0 + #define IRQ_FLAG_SET MC13192_IRQ_FLAG_BIT + +#endif \ No newline at end of file Deleted: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h 2009-03-06 17:35:14 UTC (rev 1054) +++ trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h 2009-03-08 20:20:28 UTC (rev 1055) @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2009, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/** - * @author Jan Flora <jan...@di...> - */ - -#ifndef _MC13192_INTERRUPT_REGS_H_ -#define _MC13192_INTERRUPT_REGS_H_ - - // MCU Interrupt control. - #define MC13192_IRQ_SOURCE IRQSC - #define MC13192_IRQ_MOD_BIT IRQSC_IRQMOD - #define MC13192_IRQ_PE_BIT IRQSC_IRQPE - #define MC13192_IRQ_IE_BIT IRQSC_IRQIE - #define MC13192_IRQ_ACK_BIT IRQSC_IRQACK - #define MC13192_IRQ_FLAG_BIT IRQSC_IRQF - - #define SETUP_IRQ_PIN MC13192_IRQ_PE_BIT = 1 - - #define ACK_IRQ MC13192_IRQ_ACK_BIT = 1 // Dependent upon interrupt source chosen. - #define ENABLE_IRQ MC13192_IRQ_IE_BIT = 1 - #define DISABLE_IRQ MC13192_IRQ_IE_BIT = 0 - #define IRQ_LEVEL_EDGE MC13192_IRQ_MOD_BIT = 1 - #define IRQ_EDGE_ONLY MC13192_IRQ_MOD_BIT = 0 - #define IRQ_FLAG_SET MC13192_IRQ_FLAG_BIT - -#endif \ No newline at end of file Added: trunk/diku/tiny15four/tos/platforms/nano/PlatformInitC.nc =================================================================== --- trunk/diku/tiny15four/tos/platforms/nano/PlatformInitC.nc (rev 0) +++ trunk/diku/tiny15four/tos/platforms/nano/PlatformInitC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +configuration PlatformInitC +{ + provides + { + interface Init; + } + uses + { + interface Boot; + } +} +implementation +{ + components NoPlatformInitP; + + Init = NoPlatformInitP.Init; + NoPlatformInitP.Boot = Boot; +} \ No newline at end of file Added: trunk/diku/tiny15four/tos/platforms/skel/PlatformInitC.nc =================================================================== --- trunk/diku/tiny15four/tos/platforms/skel/PlatformInitC.nc (rev 0) +++ trunk/diku/tiny15four/tos/platforms/skel/PlatformInitC.nc 2009-03-08 20:20:28 UTC (rev 1055) @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +configuration PlatformInitC +{ + provides + { + interface Init; + } + uses + { + interface Boot; + } +} +implementation +{ + // Implement me. + + // NOTE: This configuration must exist, but it is not required to + // do anything, if no platform specific initialization are + // needed. In the case of no initialization, use the module + // NoPlatformInitP.nc to provide the needed dummy interfaces. +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qz...@us...> - 2009-03-06 17:35:55
|
Revision: 1054 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1054&view=rev Author: qzban Date: 2009-03-06 17:35:14 +0000 (Fri, 06 Mar 2009) Log Message: ----------- Minor changes in cc2430 simplemac + test program. cc2430 .target updated with tiny15four specific memory configuration. Environment file updated to include tiny15four. Some files moved around in tiny15four. Modified Paths: -------------- trunk/diku/env trunk/diku/mcs51/support/make/nano.target trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc trunk/diku/mcs51-private/apps/Test2430Radio/TestCC2430C.nc trunk/diku/tiny15four/apps/p2p_test/ping/Makefile trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc trunk/diku/tiny15four/tos/platforms/dig528/platform.t15f trunk/diku/tiny15four/tos/platforms/nano/platform.t15f trunk/diku/tiny15four/tos/platforms/skel/platform.t15f Added Paths: ----------- trunk/diku/mcs51/support/make/mcs51/CC2430-F128-TINY15FOUR.bat trunk/diku/mcs51/tos/chips/mcs51/ctype.h trunk/diku/tiny15four/tos/lib/tools/endianconv.h trunk/diku/tiny15four/tos/platforms/dig528/mc13192/ trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Pins.h trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192RegisterAccess.h trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h trunk/diku/tiny15four/tos/platforms/dig528/time.h trunk/diku/tiny15four/tos/platforms/nano/time.h trunk/diku/tiny15four/tos/platforms/skel/time.h Removed Paths: ------------- trunk/diku/mcs51/tos/chips/mcs51/ctype.h trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h trunk/diku/tiny15four/tos/chips/cc2430/time.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192Registers.h trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h trunk/diku/tiny15four/tos/chips/mc9s08gb60/time.h Modified: trunk/diku/env =================================================================== --- trunk/diku/env 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/env 2009-03-06 17:35:14 UTC (rev 1054) @@ -2,7 +2,7 @@ export TOSDIR=$TOSROOT/tos/ export MAKERULES=$TOSDIR/../support/make/Makerules export CONTRIBROOT=/opt/tinyos-2.x-contrib -export TOSMAKE_PATH="$TOSMAKEPATH $CONTRIBROOT/diku/sensinode/support/make $CONTRIBROOT/diku/mcs51/support/make $CONTRIBROOT/diku/freescale/support/make" +export TOSMAKE_PATH="$TOSMAKEPATH $CONTRIBROOT/diku/sensinode/support/make $CONTRIBROOT/diku/mcs51/support/make $CONTRIBROOT/diku/freescale/support/make $CONTRIBROOT/diku/tiny15four/support/make" # Supported Compilers: keil, iar, sdcc export MCS51_COMPILER=keil Added: trunk/diku/mcs51/support/make/mcs51/CC2430-F128-TINY15FOUR.bat =================================================================== --- trunk/diku/mcs51/support/make/mcs51/CC2430-F128-TINY15FOUR.bat (rev 0) +++ trunk/diku/mcs51/support/make/mcs51/CC2430-F128-TINY15FOUR.bat 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,23 @@ +echo off +SET C51INC=C:\Keil\C51\INC\Chipcon\;C:\Keil\C51\INC\ +SET C51LIB=C:\Keil\C51\LIB +SET CPU_TYPE=CC2430-F128 +SET CPU_VENDOR=Chipcon +SET UV2_TARGET=Target 1 +SET CPU_XTAL=0x016E3600 +echo on +rem C:\Keil\C51\BIN\C51.EXE "app.c" LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.\app.lst) REGFILE(app.reg) OBJECT(.\app.obj) +rem C:\Keil\C51\BIN\C51.EXE "app.c" LARGE PRINT(.\app.lst) OPTIMIZE(0,SIZE) OBJECT(.\app.obj) + +rem Compile app.c to app.obj +C:\Keil\C51\BIN\C51.EXE "app.c" LARGE PRINT(.\app.lst) OBJECT(.\app.obj) SYMBOLS + +rem Link startup.obj/app.obj and convert to hex +rem C:\Keil\C51\BIN\BL51.EXE "startup.obj", "app.obj" TO "app" PRINT (app.map) XDATA( 0XE000-0XFF00 ) RAMSIZE(256) REGFILE(app.reg) +rem C:\Keil\C51\BIN\OH51.EXE "app" + +rem Link using LX51 which should contain some optimisations... +rem LX51 is only available in the "professional edition" +C:\Keil\C51\BIN\LX51.EXE "startup.obj", "app.obj" TO "app" PRINT (app.map) CLASSES( CODE(C:0x0100-C:0xFFFF), CONST(C:0x0100-C:0xFFFF), XDATA(X:0xE000-X:0xFF00), IDATA(I:0-I:0xFF)) REGFILE(app.reg) NOOVERLAY +C:\Keil\C51\BIN\OHX51.EXE "app" + Modified: trunk/diku/mcs51/support/make/nano.target =================================================================== --- trunk/diku/mcs51/support/make/nano.target 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/mcs51/support/make/nano.target 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,6 +1,11 @@ PLATFORM = nano MCS51_KEIL_SCRIPT=CC2430-F128.bat +# Check if we are using the 802.15.4 library. +ifneq ($(filter $(MAKECMDGOALS),tiny15four),) +MCS51_KEIL_SCRIPT := CC2430-F128-TINY15FOUR.bat +endif + ifdef PLATFORM PFLAGS += -D__$(PLATFORM)__ -D__cc2430__ endif @@ -8,4 +13,4 @@ $(call TOSMake_include_platform,mcs51) nano: $(BUILD_DEPS) - @: + @: \ No newline at end of file Modified: trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc 2009-03-06 17:35:14 UTC (rev 1054) @@ -138,8 +138,10 @@ ieeeAddress[6] = TOS_NODE_ID >> 8; ieeeAddress[7] = TOS_NODE_ID; - /* Power cycle radio*/ - CC2430Reset(); + /****************************************** + ** Turn off receiver as default ** + ******************************************/ + CC2430RFDisable(); /* turn on oscillator, enabling RAM access */ CC2430ExternalOscillator(); @@ -171,11 +173,6 @@ /* Set transmitter power */ CC2430PALevelSet(CC2420_DEFAULT_POWER); - /****************************************** - ** Turn off receiver as default ** - ******************************************/ - CC2430RFDisable(); - call InterruptTXDone.enableRisingEdge(); call InterruptRFErr.enableRisingEdge(); } @@ -679,11 +676,14 @@ /******************** ********************/ - void CC2430Reset() + void CC2430RFEnable() { + // Clear voltage regulator status flag. + RFIF &= ~_BV(CC2430_RFIF_RREG_ON); + // Power cycle voltage regulator + _CC2430_RFPWR |= _BV(CC2430_RFPWR_RREG_RADIO_PD); _CC2430_RFPWR &= ~_BV(CC2430_RFPWR_RREG_RADIO_PD); - _CC2430_RFPWR |= _BV(CC2430_RFPWR_RREG_RADIO_PD); // RFPWR contains the register ADI_RADIO_PD as a delayed version // The manual however waits for the IF @@ -694,7 +694,7 @@ /******************** ** Enable radio and wait for boot up ********************/ - void CC2430RFEnable() + /* void CC2430RFEnable() { // Set delay an power up radio _CC2430_RFPWR = 0x04; // Power up radio and set delay @@ -703,7 +703,7 @@ // Wait by delay time in RFPWR_RREG_DELAY // One or the other should be good enough.. while((_CC2430_RFPWR & 0x10)){} - } + }*/ /******************** ********************/ Deleted: trunk/diku/mcs51/tos/chips/mcs51/ctype.h =================================================================== --- trunk/diku/mcs51/tos/chips/mcs51/ctype.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/mcs51/tos/chips/mcs51/ctype.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,3 +0,0 @@ -/* - * Dummy to prevent inclution of system includes (that Keil don't like) - */ Copied: trunk/diku/mcs51/tos/chips/mcs51/ctype.h (from rev 1045, trunk/diku/mcs51/tos/chips/mcs51/ctype.h) =================================================================== --- trunk/diku/mcs51/tos/chips/mcs51/ctype.h (rev 0) +++ trunk/diku/mcs51/tos/chips/mcs51/ctype.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,3 @@ +/* + * Dummy to prevent inclution of system includes (that Keil don't like) + */ Property changes on: trunk/diku/mcs51/tos/chips/mcs51/ctype.h ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/diku/mcs51-private/apps/Test2430Radio/TestCC2430C.nc =================================================================== --- trunk/diku/mcs51-private/apps/Test2430Radio/TestCC2430C.nc 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/mcs51-private/apps/Test2430Radio/TestCC2430C.nc 2009-03-06 17:35:14 UTC (rev 1054) @@ -11,8 +11,8 @@ TestCC2430P.Leds -> LedsC; // components SimpleMacDmaC as SimpleMacC; -// components SimpleMacC; - components SimpleMacLoggerC as SimpleMacC; + components SimpleMacC; +// components SimpleMacLoggerC as SimpleMacC; TestCC2430P.SimpleMac -> SimpleMacC.SimpleMac; TestCC2430P.SimpleMacControl -> SimpleMacC.StdControl; Modified: trunk/diku/tiny15four/apps/p2p_test/ping/Makefile =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/ping/Makefile 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/apps/p2p_test/ping/Makefile 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,4 +1,5 @@ COMPONENT=ping -ENVIRONMENT=RFDNBNS +# Only set environment when using freescale 802.15.4 +#ENVIRONMENT=RFDNBNS include $(MAKERULES) Deleted: trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,76 +0,0 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/* - @author Jan Flora <jan...@di...> -*/ - -#ifndef _ENDIANCONV_H_ -#define _ENDIANCONV_H_ - - static inline void NTOUH64(uint8_t *src, uint8_t *dst) - { - dst[0] = src[7]; - dst[1] = src[6]; - dst[2] = src[5]; - dst[3] = src[4]; - dst[4] = src[3]; - dst[5] = src[2]; - dst[6] = src[1]; - dst[7] = src[0]; - } - - static inline void NTOUH32(uint8_t *src, uint8_t *dst) - { - dst[0] = src[3]; - dst[1] = src[2]; - dst[2] = src[1]; - dst[3] = src[0]; - } - - static inline void NTOUH16(uint8_t *src, uint8_t *dst) - { - dst[0] = src[1]; - dst[1] = src[0]; - } - - static inline uint32_t _NTOUH32(uint32_t n) - { - char* base = (char*)&n; - return (uint32_t)base[3] << 24 | - (uint32_t)base[2] << 16 | - (uint32_t)base[1] << 8 | - (uint32_t)base[0]; - } - - static inline uint16_t _NTOUH16(uint16_t n) - { - char* base = (char*)&n; - return (uint16_t)base[1] << 8 | - (uint16_t)base[0]; - } - -#endif Deleted: trunk/diku/tiny15four/tos/chips/cc2430/time.h =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/time.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/cc2430/time.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,36 +0,0 @@ -/* Copyright (c) 2008, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/* - @author Jan Flora <jan...@di...> -*/ - -#ifndef _TIME_H_ -#define _TIME_H_ - -typedef uint32_t time_t; - -#endif \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-06 17:35:14 UTC (rev 1054) @@ -29,7 +29,7 @@ * @author Jan Flora <jan...@di...> */ -#include "mc13192InterruptRegs.h" +#include "mc13192Registers.h" #include "mc13192Pins.h" #include "mc13192Const.h" #include <time.h> Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -197,7 +197,7 @@ // The MAC address uint8_t *radioMACAddr; - #define RX_QUEUE_SIZE 3 +/* #define RX_QUEUE_SIZE 3 #define RX_BUFFER_QUEUE_SIZE 3 // Receive queue variables typedef struct { @@ -205,6 +205,6 @@ uint8_t length; bool crc; uint8_t lqi; - } receiveItem_t; + } receiveItem_t;*/ #endif Deleted: trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2009, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/** - * @author Jan Flora <jan...@di...> - */ - -#ifndef _MC13192_INTERRUPT_REGS_H_ -#define _MC13192_INTERRUPT_REGS_H_ - - // MCU Interrupt control. - #define MC13192_IRQ_SOURCE IRQSC - #define MC13192_IRQ_MOD_BIT IRQSC_IRQMOD - #define MC13192_IRQ_PE_BIT IRQSC_IRQPE - #define MC13192_IRQ_IE_BIT IRQSC_IRQIE - #define MC13192_IRQ_ACK_BIT IRQSC_IRQACK - #define MC13192_IRQ_FLAG_BIT IRQSC_IRQF - - #define SETUP_IRQ_PIN MC13192_IRQ_PE_BIT = 1 - - #define ACK_IRQ MC13192_IRQ_ACK_BIT = 1 // Dependent upon interrupt source chosen. - #define ENABLE_IRQ MC13192_IRQ_IE_BIT = 1 - #define DISABLE_IRQ MC13192_IRQ_IE_BIT = 0 - #define IRQ_LEVEL_EDGE MC13192_IRQ_MOD_BIT = 1 - #define IRQ_EDGE_ONLY MC13192_IRQ_MOD_BIT = 0 - #define IRQ_FLAG_SET MC13192_IRQ_FLAG_BIT - -#endif \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc 2009-03-06 17:35:14 UTC (rev 1054) @@ -32,7 +32,6 @@ #include <mc13192Filters.h> -#include <PhyTypes.h> module mc13192PhyDriverM { @@ -56,12 +55,14 @@ } implementation { + // Methods for fast register access. + #include "mc13192RegisterAccess.h" + // Most variables in here have no race conditions. // This is because operations are called on at a time // from the MAC layer. Furthermore most code in here runs // in highest priority interrupt context. // Atomic statements are added where needed. - #include <mc13192Registers.h> // Level 1 = List function calls. // Level 2 = Function calls + return values. // Level 3 = Extensive debug. Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc 2009-03-06 17:35:14 UTC (rev 1054) @@ -50,7 +50,8 @@ } implementation { - #include <mc13192Registers.h> + // Methods for fast register access. + #include "mc13192RegisterAccess.h" #define DBG_LEVEL 1 #include "Debug.h" Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc 2009-03-06 17:35:14 UTC (rev 1054) @@ -41,7 +41,8 @@ } implementation { - #include <mc13192Registers.h> + // Methods for fast register access. + #include "mc13192RegisterAccess.h" #define DBG_LEVEL 1 #include "Debug.h" @@ -49,11 +50,6 @@ // Global variables. bool eventTimerSet = FALSE; -/* command result_t StdControl.init() - { - return SUCCESS; - }*/ - command error_t Init.init() { // Stop all timers. Deleted: trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2009, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/** - * @author Jan Flora <jan...@di...> - */ - -#ifndef _MC13192_PINS_H_ -#define _MC13192_PINS_H_ - // Setup the MC13192 radio pins. - TOSH_ASSIGN_PIN(RADIO_CE, E, 2); // SPI Chip Enable pin - TOSH_ASSIGN_PIN(RADIO_ATTN, C, 2); // Attention pin - TOSH_ASSIGN_PIN(RADIO_RXTXEN, C, 3); // Receive/Transmit Enable pin - TOSH_ASSIGN_PIN(RADIO_RESET, C, 4); // Reset pin - TOSH_ASSIGN_PIN(RADIO_ANT_CTRL, B, 6); // Antenna Switch pin - TOSH_ASSIGN_PIN(RADIO_LNA_CTRL, B, 0); // LNA pin (Not mounted on EVB13192) - TOSH_ASSIGN_PIN(RADIO_OOI, B, 4); // Out-of-idle pin (Used in stream mode) - TOSH_ASSIGN_PIN(RADIO_CRC, B, 5); // CRC pin (Used in stream mode) -#endif \ No newline at end of file Deleted: trunk/diku/tiny15four/tos/chips/mc13192/mc13192Registers.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192Registers.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192Registers.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,65 +0,0 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/* - @author Jan Flora <jan...@di...> -*/ -// This file assumes that the SPI interface has been "used" before including. - -#ifndef _MC13192REGISTER_H_ -#define _MC13192REGISTER_H_ - - // inlined versions. - inline void writeRegisterFast(uint8_t addr, uint16_t content) - { - TOSH_CLR_RADIO_CE_PIN(); - call SPI.fastWriteByte(addr); - call SPI.fastWriteWord((uint8_t*)&content); - TOSH_SET_RADIO_CE_PIN(); - } - - inline uint16_t readRegisterFast(uint8_t addr) - { - uint16_t w=0; - TOSH_CLR_RADIO_CE_PIN(); - call SPI.fastWriteByte(addr | 0x80); - call SPI.fastReadWord((uint8_t*)&w); - TOSH_SET_RADIO_CE_PIN(); - return w; - } - - // Functions not inlined - void writeRegister(uint8_t addr, uint16_t content) __attribute((noinline)) - { - writeRegisterFast(addr, content); - } - - uint16_t readRegister(uint8_t addr) __attribute((noinline)) - { - return readRegisterFast(addr); - } - -#endif Deleted: trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,79 +0,0 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/** - * Network to host (and host to network) conversion. - * The MC9S08GB60 is a big-endian processor. - * - * @author Jan Flora <jan...@di...> - */ - -#ifndef _ENDIANCONV_H_ -#define _ENDIANCONV_H_ - - static inline void NTOUH64(uint8_t *src, uint8_t *dst) - { - dst[0] = src[7]; - dst[1] = src[6]; - dst[2] = src[5]; - dst[3] = src[4]; - dst[4] = src[3]; - dst[5] = src[2]; - dst[6] = src[1]; - dst[7] = src[0]; - } - - static inline void NTOUH32(uint8_t *src, uint8_t *dst) - { - dst[0] = src[3]; - dst[1] = src[2]; - dst[2] = src[1]; - dst[3] = src[0]; - } - - static inline void NTOUH16(uint8_t *src, uint8_t *dst) - { - dst[0] = src[1]; - dst[1] = src[0]; - } - - static inline uint32_t _NTOUH32(uint32_t n) - { - char* base = (char*)&n; - return (uint32_t)base[3] << 24 | - (uint32_t)base[2] << 16 | - (uint32_t)base[1] << 8 | - (uint32_t)base[0]; - } - - static inline uint16_t _NTOUH16(uint16_t n) - { - char* base = (char*)&n; - return (uint16_t)base[1] << 8 | - (uint16_t)base[0]; - } - -#endif Deleted: trunk/diku/tiny15four/tos/chips/mc9s08gb60/time.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/time.h 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/time.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,36 +0,0 @@ -/* Copyright (c) 2008, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/* - @author Jan Flora <jan...@di...> -*/ - -#ifndef _TIME_H_ -#define _TIME_H_ - -typedef uint32_t time_t; - -#endif \ No newline at end of file Copied: trunk/diku/tiny15four/tos/lib/tools/endianconv.h (from rev 1053, trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h) =================================================================== --- trunk/diku/tiny15four/tos/lib/tools/endianconv.h (rev 0) +++ trunk/diku/tiny15four/tos/lib/tools/endianconv.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,90 @@ +/* Copyright (c) 2006, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Network to host (and host to network) conversion. + * + * @author Jan Flora <jan...@di...> + */ + +#ifndef _ENDIANCONV_H_ +#define _ENDIANCONV_H_ + + #ifdef BIG_ENDIAN_BYTE_ORDERING + static inline void NTOUH64(uint8_t *src, uint8_t *dst) + { + dst[0] = src[7]; + dst[1] = src[6]; + dst[2] = src[5]; + dst[3] = src[4]; + dst[4] = src[3]; + dst[5] = src[2]; + dst[6] = src[1]; + dst[7] = src[0]; + } + + static inline void NTOUH32(uint8_t *src, uint8_t *dst) + { + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; + } + + static inline void NTOUH16(uint8_t *src, uint8_t *dst) + { + dst[0] = src[1]; + dst[1] = src[0]; + } + #else + // Assume little endian byte ordering. + static inline void NTOUH64(uint8_t *src, uint8_t *dst) + { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + dst[4] = src[4]; + dst[5] = src[5]; + dst[6] = src[6]; + dst[7] = src[7]; + } + + static inline void NTOUH32(uint8_t *src, uint8_t *dst) + { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + } + + static inline void NTOUH16(uint8_t *src, uint8_t *dst) + { + dst[0] = src[0]; + dst[1] = src[1]; + } + #endif +#endif Copied: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Pins.h (from rev 1053, trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h) =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Pins.h (rev 0) +++ trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Pins.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _MC13192_PINS_H_ +#define _MC13192_PINS_H_ + // Setup the MC13192 radio pins. + TOSH_ASSIGN_PIN(RADIO_CE, E, 2); // SPI Chip Enable pin + TOSH_ASSIGN_PIN(RADIO_ATTN, C, 2); // Attention pin + TOSH_ASSIGN_PIN(RADIO_RXTXEN, C, 3); // Receive/Transmit Enable pin + TOSH_ASSIGN_PIN(RADIO_RESET, C, 4); // Reset pin + TOSH_ASSIGN_PIN(RADIO_ANT_CTRL, B, 6); // Antenna Switch pin + TOSH_ASSIGN_PIN(RADIO_LNA_CTRL, B, 0); // LNA pin (Not mounted on EVB13192) + TOSH_ASSIGN_PIN(RADIO_OOI, B, 4); // Out-of-idle pin (Used in stream mode) + TOSH_ASSIGN_PIN(RADIO_CRC, B, 5); // CRC pin (Used in stream mode) +#endif \ No newline at end of file Property changes on: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Pins.h ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192RegisterAccess.h (from rev 1047, trunk/diku/tiny15four/tos/chips/mc13192/mc13192Registers.h) =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192RegisterAccess.h (rev 0) +++ trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192RegisterAccess.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,65 @@ +/* Copyright (c) 2006, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/* + @author Jan Flora <jan...@di...> +*/ +// This file assumes that the SPI interface has been "used" before including. + +#ifndef _MC13192REGISTER_H_ +#define _MC13192REGISTER_H_ + + // inlined versions. + inline void writeRegisterFast(uint8_t addr, uint16_t content) + { + TOSH_CLR_RADIO_CE_PIN(); + call SPI.fastWriteByte(addr); + call SPI.fastWriteWord((uint8_t*)&content); + TOSH_SET_RADIO_CE_PIN(); + } + + inline uint16_t readRegisterFast(uint8_t addr) + { + uint16_t w=0; + TOSH_CLR_RADIO_CE_PIN(); + call SPI.fastWriteByte(addr | 0x80); + call SPI.fastReadWord((uint8_t*)&w); + TOSH_SET_RADIO_CE_PIN(); + return w; + } + + // Functions not inlined + void writeRegister(uint8_t addr, uint16_t content) __attribute((noinline)) + { + writeRegisterFast(addr, content); + } + + uint16_t readRegister(uint8_t addr) __attribute((noinline)) + { + return readRegisterFast(addr); + } + +#endif Property changes on: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192RegisterAccess.h ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h (from rev 1053, trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h) =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h (rev 0) +++ trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _MC13192_INTERRUPT_REGS_H_ +#define _MC13192_INTERRUPT_REGS_H_ + + // MCU Interrupt control. + #define MC13192_IRQ_SOURCE IRQSC + #define MC13192_IRQ_MOD_BIT IRQSC_IRQMOD + #define MC13192_IRQ_PE_BIT IRQSC_IRQPE + #define MC13192_IRQ_IE_BIT IRQSC_IRQIE + #define MC13192_IRQ_ACK_BIT IRQSC_IRQACK + #define MC13192_IRQ_FLAG_BIT IRQSC_IRQF + + #define SETUP_IRQ_PIN MC13192_IRQ_PE_BIT = 1 + + #define ACK_IRQ MC13192_IRQ_ACK_BIT = 1 // Dependent upon interrupt source chosen. + #define ENABLE_IRQ MC13192_IRQ_IE_BIT = 1 + #define DISABLE_IRQ MC13192_IRQ_IE_BIT = 0 + #define IRQ_LEVEL_EDGE MC13192_IRQ_MOD_BIT = 1 + #define IRQ_EDGE_ONLY MC13192_IRQ_MOD_BIT = 0 + #define IRQ_FLAG_SET MC13192_IRQ_FLAG_BIT + +#endif \ No newline at end of file Property changes on: trunk/diku/tiny15four/tos/platforms/dig528/mc13192/mc13192Registers.h ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/diku/tiny15four/tos/platforms/dig528/platform.t15f =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/platform.t15f 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/platforms/dig528/platform.t15f 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,4 +1,6 @@ # Include platform dependent code. PFLAGS += -I$(TINY15FOUR_DIR)/tos/chips/mc13192 \ -I$(TINY15FOUR_DIR)/tos/chips/mc9s08gb60 \ - -I$(TINY15FOUR_DIR)/tos/chips/mc9s08gb60/interfaces \ No newline at end of file + -I$(TINY15FOUR_DIR)/tos/chips/mc9s08gb60/interfaces \ + -I$(TINY15FOUR_DIR)/tos/platforms/dig528/mc13192 \ + -DBIG_ENDIAN_BYTE_ORDERING \ No newline at end of file Copied: trunk/diku/tiny15four/tos/platforms/dig528/time.h (from rev 1047, trunk/diku/tiny15four/tos/chips/mc9s08gb60/time.h) =================================================================== --- trunk/diku/tiny15four/tos/platforms/dig528/time.h (rev 0) +++ trunk/diku/tiny15four/tos/platforms/dig528/time.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2008, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + + typedef uint32_t time_t; + +#endif \ No newline at end of file Property changes on: trunk/diku/tiny15four/tos/platforms/dig528/time.h ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/diku/tiny15four/tos/platforms/nano/platform.t15f =================================================================== --- trunk/diku/tiny15four/tos/platforms/nano/platform.t15f 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/platforms/nano/platform.t15f 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,4 +1,5 @@ # Include platform dependent code. PFLAGS += -I$(TINY15FOUR_DIR)/tos/chips/cc2430 \ -I$(TINY15FOUR_DIR)/tos/chips/cc2430/phy \ - -I$(TINY15FOUR_DIR)/tos/chips/cc2430/phy/interfaces + -I$(TINY15FOUR_DIR)/tos/chips/cc2430/phy/interfaces \ + -DBIG_ENDIAN_BYTE_ORDERING Copied: trunk/diku/tiny15four/tos/platforms/nano/time.h (from rev 1047, trunk/diku/tiny15four/tos/chips/cc2430/time.h) =================================================================== --- trunk/diku/tiny15four/tos/platforms/nano/time.h (rev 0) +++ trunk/diku/tiny15four/tos/platforms/nano/time.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2008, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + + typedef uint32_t time_t; + +#endif \ No newline at end of file Property changes on: trunk/diku/tiny15four/tos/platforms/nano/time.h ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/diku/tiny15four/tos/platforms/skel/platform.t15f =================================================================== --- trunk/diku/tiny15four/tos/platforms/skel/platform.t15f 2009-03-06 16:57:29 UTC (rev 1053) +++ trunk/diku/tiny15four/tos/platforms/skel/platform.t15f 2009-03-06 17:35:14 UTC (rev 1054) @@ -1,5 +1,8 @@ # Include platform dependent code. # Change the include-statements below to include the folders containing -# the code for the platform chip/chips +# the code for the platform chip/chips +# Also, remember to specify the correct platform byte ordering +# (BIG_ENDIAN_BYTE_ORDERING or LITTLE_ENDIAN_BYTE_ORDERING PFLAGS += -I$(TINY15FOUR_DIR)/tos/chips/{YourMcu} \ - -I$(TINY15FOUR_DIR)/tos/chips/{YourRadioChip} + -I$(TINY15FOUR_DIR)/tos/chips/{YourRadioChip} \ + -DBIG_ENDIAN_BYTE_ORDERING Added: trunk/diku/tiny15four/tos/platforms/skel/time.h =================================================================== --- trunk/diku/tiny15four/tos/platforms/skel/time.h (rev 0) +++ trunk/diku/tiny15four/tos/platforms/skel/time.h 2009-03-06 17:35:14 UTC (rev 1054) @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2008, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Define the standard timestamp width. Minimum with is 32-bits. + * @author Jan Flora <jan...@di...> + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + + typedef uint32_t time_t; + +#endif \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qz...@us...> - 2009-03-06 16:57:50
|
Revision: 1053 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1053&view=rev Author: qzban Date: 2009-03-06 16:57:29 +0000 (Fri, 06 Mar 2009) Log Message: ----------- Tiny15four with Freescale dig528 now compiles against TinyOS 2.x.. Some documentation has been added. Modified Paths: -------------- trunk/diku/freescale/support/make/CodeWarrior/hcs08MangleAppC.pl trunk/diku/freescale/support/make/dig528.target trunk/diku/freescale/tos/chips/hcs08/hcs08hardware.h trunk/diku/freescale/tos/chips/hcs08/timer/Hcs08ClockC.nc trunk/diku/freescale/tos/platforms/dig528/include/stdlib.h trunk/diku/freescale/tos/platforms/dig528/include/string.h trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc trunk/diku/tiny15four/support/make/freescale802154.extra trunk/diku/tiny15four/support/make/tiny15four.extra trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourRandomC.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc trunk/diku/tiny15four/tos/interfaces/debug/ConsoleOutput.nc trunk/diku/tiny15four/tos/interfaces/debug/Debug.nc trunk/diku/tiny15four/tos/lib/debug/BufferedUartP.nc trunk/diku/tiny15four/tos/lib/debug/ConsoleP.nc trunk/diku/tiny15four/tos/lib/debug/DebugConsoleP.nc trunk/diku/tiny15four/tos/lib/freescale802154/ADTBufferManM.nc trunk/diku/tiny15four/tos/lib/freescale802154/Freescale802154M.nc trunk/diku/tiny15four/tos/lib/freescale802154/FreescaleBufferMngM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/AddressM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/McpsDataIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/McpsDataRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/McpsPurgeRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeAssociateIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeAssociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeBeaconNotifyIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeCommStatusIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeDisassociateIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeDisassociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeGetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeGtsIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeGtsRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeOrphanIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmePollRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeResetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeRxEnableRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeScanRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeSetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeStartRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeSyncLossIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeSyncRequestM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/PibAttributeM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/SduM.nc trunk/diku/tiny15four/tos/lib/mac/CapControlM.nc trunk/diku/tiny15four/tos/lib/timing/AsyncAlarmM.nc trunk/diku/tiny15four/tos/lib/timing/VirtualSymbolChannelM.nc trunk/diku/tiny15four/tos/lib/timing/VirtualSymbolCounterM.nc trunk/diku/tiny15four/tos/lib/tools/FIFOQueueM.nc trunk/diku/tiny15four/tos/lib/tools/FastLfsrM.nc Added Paths: ----------- trunk/diku/freescale/tos/platforms/dig528/platform.h trunk/diku/tiny15four/COMPILE trunk/diku/tiny15four/README trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h trunk/diku/tiny15four/tos/chips/skel/ trunk/diku/tiny15four/tos/chips/skel/Mcu/ trunk/diku/tiny15four/tos/chips/skel/Mcu/DebugC.nc trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourRandomC.nc trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourTimerC.nc trunk/diku/tiny15four/tos/chips/skel/README trunk/diku/tiny15four/tos/chips/skel/Radio/ trunk/diku/tiny15four/tos/chips/skel/Radio/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/lib/freescale802154/Tiny15FourC.nc trunk/diku/tiny15four/tos/platforms/skel/ trunk/diku/tiny15four/tos/platforms/skel/README trunk/diku/tiny15four/tos/platforms/skel/platform.t15f Removed Paths: ------------- trunk/diku/tiny15four/todo trunk/diku/tiny15four/tos/chips/mc13192/endianconv.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverConst.h trunk/diku/tiny15four/tos/lib/freescale802154/Ieee802154C.nc Property Changed: ---------------- trunk/diku/tiny15four/apps/p2p_test/ping/ Modified: trunk/diku/freescale/support/make/CodeWarrior/hcs08MangleAppC.pl =================================================================== --- trunk/diku/freescale/support/make/CodeWarrior/hcs08MangleAppC.pl 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/freescale/support/make/CodeWarrior/hcs08MangleAppC.pl 2009-03-06 16:57:29 UTC (rev 1053) @@ -47,8 +47,8 @@ # It seems that the format of the gcc interrupts changed # this seems to work with the new format - s{^void\s+signal_(\w+)\(void\)\s*__attribute\(\(interrupt\)\)}{HCS08_SIGNAL($1)}; - s{__attribute\(\(interrupt\)\) void\s+signal_(\w+)\(void\)}{HCS08_SIGNAL($1)}; + s{^void\s+signal_(\w+)\(\s*void\s*\)\s+__attribute\(\(interrupt\)\)}{HCS08_SIGNAL($1)}; + s{__attribute\(\(interrupt\)\)\s+void\s+signal_(\w+)\(\s*void\s*\)}{HCS08_SIGNAL($1)}; # map gcc noinline attribute to hcs08 noinline pragma s{^(.*)(__attribute\(\(noinline\)\))(.*)}{#pragma NO_INLINE\n$1/*$2*/$3}; Modified: trunk/diku/freescale/support/make/dig528.target =================================================================== --- trunk/diku/freescale/support/make/dig528.target 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/freescale/support/make/dig528.target 2009-03-06 16:57:29 UTC (rev 1053) @@ -6,7 +6,8 @@ PLATFORM = dig528 -COMPILEHOST := http://www.distlab.dk/testbed/compile_gateway.pl +COMPILEHOST := http://testbed.ekstranet.diku.dk/compile/ +export COMPILEHOST # We need to set up some variables # TOSDIR: The basic tos directory. We can get that from ncc, if Modified: trunk/diku/freescale/tos/chips/hcs08/hcs08hardware.h =================================================================== --- trunk/diku/freescale/tos/chips/hcs08/hcs08hardware.h 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/freescale/tos/chips/hcs08/hcs08hardware.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -33,7 +33,7 @@ // see hcs08gb60_interrupts.h for a list of available interrupts // SIGNAL means interrupts are disabled within the handler #define TOSH_SIGNAL(signame) \ -void signal_##signame() __attribute__ ((interrupt, spontaneous, C)) +void signal_##signame() __attribute__((interrupt, spontaneous, C)) // just don't support TOSH_INTERRUPT, thus eliminating confusion /** Declare the ANSI startup function, see below (TinyOSStartup) */ Modified: trunk/diku/freescale/tos/chips/hcs08/timer/Hcs08ClockC.nc =================================================================== --- trunk/diku/freescale/tos/chips/hcs08/timer/Hcs08ClockC.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/freescale/tos/chips/hcs08/timer/Hcs08ClockC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -38,7 +38,7 @@ * We initialize Hcs08TimerCommonP here to get * default interrupt handlers going */ - components Hcs08TimerCommonP; + //components Hcs08TimerCommonP; Init = Hcs08ClockP; Hcs08ClockInit = Hcs08ClockP; Modified: trunk/diku/freescale/tos/platforms/dig528/include/stdlib.h =================================================================== --- trunk/diku/freescale/tos/platforms/dig528/include/stdlib.h 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/freescale/tos/platforms/dig528/include/stdlib.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -2,16 +2,20 @@ #ifndef _STDLIB_H_ #define _STDLIB_H_ -/* The memset function in Codewarior doesnt work */ -void *memset(void *s, unsigned char c, int n) -{ - char *target = (char*)s; - while(n > 0) - { - *target = c; - target++; - n--; - } - return s; -} + // The memset function in Codewarior doesnt work + void *memset(void *s, unsigned char c, int n) + { + char *target = (char*)s; + while(n > 0) { + *target = c; + target++; + n--; + } + return s; + } + + #ifndef NULL + #define NULL ((void *) 0) + #endif + #endif Modified: trunk/diku/freescale/tos/platforms/dig528/include/string.h =================================================================== --- trunk/diku/freescale/tos/platforms/dig528/include/string.h 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/freescale/tos/platforms/dig528/include/string.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,4 +1,8 @@ /** Dummy header to avoid inclusion of the standard library header **/ #ifndef _STDIO_H_ #define _STDIO_H_ + + // We need memcpy. + void *memcpy(void *, const void *, size_t); + #endif Added: trunk/diku/tiny15four/COMPILE =================================================================== --- trunk/diku/tiny15four/COMPILE (rev 0) +++ trunk/diku/tiny15four/COMPILE 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,27 @@ + +TINY15FOUR COMPILATION INSTRUCTIONS + +Since Tiny15four is implemented as sort of a "plugin" (using .extra files), +the compilation integrates nicely into TinyOS. Before Tiny15four can be used +with your platform, a couple of things needs to be in place: + +1. A TinyOS 2.x port for your platform exists. If not, and if you are interested + in doing the port yourself, you only need a bare minimum of functionality. + Forget about TinyOS timers other pheriperal support for now. It is though + recommended that you implement the a module supporting the SerialByteComm + interface on a UART for debuggin purposes. + +2. A Tiny15four port for your platform exists. If not, check the "skel" folders + in the tos/chips and tos/platforms folders to see what is needed. + +3. You need a working TinyOS 2.x installation, a working toolchain for your + platform and an installation of NesC >= 1.2. + +To compile an application with Tiny15four support, just add the string "tiny15four" +to your make parameters and you should be on your way. To build a TinyOS application +with Tiny15four support for the Sensinode Nano platform type: + + make nano tiny15four + +in the applications main folder. It's as simple as it gets :-) + Added: trunk/diku/tiny15four/README =================================================================== --- trunk/diku/tiny15four/README (rev 0) +++ trunk/diku/tiny15four/README 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,8 @@ +Tiny15four is an 802.15.4 networking layer for TinyOS 2.x +Tiny15four features: + + * Multi-platform support through a uniform interface + * Support for beacon-enabled networks + * Support CSMA/CA and TDMA channel access + * Multiple device profiles + * And a lot of other features... \ No newline at end of file Property changes on: trunk/diku/tiny15four/apps/p2p_test/ping ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc =================================================================== --- trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -81,6 +81,8 @@ while (i<1000000) i++; DBG_STR("Init...",1); + + return SUCCESS; } event void Boot.booted() Modified: trunk/diku/tiny15four/support/make/freescale802154.extra =================================================================== --- trunk/diku/tiny15four/support/make/freescale802154.extra 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/support/make/freescale802154.extra 2009-03-06 16:57:29 UTC (rev 1053) @@ -25,14 +25,32 @@ # @author Jan Flora <jan...@di...> +# This only works with the dig528 platform! +ifneq ($(PLATFORM),dig528) +$(error The freescale802154 is only available for the dig528 platform) +endif +# Determine where the tiny15four directory is located. +# This requires that this make file is actually placed in the same folder as the rest +# of the tiny15four code. +ifndef TINY15FOUR_DIR + TINY15FOUR_DIR := $(realpath $(dir $(filter %freescale802154.extra,$(MAKEFILE_LIST)))../../) +endif + NESC_FLAGS += -fnesc-include=$(TINY15FOUR_DIR)/tos/lib/freescale802154/802154 +# Get includes from the platform.t15f file for the chosen platform. +include $(TINY15FOUR_DIR)/tos/platforms/$(PLATFORM)/platform.t15f # Make sure ncc can find the files we need. -PFLAGS += \ --I$(TINY15FOUR_DIR)/tos/lib/freescale802154 \ --I$(TINY15FOUR_DIR)/tos/lib/freescale802154/macApi \ --I$(TINY15FOUR_DIR)/tos/interfaces \ --I$(TINY15FOUR_DIR)/tos/interfaces/macApi \ --I$(TINY15FOUR_DIR)/tos/interfaces/tools \ +PFLAGS += -I$(TINY15FOUR_DIR)/tos/lib/freescale802154 \ + -I$(TINY15FOUR_DIR)/tos/lib/freescale802154/macApi \ + -I$(TINY15FOUR_DIR)/tos/lib/debug \ + -I$(TINY15FOUR_DIR)/tos/lib/tools \ + -I$(TINY15FOUR_DIR)/tos/interfaces \ + -I$(TINY15FOUR_DIR)/tos/interfaces/macApi \ + -I$(TINY15FOUR_DIR)/tos/interfaces/tools \ + -I$(TINY15FOUR_DIR)/tos/interfaces/debug + +export PFLAGS +export NESC_FLAGS Modified: trunk/diku/tiny15four/support/make/tiny15four.extra =================================================================== --- trunk/diku/tiny15four/support/make/tiny15four.extra 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/support/make/tiny15four.extra 2009-03-06 16:57:29 UTC (rev 1053) @@ -32,26 +32,27 @@ TINY15FOUR_DIR := $(realpath $(dir $(filter %tiny15four.extra,$(MAKEFILE_LIST)))../../) endif +NESC_FLAGS=-Wnesc-data-race -Wnesc-async -Wno-nesc-fnptr -Wnesc-combine + # Get includes from the platform.t15f file for the chosen platform. include $(TINY15FOUR_DIR)/tos/platforms/$(PLATFORM)/platform.t15f # Make sure ncc can find the files we need. -PFLAGS += \ --I$(TINY15FOUR_DIR)/tos/platforms/$(PLATFORM) \ --I$(TINY15FOUR_DIR)/tos/interfaces \ --I$(TINY15FOUR_DIR)/tos/interfaces/debug \ --I$(TINY15FOUR_DIR)/tos/interfaces/mac \ --I$(TINY15FOUR_DIR)/tos/interfaces/macApi \ --I$(TINY15FOUR_DIR)/tos/interfaces/phy \ --I$(TINY15FOUR_DIR)/tos/interfaces/timing \ --I$(TINY15FOUR_DIR)/tos/interfaces/tools \ --I$(TINY15FOUR_DIR)/tos/lib \ --I$(TINY15FOUR_DIR)/tos/lib/mac \ --I$(TINY15FOUR_DIR)/tos/lib/macApi \ --I$(TINY15FOUR_DIR)/tos/lib/macApi/ADTModules \ --I$(TINY15FOUR_DIR)/tos/lib/timing \ --I$(TINY15FOUR_DIR)/tos/lib/tools \ --I$(TINY15FOUR_DIR)/tos/lib/debug +PFLAGS += -I$(TINY15FOUR_DIR)/tos/platforms/$(PLATFORM) \ + -I$(TINY15FOUR_DIR)/tos/interfaces \ + -I$(TINY15FOUR_DIR)/tos/interfaces/debug \ + -I$(TINY15FOUR_DIR)/tos/interfaces/mac \ + -I$(TINY15FOUR_DIR)/tos/interfaces/macApi \ + -I$(TINY15FOUR_DIR)/tos/interfaces/phy \ + -I$(TINY15FOUR_DIR)/tos/interfaces/timing \ + -I$(TINY15FOUR_DIR)/tos/interfaces/tools \ + -I$(TINY15FOUR_DIR)/tos/lib \ + -I$(TINY15FOUR_DIR)/tos/lib/mac \ + -I$(TINY15FOUR_DIR)/tos/lib/macApi \ + -I$(TINY15FOUR_DIR)/tos/lib/macApi/ADTModules \ + -I$(TINY15FOUR_DIR)/tos/lib/timing \ + -I$(TINY15FOUR_DIR)/tos/lib/tools \ + -I$(TINY15FOUR_DIR)/tos/lib/debug - -NESC_FLAGS=-Wnesc-data-race -Wnesc-async -Wno-nesc-fnptr -Wnesc-combine \ No newline at end of file +export PFLAGS +export NESC_FLAGS \ No newline at end of file Deleted: trunk/diku/tiny15four/todo =================================================================== --- trunk/diku/tiny15four/todo 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/todo 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,27 +0,0 @@ -Changes needed in connection with thesis: - -- Finish and test new MCU timers. -- PHY layer needs to maintain rxOn/rxOff status and enable receiver after transmit if it was priorly on. -- Add rxOff to PhyReceive. -- Change the buffer swapping principle of the PHY to use buffer manager instead. -- Split MC13192 driver into modules (Attribute handler, Defer handler). -- What about loss of lock event in radio? -- Do 16 bit comparison in filters to optimize code for 16 bit processor. -- Packet timestamp and duration calculations should be moved to a point after the stream reception completes. -- Divide radio interrupt handler into two interrupt handlers, stream and normal. Stream interrupt handler should disable itself. -- Make radio driver work at 16 MHz CPU clock. -- Revisit PhyReceive interface. Should probably be split up! - -MAC: -- Rewrite pollService to do poll checking instead of FrameRx. -- Move GTS part of CfpControl to a separate module. -- Handle timeout of indirect tx's when in non-beacon mode! -- Activation of superframe periods should be handled by a separate module! -- Don't handle coordinator realignments in scan! -- Is the TimingService module needed at all?? -- PollService must reserve the CAP in order to listen for the response! -- We need CAP transaction handling for polls. -- Revisit coordinator realignment. -- Need timed RxOn in CAP for use with poll and RxEnable. -- Poll operation must apply a filter to only receive relevant frames while listening. -- Only use one pending queue in CapControl. The txHeaders are already identified by header->superframe. \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -68,6 +68,8 @@ RFIM |= _BV(CC2430_RFIM_CSP_WT); RFIM |= _BV(CC2430_RFIM_CSP_STOP); RFIM |= _BV(CC2430_RFIM_CSP_INT); + + return SUCCESS; } command void PhyReset.reset() Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -69,6 +69,8 @@ while (!(SLEEP & _BV(CC2430_SLEEP_XOSC_STB))); setupRF(); + + return SUCCESS; } command void PhyReset.reset() Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -105,6 +105,8 @@ // Deferred receive. call CspReceive.startDeferredRx(commenceTime); } + + return PHY_SUCCESS; } async command void PhyReceive.rxOff() Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -176,7 +176,7 @@ async event void CspTransmit.writeFrame() { - txdata_t *data; +/* txdata_t *data; uint8_t i; uint8_t *frame; @@ -189,7 +189,7 @@ call Dma.startTransfer(); // Write data to transmission buffer. - /*frame = data->frame; + frame = data->frame; RFD = (data->length+2); for (i=0; i<data->length; i++) { RFD = *frame++; Modified: trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,4 +1,5 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> +/** + * Copyright (c) 2006, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,10 +25,13 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ +#include "mc13192InterruptRegs.h" +#include "mc13192Pins.h" +#include "mc13192Const.h" #include <time.h> configuration Tiny15FourPhyC @@ -55,10 +59,8 @@ mc13192PhyInterruptM, mc13192PhyTimerM, // Provided by the MCU implementation. - mc13192SpiC, - AsyncAlarmC; + mc13192SpiC; - Init = mc13192SpiC.Init; Init = mc13192PhyInitM.Init; Init = mc13192PhyTimerM.Init; @@ -78,10 +80,11 @@ mc13192PhyDriverM.MCUTime = LocalTime; // Wire up the SPI. - mc13192PhyInitM.SPI = mc13192SpiC.SPI; - mc13192PhyDriverM.SPI = mc13192SpiC.SPI; - mc13192PhyInterruptM.SPI = mc13192SpiC.SPI; - mc13192PhyTimerM.SPI = mc13192SpiC.SPI; + mc13192PhyInitM.SpiControl -> mc13192SpiC.SpiControl; + mc13192PhyInitM.SPI -> mc13192SpiC.Spi; + mc13192PhyDriverM.SPI -> mc13192SpiC.Spi; + mc13192PhyInterruptM.SPI -> mc13192SpiC.Spi; + mc13192PhyTimerM.SPI -> mc13192SpiC.Spi; // Wire debug module. mc13192PhyDriverM.Debug = Debug; Deleted: trunk/diku/tiny15four/tos/chips/mc13192/endianconv.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/endianconv.h 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc13192/endianconv.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,76 +0,0 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/* - @author Jan Flora <jan...@di...> -*/ - -#ifndef _ENDIANCONV_H_ -#define _ENDIANCONV_H_ - - static inline void NTOUH64(uint8_t *src, uint8_t *dst) - { - dst[0] = src[7]; - dst[1] = src[6]; - dst[2] = src[5]; - dst[3] = src[4]; - dst[4] = src[3]; - dst[5] = src[2]; - dst[6] = src[1]; - dst[7] = src[0]; - } - - static inline void NTOUH32(uint8_t *src, uint8_t *dst) - { - dst[0] = src[3]; - dst[1] = src[2]; - dst[2] = src[1]; - dst[3] = src[0]; - } - - static inline void NTOUH16(uint8_t *src, uint8_t *dst) - { - dst[0] = src[1]; - dst[1] = src[0]; - } - - static inline uint32_t _NTOUH32(uint32_t n) - { - char* base = (char*)&n; - return (uint32_t)base[3] << 24 | - (uint32_t)base[2] << 16 | - (uint32_t)base[1] << 8 | - (uint32_t)base[0]; - } - - static inline uint16_t _NTOUH16(uint16_t n) - { - char* base = (char*)&n; - return (uint16_t)base[1] << 8 | - (uint16_t)base[0]; - } - -#endif Added: trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h (rev 0) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192Const.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,210 @@ +/** + * Copyright (c) 2006, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _MC13192CONST_H_ +#define _MC13192CONST_H_ + +/************************************************************** +* Defines +* MC13192 status register interrupt masks. +**************************************************************/ + + // MC13192 Register 05 + #define TIMER1_IRQMASK_BIT 0x0001 + #define TIMER2_IRQMASK_BIT 0x0002 + #define TIMER3_IRQMASK_BIT 0x0004 + #define TIMER4_IRQMASK_BIT 0x0008 + #define DOZE_IRQMASK_BIT 0x0010 + #define LO1_LOCK_IRQMASK_BIT 0x0200 + #define STRM_DATA_IRQMASK_BIT 0x0400 + #define ARB_BUSY_IRQMASK_BIT 0x0800 + #define RAM_ADDR_IRQMASK_BIT 0x1000 + #define ATTN_IRQMASK_BIT 0x8000 + + // MC13192 Register 24 + #define CRC_VALID_MASK 0x0001 + #define CCA_STATUS_MASK 0x0002 + #define TIMER2_IRQ_MASK 0x0004 + #define TIMER4_IRQ_MASK 0x0008 + #define TIMER3_IRQ_MASK 0x0010 + #define CCA_IRQ_MASK 0x0020 + #define TX_IRQ_MASK 0x0040 + #define RX_IRQ_MASK 0x0080 + #define TIMER1_IRQ_MASK 0x0100 + #define DOZE_IRQ_MASK 0x0200 + #define ATTN_IRQ_MASK 0x0400 + #define HG_IRQ_MASK 0x0800 + #define STRM_DATA_ERR_IRQ_MASK 0x1000 + #define STRM_RX_DONE_IRQ_MASK 0x2000 + #define ARB_BUSY_ERR_IRQ_MASK 0x2000 + #define STRM_TX_DONE_IRQ_MASK 0x4000 + #define RAM_ADDR_ERR_IRQ_MASK 0x4000 + #define LO_LOCK_IRQ_MASK 0x8000 + + // MC13192 Register 25 + #define RESET_BIT_MASK 0x0080 + +/************************************************************** +* Defines +* The MC13192 transceiver register map. +**************************************************************/ + + /******** MC13192 soft reset **********/ + #define RESET 0x00 + + /******** Packet RAM **********/ + #define RX_PKT_RAM 0x01 // RX Packet RAM + #define RX_STATUS 0x2D // RX Packet RAM Length [6:0] + #define TX_PKT_RAM 0x02 // TX Packet RAM + #define TX_PKT_CTL 0x03 // TX Packet RAM Length + + /******** IRQ Status Register *******/ + #define IRQ_MASK 0x05 + #define IRQ_STATUS 0x24 + #define RST_IND 0x25 + + /******** Control Registers **********/ + #define CONTROL_A 0x06 + #define CONTROL_B 0x07 + #define CONTROL_C 0x09 + #define LO1_COURSE_TUNE 0x8000 + + /******** Main Timer **********/ + #define CURRENT_TIME_A 0x26 + #define CURRENT_TIME_B 0x27 + #define TIMESTAMP_A 0x2E + #define TIMESTAMP_B 0x2F + #define TIMESTAMP_HI_MASK 0x00FF + + /******** frequency ***************/ + #define CLKO_CTL 0x0A + #define LO1_INT_DIV 0x0F + #define LO1_NUM 0x10 + + /******** Timer comparators **********/ + #define TMR_CMP1_A 0x1B + #define TMR_CMP1_B 0x1C + #define TMR_CMP2_A 0x1D + #define TMR_CMP2_B 0x1E + #define TMR_CMP3_A 0x1F + #define TMR_CMP3_B 0x20 + #define TMR_CMP4_A 0x21 + #define TMR_CMP4_B 0x22 + #define TC2_PRIME 0x23 + + /******** CCA **********/ + #define CCA_THRESH 0x04 + + /******** TX ***********/ + #define PA_LVL 0x12 + + /******* GPIO **********/ + #define GPIO_DIR 0x0B + #define GPIO_DATA_OUT 0x0C + #define GPIO_DATA_IN 0x28 + #define GPIO_DATA_MASK 0x003F + + /******* version *******/ + #define CHIP_ID 0x2C + #define MASK_SET_ID_MASK 0xE000 + #define VERSION_MASK 0x1C00 + #define MANUFACTURER_ID_MASK 0x0380 + +/************************************************************** +* Defines +* Modes for the MC13192 transceiver. +**************************************************************/ + + // These modes corresponds to register 6 settings. + // Remember to set the hidden bit 14. + #define IDLE_MODE 0x4000 + #define CCA_MODE 0x4411 + #define ED_MODE 0x4421 + #define RX_MODE 0x4122 // Was: 0x4102 + #define TX_MODE 0x4203 // Was: 0x4203 + + #define TX_STRM_MODE 0x5200 + #define RX_STRM_MODE 0x4922 + + #define TX_CCA_MODE1 0x4615 + #define TX_CCA_MODE2 0x4616 + + #define INIT_MODE 0x80 + + // Event timer bit + #define EVENT_TIMED 0x0080 + +// Radio register 07 defines. + #define STREAM_MODE_ON 0x7D20 + #define STREAM_MODE_OFF 0x7D00 + +// Define CCA types. + #define CLEAR_CHANNEL_ASSESSMENT 0x01 + #define ENERGY_DETECT 0x02 + +// Define radio transmit modes. + #define STREAM_MODE 0x01 + #define PACKET_MODE 0x02 + +// Modes of operation + #define NO_OPERATION 0x00 + #define RX_OPERATION 0x01 + #define TX_OPERATION 0x02 + #define CCA_OPERATION 0x03 + +// Deferred operation types. + #define DEFER_RX 0 + #define DEFER_TX 1 + #define DEFER_TX_CCA 2 + +// Timer macros. + #define NUMTIMERS 4 + #define TIMER1 0 + #define TIMER2 1 + #define TIMER3 2 + #define TIMER4 3 + + // This is where the MAC address is stored in flash. + #define MAC_ADDR_LOCATION 0xFDB6 + // The MAC address + uint8_t *radioMACAddr; + + #define RX_QUEUE_SIZE 3 + #define RX_BUFFER_QUEUE_SIZE 3 + // Receive queue variables + typedef struct { + uint8_t *buffer; + uint8_t length; + bool crc; + uint8_t lqi; + } receiveItem_t; + +#endif Added: trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h (rev 0) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192InterruptRegs.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _MC13192_INTERRUPT_REGS_H_ +#define _MC13192_INTERRUPT_REGS_H_ + + // MCU Interrupt control. + #define MC13192_IRQ_SOURCE IRQSC + #define MC13192_IRQ_MOD_BIT IRQSC_IRQMOD + #define MC13192_IRQ_PE_BIT IRQSC_IRQPE + #define MC13192_IRQ_IE_BIT IRQSC_IRQIE + #define MC13192_IRQ_ACK_BIT IRQSC_IRQACK + #define MC13192_IRQ_FLAG_BIT IRQSC_IRQF + + #define SETUP_IRQ_PIN MC13192_IRQ_PE_BIT = 1 + + #define ACK_IRQ MC13192_IRQ_ACK_BIT = 1 // Dependent upon interrupt source chosen. + #define ENABLE_IRQ MC13192_IRQ_IE_BIT = 1 + #define DISABLE_IRQ MC13192_IRQ_IE_BIT = 0 + #define IRQ_LEVEL_EDGE MC13192_IRQ_MOD_BIT = 1 + #define IRQ_EDGE_ONLY MC13192_IRQ_MOD_BIT = 0 + #define IRQ_FLAG_SET MC13192_IRQ_FLAG_BIT + +#endif \ No newline at end of file Deleted: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverConst.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverConst.h 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverConst.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,57 +0,0 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> - * 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 University of Copenhagen 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. - */ - -/* - @author Jan Flora <jan...@di...> -*/ - -#ifndef _PHY_DRIVER_CONST_H_ -#define _PHY_DRIVER_CONST_H_ - - // Radio register 06 defines. - // Transmission modes. - #define TX_CCA_MODE1 0x4615 - #define TX_CCA_MODE2 0x4616 - - // Event timer bit - #define EVENT_TIMED 0x0080 - - // Radio register 07 defines. - #define STREAM_MODE_ON 0x7D20 - #define STREAM_MODE_OFF 0x7D00 - - // Deferred operation types. - #define DEFER_RX 0 - #define DEFER_TX 1 - #define DEFER_TX_CCA 2 - -/* typedef struct { - uint8_t *buffer; - uint8_t length; - uint8_t lqi; - } rxFrame_t;*/ - -#endif Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,4 +1,5 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> +/** + * Copyright (c) 2006, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,15 +25,13 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <time.h> -#include <mcuToRadioPorts.h> -#include <mc13192Const.h> + + #include <mc13192Filters.h> -#include <mc13192PhyDriverConst.h> #include <PhyTypes.h> module mc13192PhyDriverM @@ -152,7 +151,7 @@ * PhyAttributes code * *********************************************************************/ - async command result_t PhyAttributes.setChannel(uint8_t channel) + async command error_t PhyAttributes.setChannel(uint8_t channel) { // Convert from IEEE 802.15.4 notation. channel -= 11; @@ -173,7 +172,7 @@ return FAIL; } - async command result_t PhyAttributes.setContentionWindow(uint8_t size) + async command error_t PhyAttributes.setContentionWindow(uint8_t size) { if (size == 1) { atomic ccaMode = TX_CCA_MODE1; @@ -185,24 +184,24 @@ return SUCCESS; } - command result_t PhyAttributes.setTransmitPower(uint8_t power) + command error_t PhyAttributes.setTransmitPower(uint8_t power) { return SUCCESS; } - async command result_t PhyAttributes.setAckBackoffAlignment(bool align) + async command error_t PhyAttributes.setAckBackoffAlignment(bool align) { atomic backoffAligned = align; return SUCCESS; } - command result_t PhyAttributes.setFilter(bool (*filter)(uint8_t*)) + command error_t PhyAttributes.setFilter(bool (*filter)(uint8_t*)) { myFilter = filter; return SUCCESS; } - command result_t PhyAttributes.clearFilter() + command error_t PhyAttributes.clearFilter() { myFilter = NULL; return SUCCESS; @@ -222,7 +221,7 @@ * PhyControl code * *********************************************************************/ - async command result_t PhyControl.trxOff(bool force) + async command phy_error_t PhyControl.trxOff(bool force) { if (opMode == TX_OPERATION) { DBG_STR("FATAL: Transmission was interrupted!",1); @@ -230,7 +229,7 @@ atomic opMode = NO_OPERATION; receiverOn = FALSE; abortReceive(); - return SUCCESS; + return PHY_SUCCESS; } command void PhyControl.sleep(uint32_t wakeUpTime) Modified: trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,4 +1,5 @@ -/* Copyright (c) 2006, Jan Flora <jan...@di...> +/** + * Copyright (c) 2006, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -24,9 +25,9 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ #include <time.h> #include "macConstants.h" #include "endianconv.h" @@ -43,6 +44,7 @@ interface LocalTime<time_t> as MCUTime; interface mc13192PhyTimer as RadioTime; interface FastSPI as SPI; + interface StdControl as SpiControl; interface Debug; } } @@ -108,6 +110,24 @@ command error_t Init.init() __attribute__((noinline)) { + uint16_t irq_reg, attn_irq = FALSE; + + // Set the pin directions. + TOSH_PULLUP_RADIO_RESET_DISABLE(); + TOSH_MAKE_RADIO_CE_OUTPUT(); + TOSH_MAKE_RADIO_ATTN_OUTPUT(); + TOSH_MAKE_RADIO_RXTXEN_OUTPUT(); + TOSH_MAKE_RADIO_RESET_OUTPUT(); + TOSH_MAKE_RADIO_OOI_INPUT(); + TOSH_PULLUP_RADIO_OOI_ENABLE(); + TOSH_MAKE_RADIO_CRC_INPUT(); + TOSH_PULLUP_RADIO_CRC_ENABLE(); + TOSH_MAKE_RADIO_ANT_CTRL_OUTPUT(); + TOSH_MAKE_RADIO_LNA_CTRL_OUTPUT(); + + // Start up the SPI. + call SpiControl.start(); + // Initialize GPIO pins. TOSH_SET_RADIO_CE_PIN(); TOSH_SET_RADIO_ATTN_PIN(); @@ -116,12 +136,12 @@ TOSH_CLR_RADIO_ANT_CTRL_PIN(); TOSH_CLR_RADIO_LNA_CTRL_PIN(); -/* return SUCCESS; - } + return SUCCESS; +/* } command result_t StdControl.start() __attribute__((noinline)) {*/ - uint16_t irq_reg, attn_irq = FALSE; + // We then power up the radio and wait for it to init. ACK_IRQ; Added: trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h (rev 0) +++ trunk/diku/tiny15four/tos/chips/mc13192/mc13192Pins.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +#ifndef _MC13192_PINS_H_ +#define _MC13192_PINS_H_ + // Setup the MC13192 radio pins. + TOSH_ASSIGN_PIN(RADIO_CE, E, 2); // SPI Chip Enable pin + TOSH_ASSIGN_PIN(RADIO_ATTN, C, 2); // Attention pin + TOSH_ASSIGN_PIN(RADIO_RXTXEN, C, 3); // Receive/Transmit Enable pin + TOSH_ASSIGN_PIN(RADIO_RESET, C, 4); // Reset pin + TOSH_ASSIGN_PIN(RADIO_ANT_CTRL, B, 6); // Antenna Switch pin + TOSH_ASSIGN_PIN(RADIO_LNA_CTRL, B, 0); // LNA pin (Not mounted on EVB13192) + TOSH_ASSIGN_PIN(RADIO_OOI, B, 4); // Out-of-idle pin (Used in stream mode) + TOSH_ASSIGN_PIN(RADIO_CRC, B, 5); // CRC pin (Used in stream mode) +#endif \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/DebugC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,48 @@ +/* Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Debugging interface for the Freescale MC9S08GB60 + * @author Jan Flora <jan...@di...> + */ + +configuration DebugC +{ + provides + { + interface Debug; + interface CommandInterpreter; + } +} +implementation +{ + components DebugConsoleC, + Hcs08Serial0ByteCommC; + + DebugConsoleC.SerialByteComm -> Hcs08Serial0ByteCommC.SerialByteComm; + Debug = DebugConsoleC.Debug; + CommandInterpreter = DebugConsoleC.CommandInterpreter; +} \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -1,4 +1,5 @@ -/* Copyright (c) 2007, Jan Flora <jan...@di...> +/** + * Copyright (c) 2007, Jan Flora <jan...@di...> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -42,28 +43,16 @@ interface SymbolCounter<uint16_t> as Counter; interface SymbolChannel<uint16_t> as Channel; } + uses + { + interface Debug; + } } implementation { - #define NUM_CHANNELS 5 - uint16_t wrapCounter = 0; - - typedef struct { - uint8_t id; - bool free; - bool pending; - uint16_t highStamp; - uint16_t lowStamp; - } Channel_t; + #define DBG_LEVEL 1 + #include "Debug.h" - Channel_t virtualChannels[NUM_CHANNELS-1]; - - // Forward declarations - result_t armHwChannel(uint16_t timeStamp, uint8_t channel); - result_t disableHwChannel(uint8_t channel); - result_t programVirtualChannel(uint16_t highStamp, uint16_t lowStamp, uint8_t channel); - void fireVirtualChannel(uint8_t channel); - command error_t Init.init() { // Initialize timer ports in output compare mode with software compare only. @@ -94,7 +83,7 @@ // Not implemented. } - async command void SymbolCounter.reset() + async command void Counter.reset() { // Reset the counter. TPM2CNT = 0; Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourRandomC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourRandomC.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourRandomC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -32,7 +32,7 @@ { provides { - interface Random; + interface Random<uint16_t> as Random; } } implementation Copied: trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h (from rev 1052, trunk/diku/tiny15four/tos/chips/mc13192/endianconv.h) =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h (rev 0) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/endianconv.h 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,79 @@ +/* Copyright (c) 2006, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Network to host (and host to network) conversion. + * The MC9S08GB60 is a big-endian processor. + * + * @author Jan Flora <jan...@di...> + */ + +#ifndef _ENDIANCONV_H_ +#define _ENDIANCONV_H_ + + static inline void NTOUH64(uint8_t *src, uint8_t *dst) + { + dst[0] = src[7]; + dst[1] = src[6]; + dst[2] = src[5]; + dst[3] = src[4]; + dst[4] = src[3]; + dst[5] = src[2]; + dst[6] = src[1]; + dst[7] = src[0]; + } + + static inline void NTOUH32(uint8_t *src, uint8_t *dst) + { + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; + } + + static inline void NTOUH16(uint8_t *src, uint8_t *dst) + { + dst[0] = src[1]; + dst[1] = src[0]; + } + + static inline uint32_t _NTOUH32(uint32_t n) + { + char* base = (char*)&n; + return (uint32_t)base[3] << 24 | + (uint32_t)base[2] << 16 | + (uint32_t)base[1] << 8 | + (uint32_t)base[0]; + } + + static inline uint16_t _NTOUH16(uint16_t n) + { + char* base = (char*)&n; + return (uint16_t)base[1] << 8 | + (uint16_t)base[0]; + } + +#endif Modified: trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc 2009-03-06 00:21:20 UTC (rev 1052) +++ trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -34,12 +34,14 @@ { provides { - interface FastSPI as SPI; + interface FastSPI as Spi; + interface StdControl as SpiControl; } } implementation { components HplSpiP as mcuSPI; - SPI = mcuSPI.SPI; + Spi = mcuSPI.SPI; + SpiControl = mcuSPI.StdControl; } \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/skel/Mcu/DebugC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/skel/Mcu/DebugC.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/skel/Mcu/DebugC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * Debugging interface + * @author Jan Flora <jan...@di...> + */ + +configuration DebugC +{ + provides + { + interface Debug; + interface CommandInterpreter; + } +} +implementation +{ + // Implement me + // NOTE: This module is not strictly needed, but I would advice + // that some kind of debug interface is used. + // An implementation of a debug console over the UART is + // implemented in the following module: + // DebugConsoleC + // The debug console can be found in tos/lib/debug/. It uses + // the SerialByteComm interface to communicate over the UART. + // Your platform should provide you with this interface. + // The command interpreter also provided by the debug console + // can be used to create a command-line style interface for + // executing commands over the UART. This interface is not + // used by the Tiny15four implementation itself, but is made + // available for use in applications. +} \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourRandomC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourRandomC.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourRandomC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +configuration Tiny15FourRandomC +{ + provides + { + interface Random<uint16_t> as Random; + } +} +implementation +{ + // Implement me. + // NOTE: Either use a hardware driven random number generator (if one + // is available) or use one of the software-based pseudo random + // number generators (PRNGs): + // FastLfsrM + // RandomLfsrM + // The PRNGs can be found in tos/lib/tools/ +} \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourTimerC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourTimerC.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/skel/Mcu/Tiny15FourTimerC.nc 2009-03-06 16:57:29 UTC (rev 1053) @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2009, Jan Flora <jan...@di...> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions... [truncated message content] |
From: <qz...@us...> - 2009-03-06 00:21:45
|
Revision: 1052 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1052&view=rev Author: qzban Date: 2009-03-06 00:21:20 +0000 (Fri, 06 Mar 2009) Log Message: ----------- Major changes... Tiny15four is now compatible with the TinyOS 2.0 interfaces (Mainly Init, Boot and the error_t type). The CC2430 driver is working but it still needs to be tested. More work is still needed... Modified Paths: -------------- trunk/diku/tiny15four/apps/p2p_test/ping/Makefile trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc trunk/diku/tiny15four/apps/p2p_test/pong/Makefile trunk/diku/tiny15four/apps/p2p_test/pong/pong.nc trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc trunk/diku/tiny15four/apps/radioTest/RadioTestC.nc trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc trunk/diku/tiny15four/tos/chips/cc2430/DebugC.nc trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/MacTimerP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430InterruptHandlerP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyAttributesP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/csp.h trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/interfaces/IeeeIndication.nc trunk/diku/tiny15four/tos/interfaces/IeeeIndicationResponse.nc trunk/diku/tiny15four/tos/interfaces/IeeeRequest.nc trunk/diku/tiny15four/tos/interfaces/IeeeRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/mac/BeaconGenerator.nc trunk/diku/tiny15four/tos/interfaces/mac/Ed.nc trunk/diku/tiny15four/tos/interfaces/mac/FrameRx.nc trunk/diku/tiny15four/tos/interfaces/mac/PollService.nc trunk/diku/tiny15four/tos/interfaces/mac/ScanService.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeeAclDescriptor.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeeAddress.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeeMacPibAttribute.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeeMacSdu.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeePanDescriptor.nc trunk/diku/tiny15four/tos/interfaces/macApi/McpsDataIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/McpsDataRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/McpsPurgeRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeAssociateIndicationResponse.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeAssociateRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeBeaconNotifyIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeCommStatusIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeDisassociateIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeDisassociateRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeGetRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeGtsIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeGtsRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeOrphanIndicationResponse.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmePollRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeResetRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeRxEnableRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeScanRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeSetRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeStartRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeSyncLossIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeSyncRequest.nc trunk/diku/tiny15four/tos/interfaces/phy/PhyControl.nc trunk/diku/tiny15four/tos/interfaces/tools/MemoryManager.nc trunk/diku/tiny15four/tos/lib/Tiny15FourC.nc trunk/diku/tiny15four/tos/lib/debug/BufferedUartP.nc trunk/diku/tiny15four/tos/lib/debug/Debug.h trunk/diku/tiny15four/tos/lib/debug/DebugConsoleC.nc trunk/diku/tiny15four/tos/lib/mac/AssociateM.nc trunk/diku/tiny15four/tos/lib/mac/CallbackServiceM.nc trunk/diku/tiny15four/tos/lib/mac/CapControlM.nc trunk/diku/tiny15four/tos/lib/mac/CsmaM.nc trunk/diku/tiny15four/tos/lib/mac/DataM.nc trunk/diku/tiny15four/tos/lib/mac/DummyM.nc trunk/diku/tiny15four/tos/lib/mac/EdM.nc trunk/diku/tiny15four/tos/lib/mac/FrameRxM.nc trunk/diku/tiny15four/tos/lib/mac/GetSetM.nc trunk/diku/tiny15four/tos/lib/mac/IndirectTxM.nc trunk/diku/tiny15four/tos/lib/mac/MacPibDatabaseM.nc trunk/diku/tiny15four/tos/lib/mac/OrphanHandlerM.nc trunk/diku/tiny15four/tos/lib/mac/PollM.nc trunk/diku/tiny15four/tos/lib/mac/PollServiceM.nc trunk/diku/tiny15four/tos/lib/mac/RxEnableM.nc trunk/diku/tiny15four/tos/lib/mac/ScanM.nc trunk/diku/tiny15four/tos/lib/mac/ScanServiceM.nc trunk/diku/tiny15four/tos/lib/mac/TimingServiceM.nc trunk/diku/tiny15four/tos/lib/mac/Tiny15FourMacC.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/AddressM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/McpsDataIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/McpsDataRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/McpsPurgeRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeAssociateIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeAssociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeBeaconNotifyIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeCommStatusIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeDisassociateIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeDisassociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeGetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeGtsIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeGtsRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeOrphanIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmePollRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeResetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeRxEnableRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeScanRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeSetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeStartRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeSyncLossIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeSyncRequestM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/PanDescriptorM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/PibAttributeM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/SduM.nc trunk/diku/tiny15four/tos/lib/tools/SimpleBufferManM.nc trunk/diku/tiny15four/tos/platforms/nano/CC2430ClockConfig.h Added Paths: ----------- trunk/diku/tiny15four/apps/macTest/ trunk/diku/tiny15four/apps/macTest/MacTestC.nc trunk/diku/tiny15four/apps/macTest/MacTestP.nc trunk/diku/tiny15four/apps/macTest/Makefile trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourRandomC.nc trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyControlP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc trunk/diku/tiny15four/tos/chips/mc13192/endianconv.h trunk/diku/tiny15four/tos/interfaces/debug/CommandInterpreter.nc trunk/diku/tiny15four/tos/lib/debug/CommandInterpreterC.nc trunk/diku/tiny15four/tos/lib/debug/CommandInterpreterP.nc Removed Paths: ------------- trunk/diku/tiny15four/tos/lib/tools/endianconv.h Property Changed: ---------------- trunk/diku/tiny15four/apps/p2p_test/pong/ trunk/diku/tiny15four/apps/radioTest/ Added: trunk/diku/tiny15four/apps/macTest/MacTestC.nc =================================================================== --- trunk/diku/tiny15four/apps/macTest/MacTestC.nc (rev 0) +++ trunk/diku/tiny15four/apps/macTest/MacTestC.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -0,0 +1,49 @@ +/* Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +configuration MacTestC +{ +} +implementation +{ + components MainC, + DebugC, + Tiny15FourC, + MacTestP; + + MacTestP.Boot -> MainC.Boot; + MacTestP.Debug -> DebugC.Debug; + MacTestP.CommandInterpreter -> DebugC.CommandInterpreter; + + MacTestP.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + MacTestP.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; + + MainC.SoftwareInit -> MacTestP.Init; +} \ No newline at end of file Added: trunk/diku/tiny15four/apps/macTest/MacTestP.nc =================================================================== --- trunk/diku/tiny15four/apps/macTest/MacTestP.nc (rev 0) +++ trunk/diku/tiny15four/apps/macTest/MacTestP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -0,0 +1,90 @@ +/* Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +module MacTestP +{ + provides + { + interface Init; + } + uses + { + // Tiny15four + interface IeeeIndication<Mcps_DataIndication> as McpsIndicationData; + interface IeeeRequestConfirm<Mcps_DataRequestConfirm> as McpsRequestConfirmData; + + interface Boot; + interface Debug; + interface CommandInterpreter; + } +} +implementation +{ + #define DBG_LEVEL 1 + #include "Debug.h" + + command error_t Init.init() + { + /* uint32_t i = 0; + + call CommandInterpreter.addCommand("status", printRFStatus); + call CommandInterpreter.addCommand("fsm", printFSMState); + call CommandInterpreter.addCommand("fifo", printRXFifoCnt); + call CommandInterpreter.addCommand("vrstate", printVRState); + call CommandInterpreter.addCommand("tx", transmit); + call CommandInterpreter.addCommand("rx", toggleReceiver); + call CommandInterpreter.addCommand("t2conf", printT2Config); + + // Wait so we get to see all output. + while (i<1000000) i++; + + DBG_STR("Init...",1);*/ + } + + event void Boot.booted() + { + uint32_t i = 0; + + // Wait so we get to see all output. + while (i<1000000) i++; + + DBG_STR("Booted...",1); + } + + event void McpsIndicationData.indication( Mcps_DataIndication indication ) + { + DBG_STR("Data indication...",1); + } + + event void McpsRequestConfirmData.confirm( Mcps_DataRequestConfirm confirm ) + { + DBG_STR("Data confirm...",1); + } +} \ No newline at end of file Added: trunk/diku/tiny15four/apps/macTest/Makefile =================================================================== --- trunk/diku/tiny15four/apps/macTest/Makefile (rev 0) +++ trunk/diku/tiny15four/apps/macTest/Makefile 2009-03-06 00:21:20 UTC (rev 1052) @@ -0,0 +1,2 @@ +COMPONENT=MacTestC +include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/p2p_test/ping/Makefile =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/ping/Makefile 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/p2p_test/ping/Makefile 2009-03-06 00:21:20 UTC (rev 1052) @@ -1,4 +1,4 @@ COMPONENT=ping ENVIRONMENT=RFDNBNS -include ../../Makerules +include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -24,48 +24,51 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ -#define DBG_OFF 1 +/** + * @author Jan Flora <jan...@di...> + */ +#define DBG_OFF 0 + configuration ping { } implementation { - components Main, - pingM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pingM; - // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pingM.StdControl; - - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pingM.Debug -> ConsoleDebugM.Debug; + // Wire init. + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pingM.Init; + + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pingM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pingM.Debug -> DebugC.Debug; + pingM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pingM.IeeePanDescriptor -> Ieee802154C; - pingM.IeeePibAttribute -> Ieee802154C; - pingM.IeeeSdu -> Ieee802154C; - pingM.IeeeAddress -> Ieee802154C; + pingM.IeeePanDescriptor -> Tiny15FourC; + pingM.IeeePibAttribute -> Tiny15FourC; + pingM.IeeeSdu -> Tiny15FourC; + pingM.IeeeAddress -> Tiny15FourC; // MCPS - pingM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pingM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pingM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pingM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pingM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pingM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pingM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pingM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pingM.MlmeRequestConfirmRxEnable -> Ieee802154C.MlmeRequestConfirmRxEnable; + pingM.MlmeRequestConfirmRxEnable -> Tiny15FourC.MlmeRequestConfirmRxEnable; - pingM.MlmeRxEnableRequestConfirm -> Ieee802154C.MlmeRxEnableRequestConfirm; + pingM.MlmeRxEnableRequestConfirm -> Tiny15FourC.MlmeRxEnableRequestConfirm; } Modified: trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -24,22 +24,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pingM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeePanDescriptor; interface IeeeMacSdu as IeeeSdu; @@ -57,13 +55,14 @@ // MLME interface IeeeRequestConfirm<Mlme_RxEnableRequestConfirm> as MlmeRequestConfirmRxEnable; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - #define PROFILING - //#define DBG_OFF 0 + //#define PROFILING #define DBG_LEVEL 1 #include "Debug.h" @@ -89,13 +88,13 @@ uint8_t rxEnableType = 0; // Forward declarations of helper functions. - task void doPing(); task void rxOn(); task void rxOff(); - void processScan(Mlme_ScanRequestConfirm scanconfirm); + + void doPing(); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -121,21 +120,16 @@ TOSH_CLR_PROFILING9_PIN(); #endif + call CommandInterpreter.addCommand("ping", doPing); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x1D, 0x00, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post doPing(); - return SUCCESS; } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -191,7 +185,7 @@ #endif } - task void doPing() + void doPing() { Ieee_Address srcAddr; Ieee_Address dstAddr; Property changes on: trunk/diku/tiny15four/apps/p2p_test/pong ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/p2p_test/pong/Makefile =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/pong/Makefile 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/p2p_test/pong/Makefile 2009-03-06 00:21:20 UTC (rev 1052) @@ -1,4 +1,4 @@ COMPONENT=pong ENVIRONMENT=RFDNBNS -include ../../Makerules +include $(MAKERULES) Modified: trunk/diku/tiny15four/apps/p2p_test/pong/pong.nc =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/pong/pong.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/p2p_test/pong/pong.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -24,47 +24,50 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ -#define DBG_OFF 1 +/** + * @author Jan Flora <jan...@di...> + */ +#define DBG_OFF 0 + configuration pong { } implementation { - components Main, - pongM, - Ieee802154C, - ConsoleDebugM, - ConsoleC; + components MainC, + DebugC, + Tiny15FourC, + pongM; - // Wire standard control - Main.StdControl -> Ieee802154C.StdControl; - Main.StdControl -> ConsoleC.StdControl; - Main.StdControl -> pongM.StdControl; - - // Connect debug. - ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; - Ieee802154C.Debug -> ConsoleDebugM.Debug; - pongM.Debug -> ConsoleDebugM.Debug; + // Wire init. + MainC.SoftwareInit -> Tiny15FourC.Init; + MainC.SoftwareInit -> pongM.Init; + + // Wire boot. + Tiny15FourC.Boot -> MainC.Boot; + pongM.Boot -> MainC.Boot; + + // Wire debug. + Tiny15FourC.Debug -> DebugC.Debug; + pongM.Debug -> DebugC.Debug; + pongM.CommandInterpreter -> DebugC.CommandInterpreter; // Wire interface - pongM.IeeePibAttribute -> Ieee802154C; - pongM.IeeeSdu -> Ieee802154C; - pongM.IeeeAddress -> Ieee802154C; + pongM.IeeePibAttribute -> Tiny15FourC; + pongM.IeeeSdu -> Tiny15FourC; + pongM.IeeeAddress -> Tiny15FourC; // MCPS - pongM.McpsIndicationData -> Ieee802154C.McpsIndicationData; - pongM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + pongM.McpsIndicationData -> Tiny15FourC.McpsIndicationData; + pongM.McpsRequestConfirmData -> Tiny15FourC.McpsRequestConfirmData; - pongM.McpsDataIndication -> Ieee802154C.McpsDataIndication; - pongM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + pongM.McpsDataIndication -> Tiny15FourC.McpsDataIndication; + pongM.McpsDataRequestConfirm -> Tiny15FourC.McpsDataRequestConfirm; // MLME - pongM.MlmeRequestConfirmRxEnable -> Ieee802154C.MlmeRequestConfirmRxEnable; + pongM.MlmeRequestConfirmRxEnable -> Tiny15FourC.MlmeRequestConfirmRxEnable; - pongM.MlmeRxEnableRequestConfirm -> Ieee802154C.MlmeRxEnableRequestConfirm; + pongM.MlmeRxEnableRequestConfirm -> Tiny15FourC.MlmeRxEnableRequestConfirm; } Modified: trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc =================================================================== --- trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -24,22 +24,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - @author Jan Flora <jan...@di...> -*/ +/** + * @author Jan Flora <jan...@di...> + */ -#include <macTypes.h> -#include <macConstants.h> -#include <Int64Compare.h> - module pongM { provides { - interface StdControl; + interface Init; } uses { + interface Boot; + interface IeeeMacPibAttribute as IeeePibAttribute; interface IeeePanDescriptor; interface IeeeMacSdu as IeeeSdu; @@ -57,12 +55,13 @@ // MLME interface IeeeRequestConfirm<Mlme_RxEnableRequestConfirm> as MlmeRequestConfirmRxEnable; + // Debugging + interface CommandInterpreter; interface Debug; } } implementation { - //#define DBG_OFF 0 #define DBG_LEVEL 1 #include "Debug.h" @@ -90,11 +89,11 @@ // Forward declarations of helper functions. task void pingReply(); - task void rxOn(); task void rxOff(); + void rxOn(); int strcmp(const char * a, const char * b); - command result_t StdControl.init() + command error_t Init.init() { #ifdef PROFILING // Setup profiling pins as output pins. @@ -121,21 +120,17 @@ #endif call IeeeAddress.create(&pingReplyAddr); + + call CommandInterpreter.addCommand("listen", rxOn); + return SUCCESS; } - command result_t StdControl.start() + event void Boot.booted() { uint8_t myAddr[8] = {0x61, 0x03, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; memcpy(aExtendedAddress, myAddr, 8); - post rxOn(); - return SUCCESS; } - - command result_t StdControl.stop() - { - return FAIL; - } /******************************* Data handling @@ -265,7 +260,7 @@ #endif } - task void rxOn() + void rxOn() { Mlme_RxEnableRequestConfirm request; Property changes on: trunk/diku/tiny15four/apps/radioTest ___________________________________________________________________ Added: svn:ignore + build Modified: trunk/diku/tiny15four/apps/radioTest/RadioTestC.nc =================================================================== --- trunk/diku/tiny15four/apps/radioTest/RadioTestC.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/radioTest/RadioTestC.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -41,6 +41,7 @@ RadioTestP.Boot -> MainC.Boot; RadioTestP.Debug -> DebugC.Debug; + RadioTestP.CommandInterpreter -> DebugC.CommandInterpreter; RadioTestP.PhyReceive -> Tiny15FourPhyC.PhyReceive; RadioTestP.PhyTransmit -> Tiny15FourPhyC.PhyTransmit; Modified: trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc =================================================================== --- trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -40,6 +40,7 @@ interface Debug; interface PhyReceive; interface PhyTransmit; + interface CommandInterpreter; } } implementation @@ -49,18 +50,33 @@ uint8_t frameBuf[128]; txdata_t txData; - char *payload = "test123"; + char *payload = "abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrst"; - bool receiver = FALSE; + bool receiverOn = FALSE; // Forward declaration. - task void transmit(); - task void receive(); + void printRFStatus(); + void printFSMState(); + void printRXFifoCnt(); + void printVRState(); + void printT2Config(); + void transmit(); + void toggleReceiver(); + task void dummyTask(){} + command error_t Init.init() { uint32_t i = 0; + call CommandInterpreter.addCommand("status", printRFStatus); + call CommandInterpreter.addCommand("fsm", printFSMState); + call CommandInterpreter.addCommand("fifo", printRXFifoCnt); + call CommandInterpreter.addCommand("vrstate", printVRState); + call CommandInterpreter.addCommand("tx", transmit); + call CommandInterpreter.addCommand("rx", toggleReceiver); + call CommandInterpreter.addCommand("t2conf", printT2Config); + // Wait so we get to see all output. while (i<1000000) i++; @@ -75,39 +91,35 @@ while (i<1000000) i++; DBG_STR("Booted...",1); + + // Prepare transmit. + txData.txId = 1; + txData.frame = payload; + txData.length = 10; + txData.cca = TRUE; + txData.immediateCommence = TRUE; + txData.commenceTime = 0; + + // Prepare receiver. + call PhyReceive.initRxBuffer(frameBuf); + } - if (receiver) { - // Receiver. - call PhyReceive.initRxBuffer(frameBuf); - post receive(); + void toggleReceiver() + { + if (receiverOn) { + DBG_STR("Turning off the receiver...",1); + call PhyReceive.rxOff(); + receiverOn = FALSE; } else { - // Transmit. - txData.txId = 1; - txData.frame = payload; - txData.length = 7; - txData.cca = FALSE; - txData.immediateCommence = TRUE; - txData.commenceTime = 0; - post transmit(); + DBG_STR("Turning on the receiver...",1); + call PhyReceive.rxOn(0, TRUE); + receiverOn = TRUE; } } - task void receive() - { - call PhyReceive.rxOn(0, TRUE); - } - - task void transmit() - { - DBG_STR("Transmitting...",1); - call PhyTransmit.tx(&txData); - DBG_STR("After transmit...",1); - } - async event void PhyTransmit.txDone(phy_error_t error, uint8_t txId) { DBG_STR("Transmission done...",1); - post transmit(); } async event uint8_t *PhyReceive.dataReady(rxdata_t *data) @@ -116,4 +128,47 @@ DBG_DUMP(data->frame, data->length,1); return data->frame; } + + void printRFStatus() + { + DBG_STRINT("RFStatus register: ",_CC2430_RFSTATUS,1); + call CommandInterpreter.prompt(); + } + + void printFSMState() + { + DBG_STRINT("FSM state is: ",_CC2430_FSMSTATE,1); + call CommandInterpreter.prompt(); + } + + void printRXFifoCnt() + { + DBG_STRINT("RXFIFO count is: ",_CC2430_RXFIFOCNT,1); + call CommandInterpreter.prompt(); + } + + void printVRState() + { + + if (_CC2430_RFPWR & _BV(CC2430_RFPWR_RREG_RADIO_PD)) { + DBG_STR("Voltage regulators are powered OFF",1); + } else { + DBG_STR("Voltage regulators are powered ON",1); + } + call CommandInterpreter.prompt(); + } + + void printT2Config() + { + uint8_t test = T2CNF; + DBG_STRINT("Timer2 config is: ",test,1); + call CommandInterpreter.prompt(); + } + + void transmit() + { + DBG_STR("Transmitting...",1); + call PhyTransmit.tx(&txData); + call CommandInterpreter.prompt(); + } } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/cc2430/DebugC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/DebugC.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/DebugC.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -31,7 +31,11 @@ configuration DebugC { - provides interface Debug; + provides + { + interface Debug; + interface CommandInterpreter; + } } implementation { @@ -40,4 +44,5 @@ DebugConsoleC.SerialByteComm -> UartC.SerialByteComm; Debug = DebugConsoleC.Debug; + CommandInterpreter = DebugConsoleC.CommandInterpreter; } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourPhyC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourPhyC.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourPhyC.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -30,6 +30,9 @@ #include "PhyAttributes.h" #include "time.h" +#include "csp.h" +#include "radioStates.h" +#include "dma.h" configuration Tiny15FourPhyC { @@ -40,8 +43,8 @@ interface PhyTransmit; interface PhyEnergyDetect; interface PhyAttributes; - //interface PhyControl; - //interface PhyReset; + interface PhyControl; + interface PhyReset; } uses { @@ -57,15 +60,26 @@ cc2430PhyAttributesP, cc2430PhyReceiveP, cc2430PhyTransmitP, + cc2430PhyControlP, + cc2430PhyInitP, MacTimerP, - new FIFOQueueM(txdata_t*) as TxQueue; + new FIFOQueueM(txdata_t*) as TxQueue, + new DmaC() as DmaSend, + new DmaC() as DmaRecv; + // Phy init + Init = cc2430PhyInitP.Init; + PhyReset = cc2430PhyInitP.PhyReset; + cc2430PhyInitP.Debug = Debug; + // Interrupt handler Init = cc2430InterruptHandlerP.Init; + PhyReset = cc2430InterruptHandlerP.PhyReset; cc2430InterruptHandlerP.Debug = Debug; // CSP handler Init = cc2430CspHandlerP.Init; + PhyReset = cc2430CspHandlerP.PhyReset; cc2430CspHandlerP.CspInterrupt -> cc2430InterruptHandlerP.CspInterrupt; cc2430CspHandlerP.LocalTime = LocalTime; cc2430CspHandlerP.Debug = Debug; @@ -77,14 +91,17 @@ // Receive. PhyReceive = cc2430PhyReceiveP.PhyReceive; + PhyReset = cc2430PhyReceiveP.PhyReset; Init = cc2430PhyReceiveP.Init; cc2430PhyReceiveP.RxInterrupt -> cc2430InterruptHandlerP.RxInterrupt; cc2430PhyReceiveP.CspReceive -> cc2430CspHandlerP.Receive; cc2430PhyReceiveP.MCUTime = LocalTime; cc2430PhyReceiveP.Debug = Debug; + cc2430PhyReceiveP.Dma -> DmaRecv; // Transmit. PhyTransmit = cc2430PhyTransmitP.PhyTransmit; + PhyReset = cc2430PhyTransmitP.PhyReset; Init = cc2430PhyTransmitP.Init; cc2430PhyTransmitP.TxInterrupt -> cc2430InterruptHandlerP.TxInterrupt; cc2430PhyTransmitP.CspTransmit -> cc2430CspHandlerP.Transmit; @@ -92,10 +109,17 @@ cc2430PhyTransmitP.OverflowCounter -> MacTimerP.OverflowCounter; cc2430PhyTransmitP.OverflowChannel -> MacTimerP.OverflowChannel; Init = MacTimerP.Init; + MacTimerP.Debug = Debug; cc2430PhyTransmitP.TxQueue -> TxQueue.FIFOQueue; cc2430PhyTransmitP.Debug = Debug; TxQueue.Debug = Debug; + cc2430PhyTransmitP.Dma -> DmaSend; // Phy attributes. PhyAttributes = cc2430PhyAttributesP.PhyAttributes; + PhyReset = cc2430PhyAttributesP.PhyReset; + + // Phy control. + PhyControl = cc2430PhyControlP.PhyControl; + cc2430PhyControlP.Debug = Debug; } \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourRandomC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourRandomC.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourRandomC.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -0,0 +1,43 @@ +/* Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +configuration Tiny15FourRandomC +{ + provides + { + interface Random<uint16_t> as Random; + } +} +implementation +{ + components FastLfsrM as RandomGen; + + Random = RandomGen.Random; +} \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h (rev 0) +++ trunk/diku/tiny15four/tos/chips/cc2430/endianconv.h 2009-03-06 00:21:20 UTC (rev 1052) @@ -0,0 +1,76 @@ +/* Copyright (c) 2006, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/* + @author Jan Flora <jan...@di...> +*/ + +#ifndef _ENDIANCONV_H_ +#define _ENDIANCONV_H_ + + static inline void NTOUH64(uint8_t *src, uint8_t *dst) + { + dst[0] = src[7]; + dst[1] = src[6]; + dst[2] = src[5]; + dst[3] = src[4]; + dst[4] = src[3]; + dst[5] = src[2]; + dst[6] = src[1]; + dst[7] = src[0]; + } + + static inline void NTOUH32(uint8_t *src, uint8_t *dst) + { + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; + } + + static inline void NTOUH16(uint8_t *src, uint8_t *dst) + { + dst[0] = src[1]; + dst[1] = src[0]; + } + + static inline uint32_t _NTOUH32(uint32_t n) + { + char* base = (char*)&n; + return (uint32_t)base[3] << 24 | + (uint32_t)base[2] << 16 | + (uint32_t)base[1] << 8 | + (uint32_t)base[0]; + } + + static inline uint16_t _NTOUH16(uint16_t n) + { + char* base = (char*)&n; + return (uint16_t)base[1] << 8 | + (uint16_t)base[0]; + } + +#endif Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/MacTimerP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/MacTimerP.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/MacTimerP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -28,7 +28,7 @@ * @author Jan Flora <jan...@di...> */ -#include "CC2430ClockConfig.h" +#include "CC2430Timer.h" #include "MacTimer.h" module MacTimerP @@ -41,11 +41,23 @@ interface SymbolCounter<uint32_t> as OverflowCounter; interface SymbolChannel<uint32_t> as OverflowChannel; } + uses + { + interface Debug; + } } implementation { + #define DBG_LEVEL 1 + #include "Debug.h" + command error_t Init.init() { + uint8_t t2conf; + + t2conf = T2CNF; + DBG_STRINT("Timer 2 config is: ",t2conf,1); + // Make sure the timer is stopped. T2CNF &= ~_BV(CC2430_T2CNF_RUN); @@ -71,15 +83,18 @@ T2PEROF2 |= _BV(CC2430_T2PEROF2_PERIM); } + // Enable timer 2 interrupts. + T2IE = 1; + // Disable synchronization. - T2CNF |= ~_BV(CC2430_T2CNF_SYNC); + T2CNF &= ~_BV(CC2430_T2CNF_SYNC); // Start the mac timer T2CNF |= _BV(CC2430_T2CNF_RUN); + + t2conf = T2PEROF2; + DBG_STRINT("Timer 2 PEROF2 is: ",t2conf,1); - // Enable timer 2 interrupts. - T2IE = 1; - return SUCCESS; } Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -37,6 +37,7 @@ provides { interface Init; + interface PhyReset; interface cc2430CspEnergyDetect as EnergyDetect; interface cc2430CspTransmit as Transmit; interface cc2430CspReceive as Receive; @@ -54,9 +55,6 @@ #define DBG_LEVEL 1 #include "Debug.h" - #include "csp.h" - #include "radioStates.h" - uint8_t contentionWindow = 1; uint8_t operation; #define CSP_OP_ED 1 @@ -72,6 +70,11 @@ RFIM |= _BV(CC2430_RFIM_CSP_INT); } + command void PhyReset.reset() + { + // TODO: Implement me. + } + command void EnergyDetect.performEnergyDetect() { operation = CSP_OP_ED; @@ -121,6 +124,7 @@ // Clear CSP program memory. _CC2430_CSPX = 0x0; + _CC2430_CSPZ = 0x0; _CC2430_CSPT = 0xFF; RFST = ISSTOP; @@ -134,7 +138,7 @@ { // Load contention window size into CSPY. _CC2430_CSPY = phyContentionWindow; - _CC2430_CSPZ = 1; + _CC2430_CSPZ = 0x1; // Put the radio in receive state // TODO: Is it necessary to go into idle state first? @@ -166,7 +170,7 @@ command void Transmit.startDeferredTx(uint32_t timestamp) { // Tell the MCU that it is time to write the frame to the TXFIFO. - RFST = INT; + //RFST = INT; // Start the transmission process. This takes 12 symbol periods. RFST = STXON; @@ -187,7 +191,7 @@ command void Transmit.startTx() { // Tell the MCU that it is time to write the frame to the TXFIFO. - RFST = INT; + //RFST = INT; // Start the transmission process. This takes 12 symbol periods. RFST = STXON; RFST = ISSTART; @@ -249,14 +253,18 @@ async event void CspInterrupt.interrupted() { - //DBG_STR("Interrupted!",1); - //DBG_STRINT("Operation is: ",operation,1); + //uint32_t before, after; // Fast return if no operation was selected. if (!operation) return; switch(operation) { case CSP_OP_TX: + //before = call LocalTime.getTime(); + // Worst case, this write takes 52 symbol periods. signal Transmit.writeFrame(); + //after = call LocalTime.getTime(); + //DBG_STRINT("Time before write: ",before,1); + //DBG_STRINT("Time after write: ",after,1); break; } } Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430InterruptHandlerP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430InterruptHandlerP.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430InterruptHandlerP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -24,7 +24,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/** * @author Jan Flora <jan...@di...> */ @@ -33,6 +33,7 @@ provides { interface Init; + interface PhyReset; interface cc2430CspInterrupt as CspInterrupt; interface cc2430RxInterrupt as RxInterrupt; interface cc2430TxInterrupt as TxInterrupt; @@ -62,11 +63,20 @@ return SUCCESS; } + command void PhyReset.reset() + { + // TODO: Implement me. + } + MCS51_INTERRUPT(SIG_RFERR) { DBG_STR("Radio error interrupt.",1); // Clear interrupt flag. RFERRIF = 0; + // Flush the FIFO. + RFST = ISFLUSHRX; + RFST = ISFLUSHTX; + } MCS51_INTERRUPT(SIG_RF) Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyAttributesP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyAttributesP.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyAttributesP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -35,6 +35,7 @@ provides { interface PhyAttributes; + interface PhyReset; } } implementation @@ -42,6 +43,19 @@ // Phy attribute variables. norace bool (*myFilter)(uint8_t*) = NULL; + command void PhyReset.reset() + { + // Reset attributes and filter. + phyCurChannel = 11; + phySupportedChannels = 0x07FFF800; + phyContentionWindow = 1; + phyTransmitPower = 0; + myFilter = NULL; + + // Reset channel selection. + call PhyAttributes.setChannel(phyCurChannel); + } + async command error_t PhyAttributes.setChannel(uint8_t logicalChannel) { uint16_t freq; Added: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyControlP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyControlP.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyControlP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -0,0 +1,57 @@ +/* Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +module cc2430PhyControlP +{ + provides + { + interface PhyControl; + } + uses + { + interface Debug; + } +} +implementation +{ + #define DBG_LEVEL 1 + #include "Debug.h" + + async command phy_error_t PhyControl.trxOff(bool force) + { + DBG_STR("cc2430: PhyControl.trxOff not implemented...",1); + return PHY_SUCCESS; + } + + command void PhyControl.sleep(uint32_t wakeUpTime) + { + DBG_STR("cc2430: PhyControl.sleep not implemented...",1); + } +} \ No newline at end of file Added: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc (rev 0) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyInitP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -0,0 +1,94 @@ +/* Copyright (c) 2009, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +module cc2430PhyInitP +{ + provides + { + interface Init; + interface PhyReset; + } + uses + { + interface Debug; + } +} +implementation +{ + #define DBG_LEVEL 1 + #include "Debug.h" + + void setupRF(); + + command error_t Init.init() + { + // Clear voltage regulator status flag. + RFIF &= ~_BV(CC2430_RFIF_RREG_ON); + + // Power cycle voltage regulator + _CC2430_RFPWR |= _BV(CC2430_RFPWR_RREG_RADIO_PD); + _CC2430_RFPWR &= ~_BV(CC2430_RFPWR_RREG_RADIO_PD); + + // RFPWR contains the register ADI_RADIO_PD as a delayed version + // The manual however waits for the IF + while ( RFIF & _BV(CC2430_RFIF_RREG_ON) ); + + // Power up external osc + SLEEP &= ~_BV(CC2430_SLEEP_OSC_PD); + // Select clock source = ext osc + CLKCON &= ~_BV(CC2430_CLKCON_CLKSPD); + + // Wait for XOSC powered up and stable + while (!(SLEEP & _BV(CC2430_SLEEP_XOSC_STB))); + + setupRF(); + } + + command void PhyReset.reset() + { + // Reconfigure the radio. + setupRF(); + } + + void setupRF() + { + // disable address recognition + _CC2430_MDMCTRL0H &= ~_BV(CC2430_MDMCTRL0H_ADDR_DECODE); + + // Enable auto-crc + _CC2430_MDMCTRL0L |= _BV(CC2430_MDMCTRL0L_AUTOCRC); + + // Enable auto-ack + _CC2430_MDMCTRL0L |= _BV(CC2430_MDMCTRL0L_AUTOACK); + + // Set FIFOP threshold to max (0x7F) + _CC2430_IOCFG0 = 0x7F; + } +} \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -36,6 +36,7 @@ { interface Init; interface PhyReceive; + interface PhyReset; interface cc2430AckControl as AckControl; } uses @@ -44,6 +45,7 @@ interface cc2430CspReceive as CspReceive; interface LocalTime<time_t> as MCUTime; interface Debug; + interface Dma; } } implementation @@ -52,18 +54,42 @@ #include "Debug.h" rxdata_t rxPacket; - uint8_t *frameBuffer; uint32_t rxTime; + dma_config_t * dmaConfigRecv; + bool readLen = FALSE; + // Forward declarations. + void dmaReadFrameLength(); + void dmaReadFrame(); + void processFrame(uint8_t lqi); + command error_t Init.init() { // Enable required interrupts. - RFIM |= _BV(CC2430_RFIM_FIFOP); + //RFIM |= _BV(CC2430_RFIM_FIFOP); RFIM |= _BV(CC2430_RFIM_SFD); + // setup DMA for reception + dmaConfigRecv = call Dma.getConfig(); + + dmaConfigRecv->SRCADDR = (uint16_t) 0xDFD9; + dmaConfigRecv->VLEN = VLEN_USE_LEN; + dmaConfigRecv->IRQMASK = TRUE; + dmaConfigRecv->DESTINC = DESTINC_1; + dmaConfigRecv->SRCINC = SRCINC_0; + dmaConfigRecv->TRIG = DMATRIG_RADIO; + dmaConfigRecv->WORDSIZE = WORDSIZE_BYTE; + dmaConfigRecv->TMODE = TMODE_SINGLE; + dmaConfigRecv->PRIORITY = PRI_ABSOLUTE; + return SUCCESS; } + command void PhyReset.reset() + { + // TODO: Implement me. + } + command void PhyReceive.initRxBuffer(uint8_t *packetBuf) { // Initialize the internal PHY frame buffer. @@ -71,7 +97,7 @@ } async command phy_error_t PhyReceive.rxOn(uint32_t commenceTime, bool immediateCommence) - { + { if (immediateCommence) { // Turn on the receiver immmediately. RFST = ISRXON; @@ -83,36 +109,93 @@ async command void PhyReceive.rxOff() { + call Dma.disarmChannel(); RFST = ISRFOFF; } async event void RxInterrupt.dataReady() { - // Read data from the radio buffer. - uint8_t i,lqi,rssi; - bool crc; - uint32_t myMcuTime; - uint8_t *frame = rxPacket.frame; - rxPacket.length = RFD; - rxPacket.length -= 2; - for (i=0; i<rxPacket.length; i++) { - *frame++ = RFD; + } + + async event void RxInterrupt.frameDetected() + { + // A new frame reception begun. + if (!_CC2430_RXFIFOCNT) { + // FIFO Queue is empty. + // Setup a DMA transfer to read the frame length. + dmaReadFrameLength(); } - rssi = RFD; - lqi = RFD; - crc = lqi & 0x80; + // A new frame reception has begun. Record the rx timestamp for later use. + ((uint8_t*)&rxTime)[3] = T2PEROF0; + ((uint8_t*)&rxTime)[2] = T2PEROF1; + ((uint8_t*)&rxTime)[1] = T2PEROF2 & 0x0F; + ((uint8_t*)&rxTime)[1] = 0; + } + + async event void Dma.transferDone() + { + uint8_t lqi,rssi; + bool wasReadLen, crc; - if (!crc) return; + atomic { + wasReadLen = readLen; + readLen = FALSE; + } + if (wasReadLen) { + // Adjust length field. We don't want rssi & lqi in the frame. + rxPacket.length -= 2; + // Frame length was read. Now program the DMA transfer to + // read the frame. + dmaReadFrame(); + } else { + // Frame was read. Read out the correlation value. + rssi = rxPacket.frame[rxPacket.length]; + lqi = rxPacket.frame[rxPacket.length+1]; + crc = lqi & 0x80; + + if (crc) { + processFrame(lqi & 0x7F); + } else { + DBG_STR("CRC failed",1); + DBG_DUMP(rxPacket.frame, rxPacket.length,1); + } + + // Setup a DMA transfer to read the next frame length. + dmaReadFrameLength(); + } + } + + void dmaReadFrameLength() + { + dmaConfigRecv->DESTADDR = (uint32_t) &(rxPacket.length); + dmaConfigRecv->LEN = 1; + + atomic readLen = TRUE; + call Dma.armChannel(); + } + + void dmaReadFrame() + { + dmaConfigRecv->DESTADDR = (uint32_t) rxPacket.frame; + dmaConfigRecv->LEN = rxPacket.length+2; + + call Dma.armChannel(); + } + + void processFrame(uint8_t lqi) + { + uint32_t myMcuTime; + if (rxPacket.length == 3) { // We have an ACK frame. signal AckControl.AckReceived(rxPacket.frame[2]); } else { // Fill rxPacket data. rxPacket.recvTime = rxTime; - + // Extend the rx timestamp. (Radio time is 20 bits, MCU is 32 bits). myMcuTime = call MCUTime.getTime(); rxPacket.recvTime += (myMcuTime & 0xFFF00000); @@ -123,18 +206,9 @@ } // Use correlation value to calculate link quality. - rxPacket.linkQuality = lqi & 0x7F; + rxPacket.linkQuality = lqi; rxPacket.frame = signal PhyReceive.dataReady(&rxPacket); } } - - async event void RxInterrupt.frameDetected() - { - // A new frame reception has begun. Record the rx timestamp for later use. - ((uint8_t*)&rxTime)[3] = T2PEROF0; - ((uint8_t*)&rxTime)[2] = T2PEROF1; - ((uint8_t*)&rxTime)[1] = T2PEROF2 & 0x0F; - ((uint8_t*)&rxTime)[1] = 0; - } } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -34,6 +34,7 @@ { interface Init; interface PhyTransmit; + interface PhyReset; } uses { @@ -44,6 +45,7 @@ interface SymbolChannel<uint32_t> as OverflowChannel; interface cc2430AckControl as AckControl; interface Debug; + interface Dma; } } implementation @@ -54,6 +56,9 @@ uint8_t *txQueueBuf[2]; FIFOQueue_t txQueue; bool waitingForAck = FALSE; + dma_config_t * dmaConfigSend; + bool dmaDeferred = FALSE; + uint8_t dmaLength = 0; command error_t Init.init() { @@ -62,11 +67,52 @@ // Prepare transmission queue. call TxQueue.initQueue(&txQueue, txQueueBuf, 2); + + /* setup DMA for send */ + dmaConfigSend = call Dma.getConfig(); + + dmaConfigSend->DESTADDR = (uint16_t) 0xDFD9; + dmaConfigSend->LEN = 127; + dmaConfigSend->VLEN = VLEN_USE_LEN; + dmaConfigSend->IRQMASK = TRUE; + dmaConfigSend->DESTINC = DESTINC_0; + dmaConfigSend->SRCINC = SRCINC_1; + dmaConfigSend->TRIG = DMATRIG_NONE; + dmaConfigSend->WORDSIZE = WORDSIZE_BYTE; + dmaConfigSend->TMODE = TMODE_BLOCK_REPEATED; + dmaConfigSend->PRIORITY = PRI_ABSOLUTE; + return SUCCESS; } + command void PhyReset.reset() + { + // TODO: Implement me. + } + async command phy_error_t PhyTransmit.tx(txdata_t *data) { + // Configure DMA transfer. + dmaConfigSend->SRCADDR = (uint32_t) data->frame; + dmaConfigSend->LEN = data->length; + call Dma.armChannel(); + + if (_CC2430_RFSTATUS & _BV(CC2430_RFSTATUS_TX_ACTIVE)) { + // We have an ongoing transmit operation. Defer the + // DMA transfer until the ongoing transmit has ended. + atomic { + dmaDeferred = TRUE; + dmaLength = data->length; + } + } else { + // TXFIFO is free. Initiate DMA transfer immediately. + // Transfer length field to the FIFO buffer. + RFD = (data->length+2); + + // Initiate the DMA transfer. + call Dma.startTransfer(); + } + call TxQueue.enqueue(&txQueue, data); call CspTransmit.initTx(); if (data->cca) { @@ -83,14 +129,31 @@ async event void TxInterrupt.txDone() { txdata_t *data; - bool ack; + bool ack, dmaTransfer; + uint8_t len = 0; + + atomic { + dmaTransfer = dmaDeferred; + dmaDeferred = FALSE; + len = dmaLength; + } + + if (dmaTransfer) { + // TXFIFO is now free. Initiate DMA transfer. + // Transfer length field to the FIFO buffer. + RFD = (len+2); + + // Initiate the DMA transfer. + call Dma.startTransfer(); + } + call TxQueue.peek(&txQueue, &data); ack = (data->frame[0] & 0x20); if (ack) { // We must wait for the recipient to acknowledge // the reception of the frame. - RFST = ISRXON; + //RFST = ISRXON; // Wait for 54 symbol periods for the ACK frame to arrive. // We add 22 symbol periods to the wait interval so that an // ACK frame received after 54 symbol periods can be registered @@ -119,14 +182,20 @@ call TxQueue.peek(&txQueue, &data); + // Transfer length field to the FIFO buffer. + RFD = (data->length+2); + + // Initiate the DMA transfer. + call Dma.startTransfer(); + // Write data to transmission buffer. - frame = data->frame; + /*frame = data->frame; RFD = (data->length+2); for (i=0; i<data->length; i++) { RFD = *frame++; } RFD = (0); - RFD = (0); + RFD = (0);*/ } async event void AckControl.AckReceived(uint8_t seqNum) @@ -174,4 +243,12 @@ call TxQueue.dequeue(&txQueue, &data); signal PhyTransmit.txDone(PHY_ACK_FAIL, data->txId); } + + async event void Dma.transferDone() + { + // Write RSSI & LQI fields as 0. + RFD = 0; + RFD = 0; + //DBG_STR("Done transfering frame to tx buffer.",1); + } } \ No newline at end of file Modified: trunk/diku/tiny15four/tos/chips/cc2430/phy/csp.h =================================================================== --- trunk/diku/tiny15four/tos/chips/cc2430/phy/csp.h 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/cc2430/phy/csp.h 2009-03-06 00:21:20 UTC (rev 1052) @@ -11,6 +11,8 @@ #define ISRXON 0xE2 #define ISRFOFF 0xE5 + #define ISFLUSHRX 0xE6 + #define ISFLUSHTX 0xE7 #define ISSTART 0xFE #define ISSTOP 0xFF Modified: trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc =================================================================== --- trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-03 11:23:58 UTC (rev 1051) +++ trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc 2009-03-06 00:21:20 UTC (rev 1052) @@ -42,6 +42,11 @@ interface PhyControl; interface PhyReset; } + uses + { + interface Debug; + interface LocalTime<time_t> as LocalTime; + } } implementation { @@ -51,7 +56,6 @@ mc13192PhyTimerM, // Provided by the MCU implementation. mc13192SpiC, - DebugC, AsyncAlarmC; Init = mc13192SpiC.Init; @@ -70,8 +74,8 @@ mc13192PhyDriverM.Interrupt -> mc13192PhyInterruptM.Interrupt; mc13192PhyDriverM.Timer -> mc13192PhyTimerM.Timer; mc13192PhyInitM.RadioTime -> mc13192PhyTimerM.Timer; - mc13192PhyInitM.MCUTime -> AsyncAlarmC.LocalTime; - mc13192PhyDriverM.MCUTime -> AsyncAlarmC.LocalTime; + mc13192PhyInitM.MCUTime = ... [truncated message content] |
From: <qz...@us...> - 2009-03-03 11:24:21
|
Revision: 1051 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1051&view=rev Author: qzban Date: 2009-03-03 11:23:58 +0000 (Tue, 03 Mar 2009) Log Message: ----------- Added the Jennic JN5121 platform Added Paths: ----------- trunk/diku/jennic/apps/ trunk/diku/jennic/apps/BlinkSimple/ trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.nc trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.s trunk/diku/jennic/apps/BlinkSimple/BlinkSimpleM.nc trunk/diku/jennic/apps/BlinkSimple/Makefile trunk/diku/jennic/apps/BlinkSimple/build/ trunk/diku/jennic/apps/BlinkSimple/build/jn5121/ trunk/diku/jennic/apps/BlinkSimple/build/jn5121/main.bin trunk/diku/jennic/apps/BlinkSimple/build/jn5121/main.c trunk/diku/jennic/apps/BlinkSimple/build/jn5121/main.or32 trunk/diku/jennic/apps/BlinkTimerTest/ trunk/diku/jennic/apps/BlinkTimerTest/BlinkTimerTest.nc trunk/diku/jennic/apps/BlinkTimerTest/BlinkTimerTest.s trunk/diku/jennic/apps/BlinkTimerTest/BlinkTimerTestM.nc trunk/diku/jennic/apps/BlinkTimerTest/Makefile trunk/diku/jennic/apps/BlinkTimerTest/build/ trunk/diku/jennic/apps/BlinkTimerTest/build/jn5121/ trunk/diku/jennic/apps/BlinkTimerTest/build/jn5121/main.bin trunk/diku/jennic/apps/BlinkTimerTest/build/jn5121/main.c trunk/diku/jennic/apps/BlinkTimerTest/build/jn5121/main.or32 trunk/diku/jennic/apps/DisassemblerToLcd/ trunk/diku/jennic/apps/DisassemblerToLcd/DisassemblerToLcd.nc trunk/diku/jennic/apps/DisassemblerToLcd/DisassemblerToLcd.s trunk/diku/jennic/apps/DisassemblerToLcd/DisassemblerToLcdM.nc trunk/diku/jennic/apps/DisassemblerToLcd/Makefile trunk/diku/jennic/apps/DisassemblerToLcd/build/ trunk/diku/jennic/apps/DisassemblerToLcd/build/jn5121/ trunk/diku/jennic/apps/DisassemblerToLcd/build/jn5121/main.bin trunk/diku/jennic/apps/DisassemblerToLcd/build/jn5121/main.c trunk/diku/jennic/apps/DisassemblerToLcd/build/jn5121/main.or32 trunk/diku/jennic/apps/LcdConsoleTest/ trunk/diku/jennic/apps/LcdConsoleTest/LcdConsoleTest.nc trunk/diku/jennic/apps/LcdConsoleTest/LcdConsoleTest.s trunk/diku/jennic/apps/LcdConsoleTest/LcdConsoleTestM.nc trunk/diku/jennic/apps/LcdConsoleTest/Makefile trunk/diku/jennic/apps/LcdConsoleTest/build/ trunk/diku/jennic/apps/LcdConsoleTest/build/jn5121/ trunk/diku/jennic/apps/LcdConsoleTest/build/jn5121/main.bin trunk/diku/jennic/apps/LcdConsoleTest/build/jn5121/main.c trunk/diku/jennic/apps/LcdConsoleTest/build/jn5121/main.or32 trunk/diku/jennic/apps/LcdTest/ trunk/diku/jennic/apps/LcdTest/LcdTest.nc trunk/diku/jennic/apps/LcdTest/LcdTest.s trunk/diku/jennic/apps/LcdTest/LcdTestM.nc trunk/diku/jennic/apps/LcdTest/Makefile trunk/diku/jennic/apps/LcdTest/build/ trunk/diku/jennic/apps/LcdTest/build/jn5121/ trunk/diku/jennic/apps/LcdTest/build/jn5121/main.bin trunk/diku/jennic/apps/LcdTest/build/jn5121/main.c trunk/diku/jennic/apps/LcdTest/build/jn5121/main.or32 trunk/diku/jennic/apps/Makerules trunk/diku/jennic/apps/UartTest/ trunk/diku/jennic/apps/UartTest/Makefile trunk/diku/jennic/apps/UartTest/UartTest.nc trunk/diku/jennic/apps/UartTest/UartTest.s trunk/diku/jennic/apps/UartTest/UartTestM.nc trunk/diku/jennic/apps/UartTest/build/ trunk/diku/jennic/apps/UartTest/build/jn5121/ trunk/diku/jennic/apps/UartTest/build/jn5121/main.bin trunk/diku/jennic/apps/UartTest/build/jn5121/main.c trunk/diku/jennic/apps/UartTest/build/jn5121/main.or32 trunk/diku/jennic/tools/ trunk/diku/jennic/tools/make/ trunk/diku/jennic/tools/make/JN5121/ trunk/diku/jennic/tools/make/JN5121/AppBuild.ld trunk/diku/jennic/tools/make/JN5121/JN5121.rules trunk/diku/jennic/tools/make/JN5121/JennicLib.a trunk/diku/jennic/tools/make/JN5121/makeJn5121.sh trunk/diku/jennic/tools/make/jn5121.target trunk/diku/jennic/tos/ trunk/diku/jennic/tos/chips/ trunk/diku/jennic/tos/chips/jn5121/ trunk/diku/jennic/tos/chips/jn5121/ConsoleC.nc trunk/diku/jennic/tos/chips/jn5121/HALLCD.nc trunk/diku/jennic/tos/chips/jn5121/HALLCDM.nc trunk/diku/jennic/tos/chips/jn5121/HPLInit.nc trunk/diku/jennic/tos/chips/jn5121/HPLLCD.nc trunk/diku/jennic/tos/chips/jn5121/HPLLCDM.nc trunk/diku/jennic/tos/chips/jn5121/HPLSPIM.nc trunk/diku/jennic/tos/chips/jn5121/HPLUART1M.nc trunk/diku/jennic/tos/chips/jn5121/HPLUARTC.nc trunk/diku/jennic/tos/chips/jn5121/JN5121SPI.nc trunk/diku/jennic/tos/chips/jn5121/LcdConsoleC.nc trunk/diku/jennic/tos/chips/jn5121/LedsC.nc trunk/diku/jennic/tos/chips/jn5121/Main.nc trunk/diku/jennic/tos/chips/jn5121/MainM.nc trunk/diku/jennic/tos/chips/jn5121/NoLeds.nc trunk/diku/jennic/tos/chips/jn5121/Timer0M.nc trunk/diku/jennic/tos/chips/jn5121/jn5121_hardware.h trunk/diku/jennic/tos/chips/jn5121/jn5121_interrupt.h trunk/diku/jennic/tos/chips/jn5121/jn5121regs.h trunk/diku/jennic/tos/chips/jn5121/radio/ trunk/diku/jennic/tos/chips/jn5121/radio/radioControlM.nc trunk/diku/jennic/tos/chips/jn5121/radio/radioRegs.h trunk/diku/jennic/tos/chips/jn5121/timers/ trunk/diku/jennic/tos/chips/jn5121/timers/HPLTickTimerM.nc trunk/diku/jennic/tos/chips/jn5121/timers/HPLTimerM.nc trunk/diku/jennic/tos/interfaces/ trunk/diku/jennic/tos/interfaces/ConsoleInput.nc trunk/diku/jennic/tos/interfaces/ConsoleOutput.nc trunk/diku/jennic/tos/interfaces/Debug.nc trunk/diku/jennic/tos/interfaces/Disassembler.nc trunk/diku/jennic/tos/interfaces/FIFOQueue.nc trunk/diku/jennic/tos/interfaces/HPLTimer.nc trunk/diku/jennic/tos/interfaces/HPLUART.nc trunk/diku/jennic/tos/interfaces/Leds.nc trunk/diku/jennic/tos/interfaces/QueueTypes.h trunk/diku/jennic/tos/lib/ trunk/diku/jennic/tos/lib/ConsoleDebugM.nc trunk/diku/jennic/tos/lib/ConsoleM.nc trunk/diku/jennic/tos/lib/Debug.h trunk/diku/jennic/tos/lib/DisassemblerM.nc trunk/diku/jennic/tos/lib/FIFOQueueM.nc trunk/diku/jennic/tos/lib/LCDConsoleM.nc trunk/diku/jennic/tos/platform/ trunk/diku/jennic/tos/platform/jn5121/ trunk/diku/jennic/tos/platform/jn5121/.platform trunk/diku/jennic/tos/platform/jn5121/AppApi.h trunk/diku/jennic/tos/platform/jn5121/AppHardwareApi.h trunk/diku/jennic/tos/platform/jn5121/RegisterMap.h trunk/diku/jennic/tos/platform/jn5121/hardware.h trunk/diku/jennic/tos/platform/jn5121/jendefs.h trunk/diku/jennic/tos/platform/jn5121/mac_sap.h trunk/diku/jennic/tos/sensorboards/ trunk/diku/jennic/tos/system/ trunk/diku/jennic/tos/system/ctype.h trunk/diku/jennic/tos/system/inttypes.h trunk/diku/jennic/tos/system/stddef.h trunk/diku/jennic/tos/system/stdlib.h trunk/diku/jennic/tos/system/string.h trunk/diku/jennic/tos/types/ Added: trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.nc =================================================================== --- trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.nc (rev 0) +++ trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.nc 2009-03-03 11:23:58 UTC (rev 1051) @@ -0,0 +1,80 @@ +/* Copyright (c) 2007, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/* + @author Jan Flora <jan...@di...> +*/ + +configuration BlinkSimple { +} +implementation { + components Main, + BlinkSimpleM, + LedsC, + HPLTimerM, + HALLCDM, + HPLLCDM, + HPLSPIM, + //ConsoleDebugM, + LCDConsoleM, + DisassemblerM, + //ConsoleC; + HPLUART1M; + + Main.StdControl -> HPLSPIM.StdControl; + Main.StdControl -> HPLLCDM.StdControl; + Main.StdControl -> HALLCDM.StdControl; + //Main.StdControl -> ConsoleC.StdControl; + Main.StdControl -> HPLTimerM.StdControl; + Main.StdControl -> BlinkSimpleM.StdControl; + Main.StdControl -> LCDConsoleM.StdControl; + + //ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; + //BlinkSimpleM.Debug -> ConsoleDebugM.Debug; + + + + BlinkSimpleM.Uart -> HPLUART1M.UART; + BlinkSimpleM.Leds -> LedsC; + BlinkSimpleM.Disassembler -> DisassemblerM.Disassembler; + + // Wire console + //DisassemblerM.Output -> ConsoleC.ConsoleOut; + + //BlinkSimpleM.ConsoleInput -> ConsoleC.ConsoleIn; + //BlinkSimpleM.LCDOut -> ConsoleC.ConsoleOut; + + // Wire the LCD + DisassemblerM.Output -> LCDConsoleM.ConsoleOut; + + BlinkSimpleM.LCDOut -> LCDConsoleM.ConsoleOut; + LCDConsoleM.LCD -> HALLCDM.HALLCD; + BlinkSimpleM.LCD -> HALLCDM.HALLCD; + + HALLCDM.HPLLCD -> HPLLCDM.HPLLCD; + HPLLCDM.SPI -> HPLSPIM.SPI; +} + Added: trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.s =================================================================== --- trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.s (rev 0) +++ trunk/diku/jennic/apps/BlinkSimple/BlinkSimple.s 2009-03-03 11:23:58 UTC (rev 1051) @@ -0,0 +1,4980 @@ +.globl _HPLTimerM$ledOn + .data +_HPLTimerM$ledOn: + .space 1 +.globl _HPLSPIM$isrCount +_HPLSPIM$isrCount: + .byte 1 +.globl _LCDConsoleM$lcdFont + .const + .align 5 +_LCDConsoleM$lcdFont: + .byte 5 + .byte 0 + .byte 0 + .byte 0 + .byte 0 + .byte 0 + .byte 3 + .byte 0 + .byte 79 + .byte 0 + .byte 0 + .byte 0 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte 20 + .byte 127 + .byte 20 + .byte 127 + .byte 20 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte 54 + .byte 73 + .byte 85 + .byte 34 + .byte 80 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte 8 + .byte 8 + .byte 62 + .byte 8 + .byte 8 + .byte 3 + .byte 0 + .byte -96 + .byte 96 + .byte 0 + .byte 0 + .byte 5 + .byte 8 + .byte 8 + .byte 8 + .byte 8 + .byte 8 + .byte 3 + .byte 0 + .byte 64 + .byte 0 + .byte 0 + .byte 0 + .byte 5 + .byte 32 + .byte 16 + .byte 8 + .byte 4 + .byte 2 + .byte 5 + .byte 62 + .byte 65 + .byte 65 + .byte 65 + .byte 62 + .byte 3 + .byte 66 + .byte 127 + .byte 64 + .byte 0 + .byte 0 + .byte 5 + .byte 66 + .byte 97 + .byte 81 + .byte 73 + .byte 70 + .byte 5 + .byte 34 + .byte 65 + .byte 73 + .byte 73 + .byte 54 + .byte 5 + .byte 24 + .byte 20 + .byte 18 + .byte 127 + .byte 16 + .byte 5 + .byte 39 + .byte 69 + .byte 69 + .byte 69 + .byte 57 + .byte 5 + .byte 60 + .byte 74 + .byte 73 + .byte 73 + .byte 48 + .byte 5 + .byte 1 + .byte 113 + .byte 9 + .byte 5 + .byte 3 + .byte 5 + .byte 54 + .byte 73 + .byte 73 + .byte 73 + .byte 54 + .byte 5 + .byte 6 + .byte 73 + .byte 73 + .byte 41 + .byte 30 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 3 + .byte 8 + .byte 12 + .byte 8 + .byte 0 + .byte 0 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 3 + .byte 8 + .byte 24 + .byte 8 + .byte 0 + .byte 0 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte 126 + .byte 9 + .byte 9 + .byte 9 + .byte 126 + .byte 5 + .byte 127 + .byte 73 + .byte 73 + .byte 73 + .byte 54 + .byte 5 + .byte 62 + .byte 65 + .byte 65 + .byte 65 + .byte 34 + .byte 5 + .byte 127 + .byte 65 + .byte 65 + .byte 34 + .byte 28 + .byte 5 + .byte 127 + .byte 73 + .byte 73 + .byte 73 + .byte 65 + .byte 5 + .byte 127 + .byte 9 + .byte 9 + .byte 9 + .byte 1 + .byte 5 + .byte 62 + .byte 65 + .byte 65 + .byte 73 + .byte 58 + .byte 5 + .byte 127 + .byte 8 + .byte 8 + .byte 8 + .byte 127 + .byte 3 + .byte 65 + .byte 127 + .byte 65 + .byte 0 + .byte 0 + .byte 5 + .byte 32 + .byte 65 + .byte 65 + .byte 63 + .byte 1 + .byte 5 + .byte 127 + .byte 8 + .byte 20 + .byte 34 + .byte 65 + .byte 5 + .byte 127 + .byte 64 + .byte 64 + .byte 64 + .byte 64 + .byte 5 + .byte 127 + .byte 2 + .byte 28 + .byte 2 + .byte 127 + .byte 5 + .byte 127 + .byte 4 + .byte 8 + .byte 16 + .byte 127 + .byte 5 + .byte 62 + .byte 65 + .byte 65 + .byte 65 + .byte 62 + .byte 5 + .byte 127 + .byte 9 + .byte 9 + .byte 9 + .byte 6 + .byte 5 + .byte 62 + .byte 65 + .byte 65 + .byte 49 + .byte 78 + .byte 5 + .byte 127 + .byte 9 + .byte 9 + .byte 25 + .byte 102 + .byte 5 + .byte 38 + .byte 73 + .byte 73 + .byte 73 + .byte 50 + .byte 5 + .byte 1 + .byte 1 + .byte 127 + .byte 1 + .byte 1 + .byte 5 + .byte 63 + .byte 64 + .byte 64 + .byte 64 + .byte 63 + .byte 5 + .byte 31 + .byte 32 + .byte 64 + .byte 32 + .byte 31 + .byte 5 + .byte 63 + .byte 64 + .byte 56 + .byte 64 + .byte 63 + .byte 5 + .byte 99 + .byte 20 + .byte 8 + .byte 20 + .byte 99 + .byte 5 + .byte 7 + .byte 8 + .byte 120 + .byte 8 + .byte 7 + .byte 5 + .byte 97 + .byte 81 + .byte 73 + .byte 69 + .byte 67 + .byte 3 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 3 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 3 + .byte 64 + .byte 64 + .byte 64 + .byte 0 + .byte 0 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte 32 + .byte 84 + .byte 84 + .byte 84 + .byte 120 + .byte 5 + .byte 127 + .byte 68 + .byte 68 + .byte 68 + .byte 56 + .byte 5 + .byte 56 + .byte 68 + .byte 68 + .byte 68 + .byte 40 + .byte 5 + .byte 56 + .byte 68 + .byte 68 + .byte 68 + .byte 127 + .byte 5 + .byte 56 + .byte 84 + .byte 84 + .byte 84 + .byte 24 + .byte 4 + .byte 8 + .byte 126 + .byte 9 + .byte 9 + .byte 0 + .byte 5 + .byte 24 + .byte -92 + .byte -92 + .byte -92 + .byte 124 + .byte 5 + .byte 127 + .byte 4 + .byte 4 + .byte 4 + .byte 120 + .byte 1 + .byte 125 + .byte 0 + .byte 0 + .byte 0 + .byte 0 + .byte 2 + .byte -128 + .byte 125 + .byte 0 + .byte 0 + .byte 0 + .byte 5 + .byte 127 + .byte 16 + .byte 16 + .byte 40 + .byte 68 + .byte 1 + .byte 127 + .byte 0 + .byte 0 + .byte 0 + .byte 0 + .byte 5 + .byte 120 + .byte 4 + .byte 24 + .byte 4 + .byte 120 + .byte 5 + .byte 124 + .byte 4 + .byte 4 + .byte 4 + .byte 120 + .byte 5 + .byte 56 + .byte 68 + .byte 68 + .byte 68 + .byte 56 + .byte 5 + .byte -4 + .byte 36 + .byte 36 + .byte 36 + .byte 24 + .byte 5 + .byte 24 + .byte 36 + .byte 36 + .byte 36 + .byte -4 + .byte 5 + .byte 124 + .byte 8 + .byte 4 + .byte 4 + .byte 8 + .byte 5 + .byte 72 + .byte 84 + .byte 84 + .byte 84 + .byte 36 + .byte 4 + .byte 4 + .byte 63 + .byte 68 + .byte 68 + .byte 0 + .byte 5 + .byte 60 + .byte 64 + .byte 64 + .byte 64 + .byte 124 + .byte 5 + .byte 28 + .byte 32 + .byte 64 + .byte 32 + .byte 28 + .byte 5 + .byte 60 + .byte 64 + .byte 48 + .byte 64 + .byte 60 + .byte 5 + .byte 68 + .byte 40 + .byte 16 + .byte 40 + .byte 68 + .byte 5 + .byte 28 + .byte -96 + .byte -96 + .byte -96 + .byte 124 + .byte 5 + .byte 68 + .byte 100 + .byte 84 + .byte 76 + .byte 68 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte 5 + .byte -1 + .byte -1 + .byte -1 + .byte -1 + .byte -1 +.globl _LCDConsoleM$xPos + .data +_LCDConsoleM$xPos: + .space 1 +.globl _LCDConsoleM$yPos +_LCDConsoleM$yPos: + .space 1 +.globl _HPLUART1M$bufferHead + .align 1 +_HPLUART1M$bufferHead: + .space 2 +.globl _HPLUART1M$bufferCount + .align 1 +_HPLUART1M$bufferCount: + .space 2 +.globl _HPLUART1M$bufferSize + .const + .align 1 +_HPLUART1M$bufferSize: + .word 50 +.globl _HPLUART1M$bufferFull + .data +_HPLUART1M$bufferFull: + .space 1 +.globl _HPLUART1M$is_sending +_HPLUART1M$is_sending: + .space 1 +.globl _HPLUART1M$syncRequest +_HPLUART1M$syncRequest: + .space 1 +.globl _HPLUART1M$classicPut +_HPLUART1M$classicPut: + .space 1 + .text +.globl _signal_UART0 +_signal_UART0: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $52, %esp + call ___i686.get_pc_thunk.bx +"L00000000001$pb": + movl $0, (%esp) + movl $15968, %eax + call *%eax + movb %al, -10(%ebp) + leal -10(%ebp), %eax + andb $15, (%eax) + leal -10(%ebp), %eax + shrb (%eax) + cmpb $1, -10(%ebp) + jne L2 + leal _HPLUART1M$classicPut-"L00000000001$pb"(%ebx), %eax + movzbl (%eax), %eax + testb %al, %al + je L4 + movl $0, 20(%esp) + movl $1, 16(%esp) + movl $0, 12(%esp) + movl $0, 8(%esp) + movl $0, 4(%esp) + movl $0, (%esp) + movl $15460, %eax + call *%eax + leal _HPLUART1M$signal_done_tsk-"L00000000001$pb"(%ebx), %eax + movl %eax, (%esp) + call L_TOS_post$stub + jmp L9 +L4: + call ___nesc_atomic_start + movb %al, -9(%ebp) + leal _HPLUART1M$is_sending-"L00000000001$pb"(%ebx), %eax + movb $0, (%eax) + movzbl -9(%ebp), %eax + movl %eax, (%esp) + call ___nesc_atomic_end + call _HPLUART1M$moveToUART + testb %al, %al + jne L9 + movl $0, 20(%esp) + movl $1, 16(%esp) + movl $0, 12(%esp) + movl $0, 8(%esp) + movl $0, 4(%esp) + movl $0, (%esp) + movl $15460, %eax + call *%eax + jmp L9 +L2: + cmpb $2, -10(%ebp) + jne L9 + movl $0, (%esp) + movl $16132, %eax + call *%eax + movzbl %al, %eax + movl %eax, (%esp) + call _HPLUART1M$UART$get +L9: + addl $52, %esp + popl %ebx + popl %ebp + ret +_HPLUART1M$UART$get: + pushl %ebp + movl %esp, %ebp + subl $56, %esp + movl 8(%ebp), %eax + movb %al, -28(%ebp) + movzbl -28(%ebp), %eax + movl %eax, (%esp) + call _BlinkSimpleM$Uart$get + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_BlinkSimpleM$Uart$get: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $36, %esp + call ___i686.get_pc_thunk.bx +"L00000000002$pb": + movl 8(%ebp), %eax + movb %al, -12(%ebp) + movzbl -12(%ebp), %edx + leal L_BlinkSimpleM$myChar$non_lazy_ptr-"L00000000002$pb"(%ebx), %eax + movl (%eax), %eax + movb %dl, (%eax) + leal _BlinkSimpleM$writeChar-"L00000000002$pb"(%ebx), %eax + movl %eax, (%esp) + call L_TOS_post$stub + movl $1, %eax + addl $36, %esp + popl %ebx + popl %ebp + ret +_BlinkSimpleM$writeChar: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $20, %esp + call ___i686.get_pc_thunk.bx +"L00000000003$pb": + leal L_BlinkSimpleM$myChar$non_lazy_ptr-"L00000000003$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + movzbl %al, %eax + movl %eax, (%esp) + call _BlinkSimpleM$Uart$put + addl $20, %esp + popl %ebx + popl %ebp + ret +_BlinkSimpleM$Uart$put: + pushl %ebp + movl %esp, %ebp + subl $56, %esp + movl 8(%ebp), %eax + movb %al, -28(%ebp) + movzbl -28(%ebp), %eax + movl %eax, (%esp) + call L_HPLUART1M$UART$put$stub + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_HPLUART1M$moveToUART: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $68, %esp + call ___i686.get_pc_thunk.bx +"L00000000004$pb": + movb $0, -11(%ebp) + movb $0, -10(%ebp) + call ___nesc_atomic_start + movb %al, -9(%ebp) + leal _HPLUART1M$is_sending-"L00000000004$pb"(%ebx), %eax + movzbl (%eax), %eax + testb %al, %al + jne L19 + leal _HPLUART1M$syncRequest-"L00000000004$pb"(%ebx), %eax + movzbl (%eax), %eax + testb %al, %al + jne L19 + leal _HPLUART1M$bufferCount-"L00000000004$pb"(%ebx), %eax + movzwl (%eax), %eax + testw %ax, %ax + je L19 + leal _HPLUART1M$bufferHead-"L00000000004$pb"(%ebx), %eax + movzwl (%eax), %eax + movzwl %ax, %edx + leal L_HPLUART1M$buffer$non_lazy_ptr-"L00000000004$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax,%edx), %eax + movb %al, -10(%ebp) + leal _HPLUART1M$bufferHead-"L00000000004$pb"(%ebx), %eax + movzwl (%eax), %eax + leal 1(%eax), %edx + leal _HPLUART1M$bufferHead-"L00000000004$pb"(%ebx), %eax + movw %dx, (%eax) + leal _HPLUART1M$bufferHead-"L00000000004$pb"(%ebx), %eax + movzwl (%eax), %ecx + leal _HPLUART1M$bufferSize-"L00000000004$pb"(%ebx), %eax + movzwl (%eax), %eax + movw %ax, -26(%ebp) + movl $0, %edx + movl %ecx, %eax + divw -26(%ebp) + leal _HPLUART1M$bufferHead-"L00000000004$pb"(%ebx), %eax + movw %dx, (%eax) + leal _HPLUART1M$bufferCount-"L00000000004$pb"(%ebx), %eax + movzwl (%eax), %eax + leal -1(%eax), %edx + leal _HPLUART1M$bufferCount-"L00000000004$pb"(%ebx), %eax + movw %dx, (%eax) + leal _HPLUART1M$bufferFull-"L00000000004$pb"(%ebx), %eax + movb $0, (%eax) + leal _HPLUART1M$is_sending-"L00000000004$pb"(%ebx), %eax + movb $1, (%eax) + movb $1, -11(%ebp) +L19: + movzbl -9(%ebp), %eax + movl %eax, (%esp) + call ___nesc_atomic_end + cmpb $1, -11(%ebp) + jne L23 +L24: + movl $0, (%esp) + movl $15800, %eax + call *%eax + movzbl %al, %eax + shrl $5, %eax + xorl $1, %eax + andl $1, %eax + testb %al, %al + jne L24 + movl $0, 20(%esp) + movl $1, 16(%esp) + movl $1, 12(%esp) + movl $0, 8(%esp) + movl $0, 4(%esp) + movl $0, (%esp) + movl $15460, %eax + call *%eax + movzbl -10(%ebp), %eax + movl %eax, 4(%esp) + movl $0, (%esp) + movl $16052, %eax + call *%eax +L23: + movzbl -11(%ebp), %eax + addl $68, %esp + popl %ebx + popl %ebp + ret +___nesc_atomic_end: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl 8(%ebp), %eax + movb %al, -12(%ebp) + movzbl -12(%ebp), %eax + shrl $2, %eax + andl $1, %eax + testb %al, %al + je L30 + call ___nesc_enable_interrupt +L30: + leave + ret +___nesc_enable_interrupt: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl $17, (%esp) + call ___jn5121_read_SPR + orl $4, %eax + movl %eax, 4(%esp) + movl $17, (%esp) + call ___jn5121_write_SPR + leave + ret +___jn5121_write_SPR: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl 8(%ebp), %eax + movw %ax, -12(%ebp) + movl -12(%ebp), %edx + movl 12(%ebp), %eax + l.mtspr %dx, %eax, 0; + leave + ret +___jn5121_read_SPR: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl 8(%ebp), %eax + movw %ax, -12(%ebp) + movl -12(%ebp), %eax + l.mfspr %eax, %ax, 0; + leave + ret +___nesc_atomic_start: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + call ___jn5121_interrupts_enabled + movb %al, -9(%ebp) + call ___nesc_disable_interrupt + movzbl -9(%ebp), %eax + leave + ret +___nesc_disable_interrupt: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl $17, (%esp) + call ___jn5121_read_SPR + andl $-5, %eax + movl %eax, 4(%esp) + movl $17, (%esp) + call ___jn5121_write_SPR + leave + ret +___jn5121_interrupts_enabled: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + l.mfspr %eax, r0, 17; + movzbl %al, %eax + leave + ret +_HPLUART1M$signal_done_tsk: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $4, %esp + call ___i686.get_pc_thunk.bx +"L00000000005$pb": + leal _HPLUART1M$classicPut-"L00000000005$pb"(%ebx), %eax + movb $0, (%eax) + call _HPLUART1M$UART$putDone + addl $4, %esp + popl %ebx + popl %ebp + ret +_HPLUART1M$UART$putDone: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + call _BlinkSimpleM$Uart$putDone + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_BlinkSimpleM$Uart$putDone: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $20, %esp + call ___i686.get_pc_thunk.bx +"L00000000006$pb": + leal L_BlinkSimpleM$myChar$non_lazy_ptr-"L00000000006$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + leal 1(%eax), %edx + leal L_BlinkSimpleM$myChar$non_lazy_ptr-"L00000000006$pb"(%ebx), %eax + movl (%eax), %eax + movb %dl, (%eax) + leal L_BlinkSimpleM$myChar$non_lazy_ptr-"L00000000006$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + cmpb $122, %al + jle L48 + leal L_BlinkSimpleM$myChar$non_lazy_ptr-"L00000000006$pb"(%ebx), %eax + movl (%eax), %eax + movb $97, (%eax) +L48: + leal _BlinkSimpleM$writeChar-"L00000000006$pb"(%ebx), %eax + movl %eax, (%esp) + call L_TOS_post$stub + movl $1, %eax + addl $20, %esp + popl %ebx + popl %ebp + ret +_HPLUART1M$UART$put: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $52, %esp + call ___i686.get_pc_thunk.bx +"L00000000007$pb": + movl 8(%ebp), %eax + movb %al, -12(%ebp) + leal _HPLUART1M$classicPut-"L00000000007$pb"(%ebx), %eax + movb $1, (%eax) +L52: + movl $0, (%esp) + movl $15800, %eax + call *%eax + movzbl %al, %eax + shrl $5, %eax + xorl $1, %eax + andl $1, %eax + testb %al, %al + jne L52 + movl $0, 20(%esp) + movl $1, 16(%esp) + movl $1, 12(%esp) + movl $0, 8(%esp) + movl $0, 4(%esp) + movl $0, (%esp) + movl $15460, %eax + call *%eax + movzbl -12(%ebp), %eax + movl %eax, 4(%esp) + movl $0, (%esp) + movl $16052, %eax + call *%eax + movl $1, %eax + addl $52, %esp + popl %ebx + popl %ebp + ret +.globl _signal_SPI +_signal_SPI: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $36, %esp + call ___i686.get_pc_thunk.bx +"L00000000008$pb": + movl $-2147483628, %eax + movl (%eax), %eax + movb %al, -9(%ebp) + leal _HPLSPIM$isrCount-"L00000000008$pb"(%ebx), %eax + movzbl (%eax), %eax + movzbl %al, %ecx + leal 1(%eax), %edx + leal _HPLSPIM$isrCount-"L00000000008$pb"(%ebx), %eax + movb %dl, (%eax) + movl %ecx, (%esp) + call _intToLeds + leal _HPLSPIM$isrCount-"L00000000008$pb"(%ebx), %eax + movzbl (%eax), %eax + cmpb $15, %al + jbe L56 + leal _HPLSPIM$isrCount-"L00000000008$pb"(%ebx), %eax + movb $0, (%eax) +L56: + movl $-2147483632, %eax + movl $1, (%eax) + addl $36, %esp + popl %ebx + popl %ebp + ret +_intToLeds: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + movl 8(%ebp), %eax + movb %al, -12(%ebp) + movl $0, 4(%esp) + movl $16384, (%esp) + movl $10224, %eax + call *%eax + movl $0, 4(%esp) + movl $32768, (%esp) + movl $10224, %eax + call *%eax + movl $0, 4(%esp) + movl $65536, (%esp) + movl $10224, %eax + call *%eax + movl $0, 4(%esp) + movl $131072, (%esp) + movl $10224, %eax + call *%eax + movzbl -12(%ebp), %eax + andl $1, %eax + testb %al, %al + je L60 + movl $131072, 4(%esp) + movl $0, (%esp) + movl $10224, %eax + call *%eax +L60: + movzbl -12(%ebp), %eax + shrl %eax + andl $1, %eax + testb %al, %al + je L62 + movl $65536, 4(%esp) + movl $0, (%esp) + movl $10224, %eax + call *%eax +L62: + movzbl -12(%ebp), %eax + shrl $2, %eax + andl $1, %eax + testb %al, %al + je L64 + movl $32768, 4(%esp) + movl $0, (%esp) + movl $10224, %eax + call *%eax +L64: + movzbl -12(%ebp), %eax + shrl $3, %eax + andl $1, %eax + testb %al, %al + je L68 + movl $16384, 4(%esp) + movl $0, (%esp) + movl $10224, %eax + call *%eax +L68: + leave + ret +.globl _TOS_post +_TOS_post: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $52, %esp + call ___i686.get_pc_thunk.bx +"L00000000009$pb": + call ___nesc_atomic_start + movb %al, -10(%ebp) + leal L_TOSH_sched_free$non_lazy_ptr-"L00000000009$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + movb %al, -9(%ebp) + movzbl -9(%ebp), %edx + leal L_TOSH_queue$non_lazy_ptr-"L00000000009$pb"(%ebx), %eax + movl (%eax), %eax + movl (%eax,%edx,4), %eax + testl %eax, %eax + jne L70 + movzbl -9(%ebp), %eax + addb $1, %al + movl %eax, %edx + andb $7, %dl + leal L_TOSH_sched_free$non_lazy_ptr-"L00000000009$pb"(%ebx), %eax + movl (%eax), %eax + movb %dl, (%eax) + movzbl -9(%ebp), %ecx + leal L_TOSH_queue$non_lazy_ptr-"L00000000009$pb"(%ebx), %eax + movl (%eax), %eax + movl 8(%ebp), %edx + movl %edx, (%eax,%ecx,4) + movzbl -10(%ebp), %eax + movl %eax, (%esp) + call ___nesc_atomic_end + movl $1, -28(%ebp) + jmp L72 +L70: + movzbl -10(%ebp), %eax + movl %eax, (%esp) + call ___nesc_atomic_end + movl $0, -28(%ebp) +L72: + movl -28(%ebp), %eax + addl $52, %esp + popl %ebx + popl %ebp + ret +.globl _main +_main: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call _MainM$hardwareInit + call _TOSH_sched_init + call _MainM$StdControl$init + call _MainM$StdControl$start + call ___nesc_enable_interrupt + call _TOSH_run_task + movl $0, %eax + leave + ret +_TOSH_run_task: + pushl %ebp + movl %esp, %ebp + subl $8, %esp +L77: + call _TOSH_run_next_task + jmp L77 +_TOSH_run_next_task: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $52, %esp + call ___i686.get_pc_thunk.bx +"L00000000010$pb": + call ___nesc_atomic_start + movb %al, -14(%ebp) + leal L_TOSH_sched_full$non_lazy_ptr-"L00000000010$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + movb %al, -13(%ebp) + movzbl -13(%ebp), %edx + leal L_TOSH_queue$non_lazy_ptr-"L00000000010$pb"(%ebx), %eax + movl (%eax), %eax + movl (%eax,%edx,4), %eax + movl %eax, -12(%ebp) + cmpl $0, -12(%ebp) + jne L80 + call ___nesc_atomic_sleep + movl $0, -28(%ebp) + jmp L82 +L80: + movzbl -13(%ebp), %edx + leal L_TOSH_queue$non_lazy_ptr-"L00000000010$pb"(%ebx), %eax + movl (%eax), %eax + movl $0, (%eax,%edx,4) + movzbl -13(%ebp), %eax + addb $1, %al + movl %eax, %edx + andb $7, %dl + leal L_TOSH_sched_full$non_lazy_ptr-"L00000000010$pb"(%ebx), %eax + movl (%eax), %eax + movb %dl, (%eax) + movzbl -14(%ebp), %eax + movl %eax, (%esp) + call ___nesc_atomic_end + movl -12(%ebp), %eax + call *%eax + movl $1, -28(%ebp) +L82: + movl -28(%ebp), %eax + addl $52, %esp + popl %ebx + popl %ebp + ret +___nesc_atomic_sleep: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call _TOSH_sleep + leave + ret +_TOSH_sleep: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + movl $268435500, %eax + movl $1, (%eax) + leave + ret +_MainM$StdControl$start: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + call _HPLSPIM$StdControl$start + movb %al, -9(%ebp) + call _HPLLCDM$StdControl$start + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _HALLCDM$StdControl$start + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _HPLTimerM$StdControl$start + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _BlinkSimpleM$StdControl$start + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _LCDConsoleM$StdControl$start + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_LCDConsoleM$StdControl$start: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + movl $1, %eax + leave + ret +_BlinkSimpleM$StdControl$start: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movb $1, -17(%ebp) + movl $0, -16(%ebp) + movl $14708, -12(%ebp) +L93: + movl $0, -12(%ebp) + jmp L94 +L95: + leal -12(%ebp), %eax + addl $4, (%eax) +L94: + cmpl $999999, -12(%ebp) + jbe L95 + call _BlinkSimpleM$Leds$redToggle + jmp L93 +_BlinkSimpleM$Leds$redToggle: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + call _LedsC$Leds$redToggle + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_LedsC$Leds$redToggle: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $36, %esp + call ___i686.get_pc_thunk.bx +"L00000000011$pb": + call ___nesc_atomic_start + movb %al, -9(%ebp) + leal L_LedsC$ledsOn$non_lazy_ptr-"L00000000011$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + movzbl %al, %eax + andl $1, %eax + testb %al, %al + je L101 + call _LedsC$Leds$redOff + movb %al, -10(%ebp) + jmp L103 +L101: + call _LedsC$Leds$redOn + movb %al, -10(%ebp) +L103: + movzbl -9(%ebp), %eax + movl %eax, (%esp) + call ___nesc_atomic_end + movzbl -10(%ebp), %eax + addl $36, %esp + popl %ebx + popl %ebp + ret +_LedsC$Leds$redOn: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $4, %esp + call ___i686.get_pc_thunk.bx +"L00000000012$pb": + call _TOSH_SET_RED_LED_PIN + leal L_LedsC$ledsOn$non_lazy_ptr-"L00000000012$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + movl %eax, %edx + orb $1, %dl + leal L_LedsC$ledsOn$non_lazy_ptr-"L00000000012$pb"(%ebx), %eax + movl (%eax), %eax + movb %dl, (%eax) + movl $1, %eax + addl $4, %esp + popl %ebx + popl %ebp + ret +_TOSH_SET_RED_LED_PIN: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000013$pb": + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000013$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000013$pb"(%ecx), %eax + movl (%eax), %eax + orb $2, 2(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000013$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_LedsC$Leds$redOff: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $4, %esp + call ___i686.get_pc_thunk.bx +"L00000000014$pb": + call L_TOSH_CLR_RED_LED_PIN$stub + leal L_LedsC$ledsOn$non_lazy_ptr-"L00000000014$pb"(%ebx), %eax + movl (%eax), %eax + movzbl (%eax), %eax + movl %eax, %edx + andb $-2, %dl + leal L_LedsC$ledsOn$non_lazy_ptr-"L00000000014$pb"(%ebx), %eax + movl (%eax), %eax + movb %dl, (%eax) + movl $1, %eax + addl $4, %esp + popl %ebx + popl %ebp + ret +_HPLTimerM$StdControl$start: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $20, %esp + call ___i686.get_pc_thunk.bx +"L00000000015$pb": + movl $0, (%esp) + movl $17528, %eax + call *%eax + movl $0, (%esp) + movl $17404, %eax + call *%eax + leal L_tickTimerInterrupt$non_lazy_ptr-"L00000000015$pb"(%ebx), %eax + movl (%eax), %eax + movl %eax, (%esp) + movl $17336, %eax + call *%eax + movl $16777215, (%esp) + movl $17680, %eax + call *%eax + movl $1, (%esp) + movl $17528, %eax + call *%eax + movl $1, (%esp) + movl $17584, %eax + call *%eax + call ___jn5121_read_interrupt_mask + orl $65535, %eax + movl %eax, (%esp) + call ___jn5121_write_interrupt_mask + movl $17432, %eax + call *%eax + movl $65536, 4(%esp) + movl $0, (%esp) + movl $10224, %eax + call *%eax + movl $1, %eax + addl $20, %esp + popl %ebx + popl %ebp + ret +___jn5121_write_interrupt_mask: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl 8(%ebp), %eax + movl %eax, -12(%ebp) + movl -12(%ebp), %eax + l.mtspr r0, %eax, $18432; + leave + ret +___jn5121_read_interrupt_mask: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + l.mfspr %eax, r0, $18432; + leave + ret +_HALLCDM$StdControl$start: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl $175, (%esp) + call _HALLCDM$HPLLCD$sendCommand + movl $1, %eax + leave + ret +_HALLCDM$HPLLCD$sendCommand: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + movl 8(%ebp), %eax + movb %al, -12(%ebp) + movzbl -12(%ebp), %eax + movl %eax, (%esp) + call L_HPLLCDM$HPLLCD$sendCommand$stub + leave + ret +_rcombine: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl 8(%ebp), %eax + movl 12(%ebp), %edx + movb %al, -12(%ebp) + movb %dl, -16(%ebp) + cmpb $0, -12(%ebp) + je L122 + movzbl -16(%ebp), %eax + movl %eax, -20(%ebp) + jmp L124 +L122: + movl $0, -20(%ebp) +L124: + movl -20(%ebp), %eax + leave + ret +_HPLLCDM$StdControl$start: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + movl $1, %eax + leave + ret +_HPLSPIM$StdControl$start: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000016$pb": + movl $268435456, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %edx + movl (%edx), %eax + andb $143, %ah + orb $16, %ah + movl %eax, (%edx) + movl $268435456, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + movl $-2147483644, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + orb $8, 2(%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + andb $-33, 2(%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + andb $-33, 3(%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + andb $-65, 3(%eax) + movl $-2147483644, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000016$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + movl $-2147483640, %eax + movl $2, (%eax) + movl $-2147483628, %eax + movl $1, (%eax) + movl $-2147483632, %eax + movl $0, (%eax) + movl $1, %eax + leave + ret +_MainM$StdControl$init: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + call _HPLSPIM$StdControl$init + movb %al, -9(%ebp) + call _HPLLCDM$StdControl$init + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _HALLCDM$StdControl$init + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _HPLTimerM$StdControl$init + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _BlinkSimpleM$StdControl$init + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + call _LCDConsoleM$StdControl$init + movzbl %al, %eax + movzbl -9(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call _rcombine + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_LCDConsoleM$StdControl$init: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + movl $1, %eax + leave + ret +_BlinkSimpleM$StdControl$init: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call _BlinkSimpleM$Leds$init + movl $1, %eax + leave + ret +_BlinkSimpleM$Leds$init: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + call _LedsC$Leds$init + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_LedsC$Leds$init: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $36, %esp + call ___i686.get_pc_thunk.bx +"L00000000017$pb": + call ___nesc_atomic_start + movb %al, -9(%ebp) + leal L_LedsC$ledsOn$non_lazy_ptr-"L00000000017$pb"(%ebx), %eax + movl (%eax), %eax + movb $0, (%eax) + movzbl -9(%ebp), %eax + movl %eax, (%esp) + call ___nesc_atomic_end + movl $1, %eax + addl $36, %esp + popl %ebx + popl %ebp + ret +_HPLTimerM$StdControl$init: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + movl $1, %eax + leave + ret +_HALLCDM$StdControl$init: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl $235, (%esp) + call _HALLCDM$HPLLCD$sendCommand + movl $137, (%esp) + call _HALLCDM$HPLLCD$sendCommand + movl $161, (%esp) + call _HALLCDM$HPLLCD$sendCommand + movl $1, %eax + leave + ret +_HPLLCDM$StdControl$init: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000018$pb": + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + andb $-33, 3(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + movl $536870912, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + orb $64, 3(%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + orb $32, 3(%eax) + movl $536870912, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + orb $32, 3(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000018$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_HPLSPIM$StdControl$init: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + movl $1, %eax + leave + ret +_TOSH_sched_init: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + call ___i686.get_pc_thunk.cx +"L00000000019$pb": + leal L_TOSH_sched_free$non_lazy_ptr-"L00000000019$pb"(%ecx), %eax + movl (%eax), %eax + movb $0, (%eax) + leal L_TOSH_sched_full$non_lazy_ptr-"L00000000019$pb"(%ecx), %eax + movl (%eax), %eax + movb $0, (%eax) + movl $0, -12(%ebp) + jmp L149 +L150: + movl -12(%ebp), %eax + leal L_TOSH_queue$non_lazy_ptr-"L00000000019$pb"(%ecx), %edx + movl (%edx), %edx + movl $0, (%edx,%eax,4) + leal -12(%ebp), %eax + addl $1, (%eax) +L149: + cmpl $7, -12(%ebp) + jle L150 + leave + ret +_MainM$hardwareInit: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + call _HPLInit$init + movb %al, -9(%ebp) + movzbl -9(%ebp), %eax + leave + ret +_HPLInit$init: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $4, %esp + call ___i686.get_pc_thunk.bx +"L00000000020$pb": + movl $268435456, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000020$pb"(%ebx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000020$pb"(%ebx), %eax + movl (%eax), %eax + orb $16, 3(%eax) + movl $268435456, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000020$pb"(%ebx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) +L156: + movl $268435456, %eax + movzbl 3(%eax), %eax + andb $16, %al + testb %al, %al + je L156 + call _initializeISRVector + call _TOSH_SET_PIN_DIRECTIONS + call ___nesc_enable_interrupt + movl $1, %eax + addl $4, %esp + popl %ebx + popl %ebp + ret +_TOSH_SET_PIN_DIRECTIONS: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call _TOSH_MAKE_RED_LED_OUTPUT + call _TOSH_MAKE_GREEN_LED_OUTPUT + call _TOSH_MAKE_YELLOW_LED_OUTPUT + call _TOSH_MAKE_BLUE_LED_OUTPUT + call L_TOSH_CLR_RED_LED_PIN$stub + call _TOSH_CLR_GREEN_LED_PIN + call _TOSH_CLR_YELLOW_LED_PIN + call _TOSH_CLR_BLUE_LED_PIN + leave + ret +_TOSH_CLR_BLUE_LED_PIN: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000021$pb": + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000021$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000021$pb"(%ecx), %eax + movl (%eax), %eax + orb $64, 1(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000021$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_TOSH_CLR_YELLOW_LED_PIN: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000022$pb": + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000022$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000022$pb"(%ecx), %eax + movl (%eax), %eax + orb $-128, 1(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000022$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_TOSH_CLR_GREEN_LED_PIN: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000023$pb": + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000023$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000023$pb"(%ecx), %eax + movl (%eax), %eax + orb $1, 2(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000023$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_TOSH_MAKE_BLUE_LED_OUTPUT: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000024$pb": + movl $536870912, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000024$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000024$pb"(%ecx), %eax + movl (%eax), %eax + orb $64, 1(%eax) + movl $536870912, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000024$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_TOSH_MAKE_YELLOW_LED_OUTPUT: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000025$pb": + movl $536870912, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000025$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000025$pb"(%ecx), %eax + movl (%eax), %eax + orb $-128, 1(%eax) + movl $536870912, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000025$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_TOSH_MAKE_GREEN_LED_OUTPUT: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000026$pb": + movl $536870912, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000026$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000026$pb"(%ecx), %eax + movl (%eax), %eax + orb $1, 2(%eax) + movl $536870912, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000026$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_TOSH_MAKE_RED_LED_OUTPUT: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000027$pb": + movl $536870912, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000027$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000027$pb"(%ecx), %eax + movl (%eax), %eax + orb $2, 2(%eax) + movl $536870912, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000027$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_initializeISRVector: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000028$pb": + movl $68, %eax + movl (%eax), %eax + movl %eax, %edx + leal L_signal_TICK_TIMER$non_lazy_ptr-"L00000000028$pb"(%ecx), %eax + movl (%eax), %eax + movl %eax, (%edx) + movl $68, %eax + movl (%eax), %eax + leal 4(%eax), %edx + leal L_signal_SYS_CTRL$non_lazy_ptr-"L00000000028$pb"(%ecx), %eax + movl (%eax), %eax + movl %eax, (%edx) + movl $68, %eax + movl (%eax), %eax + leal 20(%eax), %edx + leal _signal_UART0-"L00000000028$pb"(%ecx), %eax + movl %eax, (%edx) + movl $68, %eax + movl (%eax), %eax + leal 24(%eax), %edx + leal L_signal_UART1$non_lazy_ptr-"L00000000028$pb"(%ecx), %eax + movl (%eax), %eax + movl %eax, (%edx) + movl $68, %eax + movl (%eax), %eax + leal 40(%eax), %edx + leal _signal_SPI-"L00000000028$pb"(%ecx), %eax + movl %eax, (%edx) + leave + ret +_TOSH_CLR_RED_LED_PIN: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000029$pb": + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000029$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000029$pb"(%ecx), %eax + movl (%eax), %eax + orb $2, 2(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000029$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + leave + ret +_HPLLCDM$HPLLCD$sendCommand: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $36, %esp + call ___i686.get_pc_thunk.bx +"L00000000030$pb": + movl 8(%ebp), %eax + movb %al, -12(%ebp) + movl $2, (%esp) + call _HPLLCDM$SPI$select + movl $536870916, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000030$pb"(%ebx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000030$pb"(%ebx), %eax + movl (%eax), %eax + andb $-65, 3(%eax) + movl $536870916, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000030$pb"(%ebx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) + movzbl -12(%ebp), %eax + movl %eax, (%esp) + call _HPLLCDM$SPI$tx32 + addl $36, %esp + popl %ebx + popl %ebp + ret +_HPLLCDM$SPI$tx32: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + movl 8(%ebp), %eax + movl %eax, (%esp) + call L_HPLSPIM$SPI$tx32$stub + movl %eax, -12(%ebp) + movl -12(%ebp), %eax + leave + ret +_HPLLCDM$SPI$select: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + movl 8(%ebp), %eax + movb %al, -12(%ebp) + movzbl -12(%ebp), %eax + movl %eax, (%esp) + call _HPLSPIM$SPI$select + leave + ret +_HPLSPIM$SPI$select: + pushl %ebp + movl %esp, %ebp + subl $24, %esp + movl 8(%ebp), %eax + movb %al, -12(%ebp) + movl $-2147483636, %edx + movzbl -12(%ebp), %eax + movl %eax, (%edx) + leave + ret +_HPLSPIM$SPI$tx32: + pushl %ebp + movl %esp, %ebp + subl $8, %esp + call ___i686.get_pc_thunk.cx +"L00000000031$pb": + movl $-2147483648, %edx + movl 8(%ebp), %eax + movl %eax, (%edx) + movl $-2147483644, %eax + movl (%eax), %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000031$pb"(%ecx), %eax + movl (%eax), %eax + movl %edx, (%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000031$pb"(%ecx), %eax + movl (%eax), %eax + orb $-128, 2(%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000031$pb"(%ecx), %eax + movl (%eax), %eax + andb $-2, 3(%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000031$pb"(%ecx), %eax + movl (%eax), %eax + andb $-3, 3(%eax) + leal L_tmpReg5121$non_lazy_ptr-"L00000000031$pb"(%ecx), %eax + movl (%eax), %eax + orb $-128, 3(%eax) + movl $-2147483644, %edx + leal L_tmpReg5121$non_lazy_ptr-"L00000000031$pb"(%ecx), %eax + movl (%eax), %eax + movl (%eax), %eax + movl %eax, (%edx) +L188: + movl $-2147483644, %eax + movzbl 3(%eax), %eax + andb $-128, %al + testb %al, %al + jne L188 + movl $-2147483648, %eax + movl (%eax), %eax + leave + ret +.globl _tickTimerInterrupt +_tickTimerInterrupt: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $20, %esp + call ___i686.get_pc_thunk.bx +"L00000000032$pb": + movl $17432, %eax + call *%eax + leal _HPLTimerM$myTestTask-"L00000000032$pb"(%ebx), %eax + movl %eax, (%esp) + call _TOS_post + addl $20, %esp + popl %ebx + popl %ebp + ret +_HPLTimerM$myTestTask: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $20, %esp + call ___i686.get_pc_thunk.bx +"L00000000033$pb": + leal _HPLTimerM$ledOn-"L00000000033$pb"(%ebx), %eax + movzbl (%eax), %eax + testb %al, %al + jne L194 + movl $16384, 4(%esp) + movl $0, (%esp) + movl $10224, %eax + call *%eax + leal _HPLTimerM$ledOn-"L00000000033$pb"(%ebx), %eax + movb $1, (%eax) + jmp L197 +L194: + movl $0, 4(%esp) + movl $16384, (%esp) + movl $10224, %eax + call *%eax + leal _HPLTimerM$ledOn-"L00000000033$pb"(%ebx), %eax + movb $0, (%eax) +L197: + addl $20, %esp + popl %ebx + popl %ebp + ret + .cstring +LC0: + .ascii "l.j\0" +LC1: + .ascii "l.jal\0" + .align 2 +LC2: + .ascii "Invalid instruction opcode: 0x02\12\0" +LC3: + .ascii "l.bnf\0" +LC4: + .ascii "l.bf\0" +LC5: + .ascii "l.nop\12\0" +LC6: + .ascii "l.macrc\0" +LC7: + .ascii "l.movhi\0" + .align 2 +LC8: + .ascii "Invalid instruction opcode: 0x07\12\0" +LC9: + .ascii "l.sys\0" +LC10: + .ascii "l.trap\0" +LC11: + .ascii "l.msync\12\0" +LC12: + .ascii "l.psync\12\0" +LC13: + .ascii "l.csync\12\0" +LC14: + .ascii "l.rfe\12\0" + .align 2 +LC15: + .ascii "lv. Vector related instuction\12\0" + .align 2 +LC16: + .ascii "Invalid instruction opcode: 0x0B\12\0" + .align 2 +LC17: + .ascii "Invalid instruction opcode: 0x0C\12\0" + .align 2 +LC18: + .ascii "Invalid instruction opcode: 0x0D\12\0" + .align 2 +LC19: + .ascii "Invalid instruction opcode: 0x0E\12\0" + .align 2 +LC20: + .ascii "Invalid instruction opcode: 0x0F\12\0" + .align 2 +LC21: + .ascii "Invalid instruction opcode: 0x10\12\0" +LC22: + .ascii "l.jr\0" +LC23: + .ascii "l.jalr\0" +LC24: + .ascii "l.maci\0" + .align 2 +LC25: + .ascii "Invalid instruction opcode: 0x14\12\0" + .align 2 +LC26: + .ascii "Invalid instruction opcode: 0x15\12\0" + .align 2 +LC27: + .ascii "Invalid instruction opcode: 0x16\12\0" + .align 2 +LC28: + .ascii "Invalid instruction opcode: 0x17\12\0" + .align 2 +LC29: + .ascii "Invalid instruction opcode: 0x18\12\0" + .align 2 +LC30: + .ascii "Invalid instruction opcode: 0x19\12\0" + .align 2 +LC31: + .ascii "Invalid instruction opcode: 0x1A\12\0" + .align 2 +LC32: + .ascii "Invalid instruction opcode: 0x1B\12\0" +LC33: + .ascii "l.cust1\12\0" +LC34: + .ascii "l.cust2\12\0" +LC35: + .ascii "l.cust3\12\0" +LC36: + .ascii "l.cust4\12\0" +LC37: + .ascii "l.ld\0" +LC38: + .ascii "l.lwz\0" +LC39: + .ascii "l.lws\0" +LC40: + .ascii "l.lbz\0" +LC41: + .ascii "l.lbs\0" +LC42: + .ascii "l.lhz\0" +LC43: + .ascii "l.lhs\0" +LC44: + .ascii "l.addi\0" +LC45: + .ascii "l.addic\0" +LC46: + .ascii "l.andi\0" +LC47: + .ascii "l.ori\0" +LC48: + .ascii "l.xori\0" +LC49: + .ascii "l.muli\0" +LC50: + .ascii "l.mfspr\0" +LC51: + .ascii "l.slli\0" +LC52: + .ascii "l.srli\0" +LC53: + .ascii "l.srai\0" +LC54: + .ascii "l.rori\0" + .align 2 +LC55: + .ascii "Unknown instruction. Opcode 0x2E.\12\0" +LC56: + .ascii "l.sfeqi\0" +LC57: + .ascii "l.sfnei\0" +LC58: + .ascii "l.sfgtui\0" +LC59: + .ascii "l.sfgeui\0" +LC60: + .ascii "l.sfltui\0" +LC61: + .ascii "l.sfleui\0" +LC62: + .ascii "l.sfgtsi\0" +LC63: + .ascii "l.sfgesi\0" +LC64: + .ascii "l.sfltsi\0" +LC65: + .ascii "l.sflesi\0" + .align 2 +LC66: + .ascii "Unknown instruction. Opcode 0x2F\12\0" +LC67: + .ascii "l.mtspr\0" +LC68: + .ascii "l.mac\0" +LC69: + .ascii "l.msb\0" + .align 2 +LC70: + .ascii "Unknown instruction. Opcode 0x31.\12\0" +LC71: + .ascii "lf. floating point operation\12\0" + .align 2 +LC72: + .ascii "Invalid instruction opcode: 0x33\12\0" +LC73: + .ascii "l.sd\0" +LC74: + .ascii "l.sw\0" +LC75: + .ascii "l.sb\0" +LC76: + .ascii "l.sh\0" +LC77: + .ascii "l.add\0" +LC78: + .ascii "l.addc\0" +LC79: + .ascii "l.sub\0" +LC80: + .ascii "l.and\0" +LC81: + .ascii "l.or\0" +LC82: + .ascii "l.xor\0" +LC83: + .ascii "l.mul\0" +LC84: + .ascii "l.sll\0" +LC85: + .ascii "l.srl\0" +LC86: + .ascii "l.sra\0" +LC87: + .ascii "l.ror\0" + .align 2 +LC88: + .ascii "Unknown arithmetic shifting instruction. Opcode 0x38.\12\0" +LC89: + .ascii "l.div\0" +LC90: + .ascii "l.divu\0" +LC91: + .ascii "l.mulu\0" +LC92: + .ascii "l.exths\0" +LC93: + .ascii "l.extbs\0" +LC94: + .ascii "l.exthz\0" +LC95: + .ascii "l.extbz\0" + .align 2 +LC96: + .ascii "Unknown arithmetic extend byte of half-word instruction. Opcode 0x38.\12\0" +LC97: + .ascii "l.extws\0" +LC98: + .ascii "l.extwz\0" + .align 2 +LC99: + .ascii "Unknown arithmetic extend word instruction. Opcode 0x38.\12\0" +LC100: + .ascii "l.cmov\0" +LC101: + .ascii "l.ff1\0" +LC102: + .ascii "l.fl1\0" + .align 2 +LC103: + .ascii "Unknown bit find instruction. Opcode 0x38.\12\0" + .align 2 +LC104: + .ascii "Unknown arithmetic instruction. Opcode 0x38.\12\0" +LC105: + .ascii "l.sfeq\0" +LC106: + .ascii "l.sfne\0" +LC107: + .ascii "l.sfgtu\0" +LC108: + .ascii "l.sfgeu\0" +LC109: + .ascii "l.sfltu\0" +LC110: + .ascii "l.sfleu\0" +LC111: + .ascii "l.sfgts\0" +LC112: + .ascii "l.sfges\0" +LC113: + .ascii "l.sflts\0" +LC114: + .ascii "l.sfles\0" +LC115: + .ascii "Unknown set flag instruction\12\0" + .align 2 +LC116: + .ascii "Invalid instruction opcode: 0x3A\12\0" + .align 2 +LC117: + .ascii "Invalid instruction opcode: 0x3B\12\0" +LC118: + .ascii "l.cust5\12\0" +LC119: + .ascii "l.cust6\12\0" +LC120: + .ascii "l.cust7\12\0" +LC121: + .ascii "l.cust8\12\0" +LC122: + .ascii "Unknown instruction\12\0" + .text +_DisassemblerM$Disassembler$process: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $84, %esp + call ___i686.get_pc_thunk.bx +"L00000000034$pb": + movl 8(%ebp), %eax + shrl $26, %eax + movb %al, -18(%ebp) + movl 8(%ebp), %eax + shrl $21, %eax + andb $31, %al + movb %al, -17(%ebp) + movl 8(%ebp), %eax + shrl $16, %eax + andb $31, %al + movb %al, -16(%ebp) + movl 8(%ebp), %eax + shrl $11, %eax + andb $31, %al + movb %al, -15(%ebp) + movl 8(%ebp), %eax + movw %ax, -14(%ebp) + movl 8(%ebp), %eax + andb $15, %al + movb %al, -12(%ebp) + movl 8(%ebp), %eax + shrl $6, %eax + andb $15, %al + movb %al, -11(%ebp) + movzbw -17(%ebp), %ax + movw %ax, -10(%ebp) + leal -10(%ebp), %eax + salw $11, (%eax) + movl 8(%ebp), %eax + movl %eax, %edx + andw $2047, %dx + leal -10(%ebp), %eax + addw %dx, (%eax) + movzbl -18(%ebp), %eax + movl %eax, -68(%ebp) + cmpl $63, -68(%ebp) + ja L199 + movl -68(%ebp), %edx + sall $2, %edx + leal L264-"L00000000034$pb"(%ebx), %eax + movl (%edx,%eax), %eax + addl %ebx, %eax + jmp *%eax + .align 2,0x90 +L264: + .long L200-"L00000000034$pb" + .long L201-"L00000000034$pb" + .long L202-"L00000000034$pb" + .long L203-"L00000000034$pb" + .long L204-"L00000000034$pb" + .long L205-"L00000000034$pb" + .long L206-"L00000000034$pb" + .long L207-"L00000000034$pb" + .long L208-"L00000000034$pb" + .long L209-"L00000000034$pb" + .long L210-"L00000000034$pb" + .long L211-"L00000000034$pb" + .long L212-"L00000000034$pb" + .long L213-"L00000000034$pb" + .long L214-"L00000000034$pb" + .long L215-"L00000000034$pb" + .long L216-"L00000000034$pb" + .long L217-"L00000000034$pb" + .long L218-"L00000000034$pb" + .long L219-"L00000000034$pb" + .long L220-"L00000000034$pb" + .long L221-"L00000000034$pb" + .long L222-"L00000000034$pb" + .long L223-"L00000000034$pb" + .long L224-"L00000000034$pb" + .long L225-"L00000000034$pb" + .long L226-"L00000000034$pb" + .long L227-"L00000000034$pb" + .long L228-"L00000000034$pb" + .long L229-"L00000000034$pb" + .long L230-"L00000000034$pb" + .long L231-"L00000000034$pb" + .long L232-"L00000000034$pb" + .long L233-"L00000000034$pb" + .long L234-"L00000000034$pb" + .long L235-"L00000000034$pb" + .long L236-"L00000000034$pb" + .long L237-"L00000000034$pb" + .long L238-"L00000000034$pb" + .long L239-"L00000000034$pb" + .long L240-"L00000000034$pb" + .long L241-"L00000000034$pb" + .long L242-"L00000000034$pb" + .long L243-"L00000000034$pb" + .long L244-"L00000000034$pb" + .long L245-"L00000000034$pb" + .long L246-"L00000000034$pb" + .long L247-"L00000000034$pb" + .long L248-"L00000000034$pb" + .long L249-"L00000000034$pb" + .long L250-"L00000000034$pb" + .long L251-"L00000000034$pb" + .long L252-"L00000000034$pb" + .long L253-"L00000000034$pb" + .long L254-"L00000000034$pb" + .long L255-"L00000000034$pb" + .long L256-"L00000000034$pb" + .long L257-"L00000000034$pb" + .long L258-"L00000000034$pb" + .long L259-"L00000000034$pb" + .long L260-"L00000000034$pb" + .long L261-"L00000000034$pb" + .long L262-"L00000000034$pb" + .long L263-"L00000000034$pb" +L200: + leal LC0-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + movl 8(%ebp), %eax + andl $67108863, %eax + movl %eax, (%esp) + call L_DisassemblerM$printAddress$stub + jmp L342 +L201: + leal LC1-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + movl 8(%ebp), %eax + andl $67108863, %eax + movl %eax, (%esp) + call L_DisassemblerM$printAddress$stub + jmp L342 +L202: + leal LC2-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + jmp L342 +L203: + leal LC3-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + movl 8(%ebp), %eax + andl $67108863, %eax + movl %eax, (%esp) + call L_DisassemblerM$printAddress$stub + jmp L342 +L204: + leal LC4-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + movl 8(%ebp), %eax + andl $67108863, %eax + movl %eax, (%esp) + call L_DisassemblerM$printAddress$stub + jmp L342 +L205: + leal LC5-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + jmp L342 +L206: + movzbl -15(%ebp), %eax + andl $1, %eax + testb %al, %al + je L266 + leal LC6-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + movzbl -17(%ebp), %eax + movl %eax, (%esp) + call L_DisassemblerM$printOneReg$stub + jmp L342 +L266: + leal LC7-"L00000000034$pb"(%ebx), %eax + movl %eax, (%esp) + call _DisassemblerM$Output$print + movzwl -14(%ebp), %eax + movzbl -17(%ebp), %edx + movl %eax, 4(%esp) + movl %edx, (%esp) + call L_DisassemblerM$printRegAndImm$stub + jmp L342 +L207: + leal LC8-"L00000000034$pb"(%... [truncated message content] |
From: <qz...@us...> - 2009-03-03 11:21:30
|
Revision: 1050 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1050&view=rev Author: qzban Date: 2009-03-03 11:21:21 +0000 (Tue, 03 Mar 2009) Log Message: ----------- Added the Jennic JN5121 platform Added Paths: ----------- trunk/diku/jennic/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qz...@us...> - 2009-03-03 10:15:03
|
Revision: 1049 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1049&view=rev Author: qzban Date: 2009-03-03 10:14:26 +0000 (Tue, 03 Mar 2009) Log Message: ----------- Corrected a mistake with the dummy includes. Modified Paths: -------------- trunk/diku/mcs51/tos/platforms/nano/.platform Added Paths: ----------- trunk/diku/mcs51/tos/chips/mcs51/stdlib.h Removed Paths: ------------- trunk/diku/mcs51/tos/chips/cc2430/ctype.h trunk/diku/mcs51/tos/chips/cc2430/math.h trunk/diku/mcs51/tos/chips/cc2430/stdlib.h trunk/diku/mcs51/tos/chips/cc2430/string.h Deleted: trunk/diku/mcs51/tos/chips/cc2430/ctype.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/ctype.h 2009-03-03 09:56:09 UTC (rev 1048) +++ trunk/diku/mcs51/tos/chips/cc2430/ctype.h 2009-03-03 10:14:26 UTC (rev 1049) @@ -1,3 +0,0 @@ -/* - * Dummy to prevent inclution of system includes (that Keil don't like) - */ Deleted: trunk/diku/mcs51/tos/chips/cc2430/math.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/math.h 2009-03-03 09:56:09 UTC (rev 1048) +++ trunk/diku/mcs51/tos/chips/cc2430/math.h 2009-03-03 10:14:26 UTC (rev 1049) @@ -1,3 +0,0 @@ -/* - * Dummy to prevent inclution of system includes (that Keil don't like) - */ Deleted: trunk/diku/mcs51/tos/chips/cc2430/stdlib.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/stdlib.h 2009-03-03 09:56:09 UTC (rev 1048) +++ trunk/diku/mcs51/tos/chips/cc2430/stdlib.h 2009-03-03 10:14:26 UTC (rev 1049) @@ -1,3 +0,0 @@ -/* - * Dummy to prevent inclution of system includes (that Keil don't like) - */ Deleted: trunk/diku/mcs51/tos/chips/cc2430/string.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/string.h 2009-03-03 09:56:09 UTC (rev 1048) +++ trunk/diku/mcs51/tos/chips/cc2430/string.h 2009-03-03 10:14:26 UTC (rev 1049) @@ -1,24 +0,0 @@ -/** - * Prototypes for Keil built-in functions, that differ from glibc - * - * @author Martin Leopold <le...@di...> - */ - -#ifndef STRING_H - -#ifdef __IAR__ -#define STRING_H -extern size_t strlen(const char *); -extern void * memcpy(void *, const void *, size_t); -extern int memcmp(const void *, const void *, size_t); -extern void *memset(void *s, int val, int n); -#else -#define STRING_H -extern int strlen (char *); -extern void *memcpy (void *s1, void *s2, int n); -extern char memcmp (void *s1, void *s2, int n); -extern void *memset (void *s, char val, int n); -#endif //__KEIL__ - -#endif //STRING_H - Added: trunk/diku/mcs51/tos/chips/mcs51/stdlib.h =================================================================== --- trunk/diku/mcs51/tos/chips/mcs51/stdlib.h (rev 0) +++ trunk/diku/mcs51/tos/chips/mcs51/stdlib.h 2009-03-03 10:14:26 UTC (rev 1049) @@ -0,0 +1,3 @@ +/* + * Dummy to prevent inclution of system includes (that Keil don't like) + */ Modified: trunk/diku/mcs51/tos/platforms/nano/.platform =================================================================== --- trunk/diku/mcs51/tos/platforms/nano/.platform 2009-03-03 09:56:09 UTC (rev 1048) +++ trunk/diku/mcs51/tos/platforms/nano/.platform 2009-03-03 10:14:26 UTC (rev 1049) @@ -41,7 +41,7 @@ $CR = $ENV{"CONTRIBROOT"} if defined($ENV{"CONTRIBROOT"}); # Platform directory added by main script (so we won't add it here) -$PATH_LIST = "$ENV{'CONTRIBROOT'}/diku/mcs51/tos/chips/cc2430 $ENV{'CONTRIBROOT'}/diku/mcs51/tos/chips/mcs51"; +$PATH_LIST = "$ENV{'CONTRIBROOT'}/diku/mcs51/tos/chips/mcs51 $ENV{'CONTRIBROOT'}/diku/mcs51/tos/chips/cc2430"; @dirs = `find $PATH_LIST -type d ! -regex ".*\.svn.*"`; chomp(@dirs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qz...@us...> - 2009-03-03 09:56:36
|
Revision: 1048 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1048&view=rev Author: qzban Date: 2009-03-03 09:56:09 +0000 (Tue, 03 Mar 2009) Log Message: ----------- UART bug fixed + added dummy header files to make Keil happy Modified Paths: -------------- trunk/diku/mcs51/tos/chips/cc2430/CC2430Clock.h trunk/diku/mcs51/tos/chips/cc2430/CC2430ClockConfig.h trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc trunk/diku/mcs51/tos/chips/cc2430/usart/HalCC2430SimpleUartP.nc trunk/diku/mcs51/tos/chips/cc2430/usart/serial.h Added Paths: ----------- trunk/diku/mcs51/tos/chips/cc2430/ctype.h trunk/diku/mcs51/tos/chips/cc2430/math.h trunk/diku/mcs51/tos/chips/cc2430/stdlib.h trunk/diku/mcs51/tos/chips/cc2430/string.h Modified: trunk/diku/mcs51/tos/chips/cc2430/CC2430Clock.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/CC2430Clock.h 2009-03-03 07:09:47 UTC (rev 1047) +++ trunk/diku/mcs51/tos/chips/cc2430/CC2430Clock.h 2009-03-03 09:56:09 UTC (rev 1048) @@ -54,36 +54,36 @@ TIMER_TICK_250KHZ = CC2430_TICKF_DIV_128, }; - #define BAUD_E() ( \ - (USART_BAUD_RATE==2400) ? 6 + SYSCLK : \ - (USART_BAUD_RATE==4800) ? 7 + SYSCLK : \ - (USART_BAUD_RATE==9600) ? 8 + SYSCLK : \ - (USART_BAUD_RATE==14400) ? 8 + SYSCLK : \ - (USART_BAUD_RATE==19200) ? 9 + SYSCLK : \ - (USART_BAUD_RATE==28800) ? 9 + SYSCLK : \ - (USART_BAUD_RATE==38400) ? 10 + SYSCLK : \ - (USART_BAUD_RATE==57600) ? 10 + SYSCLK : \ - (USART_BAUD_RATE==76800) ? 11 + SYSCLK : \ - (USART_BAUD_RATE==115200) ? 11 + SYSCLK : \ - (USART_BAUD_RATE==153600) ? 12 + SYSCLK : \ - (USART_BAUD_RATE==230400) ? 12 + SYSCLK : \ - (USART_BAUD_RATE==307200) ? 13 + SYSCLK : \ + #define BAUD_E(rate) ( \ + (rate==2400) ? 6 + SYSCLK : \ + (rate==4800) ? 7 + SYSCLK : \ + (rate==9600) ? 8 + SYSCLK : \ + (rate==14400) ? 8 + SYSCLK : \ + (rate==19200) ? 9 + SYSCLK : \ + (rate==28800) ? 9 + SYSCLK : \ + (rate==38400) ? 10 + SYSCLK : \ + (rate==57600) ? 10 + SYSCLK : \ + (rate==76800) ? 11 + SYSCLK : \ + (rate==115200) ? 11 + SYSCLK : \ + (rate==153600) ? 12 + SYSCLK : \ + (rate==230400) ? 12 + SYSCLK : \ + (rate==307200) ? 13 + SYSCLK : \ 0 ) - #define BAUD_M() ( \ - (USART_BAUD_RATE==2400) ? 59 : \ - (USART_BAUD_RATE==4800) ? 59 : \ - (USART_BAUD_RATE==9600) ? 59 : \ - (USART_BAUD_RATE==14400) ? 216 : \ - (USART_BAUD_RATE==19200) ? 59 : \ - (USART_BAUD_RATE==28800) ? 216 : \ - (USART_BAUD_RATE==38400) ? 59 : \ - (USART_BAUD_RATE==57600) ? 216 : \ - (USART_BAUD_RATE==76800) ? 59 : \ - (USART_BAUD_RATE==115200) ? 216 : \ - (USART_BAUD_RATE==153600) ? 59 : \ - (USART_BAUD_RATE==230400) ? 216 : \ - (USART_BAUD_RATE==307200) ? 59 : \ + #define BAUD_M(rate) ( \ + (rate==2400) ? 59 : \ + (rate==4800) ? 59 : \ + (rate==9600) ? 59 : \ + (rate==14400) ? 216 : \ + (rate==19200) ? 59 : \ + (rate==28800) ? 216 : \ + (rate==38400) ? 59 : \ + (rate==57600) ? 216 : \ + (rate==76800) ? 59 : \ + (rate==115200) ? 216 : \ + (rate==153600) ? 59 : \ + (rate==230400) ? 216 : \ + (rate==307200) ? 59 : \ 0 ) #endif \ No newline at end of file Modified: trunk/diku/mcs51/tos/chips/cc2430/CC2430ClockConfig.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/CC2430ClockConfig.h 2009-03-03 07:09:47 UTC (rev 1047) +++ trunk/diku/mcs51/tos/chips/cc2430/CC2430ClockConfig.h 2009-03-03 09:56:09 UTC (rev 1048) @@ -40,10 +40,10 @@ #define _H_CC2430CLOCKCONFIG_H // Why warn? Are those setting bad in some way? -// #warning Using default clock configuration +//#warning Using default clock configuration #ifndef SYSCLK - #define SYSCLK SYSCLK_16MHZ + #define SYSCLK SYSCLK_32MHZ #endif #ifndef OSC32K Added: trunk/diku/mcs51/tos/chips/cc2430/ctype.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/ctype.h (rev 0) +++ trunk/diku/mcs51/tos/chips/cc2430/ctype.h 2009-03-03 09:56:09 UTC (rev 1048) @@ -0,0 +1,3 @@ +/* + * Dummy to prevent inclution of system includes (that Keil don't like) + */ Added: trunk/diku/mcs51/tos/chips/cc2430/math.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/math.h (rev 0) +++ trunk/diku/mcs51/tos/chips/cc2430/math.h 2009-03-03 09:56:09 UTC (rev 1048) @@ -0,0 +1,3 @@ +/* + * Dummy to prevent inclution of system includes (that Keil don't like) + */ Modified: trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc 2009-03-03 07:09:47 UTC (rev 1047) +++ trunk/diku/mcs51/tos/chips/cc2430/radio/HalCC2430RadioP.nc 2009-03-03 09:56:09 UTC (rev 1048) @@ -75,7 +75,7 @@ void CC2430PALevelSet(uint8_t new_power); void CC2430ControlSet(); void CC2430TxWait(); - void wait(uint16_t u); + void uwait(uint16_t u); task void initTask(); @@ -240,7 +240,7 @@ } /* wait 8 symbol periods (128 us) */ - wait(128); + uwait(128); /* check if channel is busy */ if ( !(_CC2430_RFSTATUS & _BV(CC2430_RFSTATUS_CCA)) ) { @@ -831,7 +831,7 @@ while ( (_CC2430_RFSTATUS & _BV(CC2430_RFSTATUS_TX_ACTIVE) ) && (i < 50) ) { - wait(100); + uwait(100); i++; } @@ -839,11 +839,11 @@ } /********************************************************************** - * wait + * uwait * Guess: loop size is perhaps 10 cycles including load/store of 16 bit value * 32 MHz equals 32 cycles pr. us. *********************************************************************/ - inline void wait(uint16_t u) + inline void uwait(uint16_t u) { uint8_t j; uint16_t i; Added: trunk/diku/mcs51/tos/chips/cc2430/stdlib.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/stdlib.h (rev 0) +++ trunk/diku/mcs51/tos/chips/cc2430/stdlib.h 2009-03-03 09:56:09 UTC (rev 1048) @@ -0,0 +1,3 @@ +/* + * Dummy to prevent inclution of system includes (that Keil don't like) + */ Added: trunk/diku/mcs51/tos/chips/cc2430/string.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/string.h (rev 0) +++ trunk/diku/mcs51/tos/chips/cc2430/string.h 2009-03-03 09:56:09 UTC (rev 1048) @@ -0,0 +1,24 @@ +/** + * Prototypes for Keil built-in functions, that differ from glibc + * + * @author Martin Leopold <le...@di...> + */ + +#ifndef STRING_H + +#ifdef __IAR__ +#define STRING_H +extern size_t strlen(const char *); +extern void * memcpy(void *, const void *, size_t); +extern int memcmp(const void *, const void *, size_t); +extern void *memset(void *s, int val, int n); +#else +#define STRING_H +extern int strlen (char *); +extern void *memcpy (void *s1, void *s2, int n); +extern char memcmp (void *s1, void *s2, int n); +extern void *memset (void *s, char val, int n); +#endif //__KEIL__ + +#endif //STRING_H + Modified: trunk/diku/mcs51/tos/chips/cc2430/usart/HalCC2430SimpleUartP.nc =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/usart/HalCC2430SimpleUartP.nc 2009-03-03 07:09:47 UTC (rev 1047) +++ trunk/diku/mcs51/tos/chips/cc2430/usart/HalCC2430SimpleUartP.nc 2009-03-03 09:56:09 UTC (rev 1048) @@ -50,6 +50,10 @@ command error_t Init.init() { + // Make Keil do the right stuff. + ser_rate_t fakeBaud = USART_BAUD_RATE; + uint32_t baud = fakeBaud*75ul; + // PERCFG selects beween alternative pin mappings for the // peripherals PERCFG.U0CFG == PERCFG.U0CFG select Uart0 as part // of port0 (U0CFG=0) or port1 (U0CFG=1) @@ -60,8 +64,8 @@ P0_ALT |= 0x0Cu; // Aka P0SEL // Configure baud rate. - U0GCR = BAUD_E(); - U0BAUD = BAUD_M(); + U0GCR = BAUD_E(baud); + U0BAUD = BAUD_M(baud); U0CSR |= 0x80u | 0x40u; // U0CSR.Mode=1 | U0CSR.ReceiveEnable=1 U0UCR |= (0x2u | 0x80u); //((HIGH_STOP) | FLUSH) Modified: trunk/diku/mcs51/tos/chips/cc2430/usart/serial.h =================================================================== --- trunk/diku/mcs51/tos/chips/cc2430/usart/serial.h 2009-03-03 07:09:47 UTC (rev 1047) +++ trunk/diku/mcs51/tos/chips/cc2430/usart/serial.h 2009-03-03 09:56:09 UTC (rev 1048) @@ -46,19 +46,26 @@ * large constant enums */ typedef enum { - B2400=2400UL, - B4800=4800UL, - B9600=9600UL, - B14400=14400UL, - B19200=19200UL, - B28800=28800UL, - B38400=38400UL, - B57600=57600UL, - B76800=76800UL, - B115200=115200UL, - B153600=153600UL, - B230400=230400UL, - B307200=307200UL + B75=1u, + B150=2U, + B300=4U, + B600=8U, + B1200=16U, + B1800=24U, + B2400=32U, + B4800=64U, + B9600=128U, + B19200=256U, + B38400=512U, + B57600=768U, + B76800=1024U, + B115200=1536U, + B230400=3072U, + B460800=6144U, + B576000=7680U, + B921600=12288U, + B1152000=15360U, + B3000000=40000U, } ser_rate_t; #endif //_H_SERIAL_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qz...@us...> - 2009-03-03 07:10:15
|
Revision: 1047 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1047&view=rev Author: qzban Date: 2009-03-03 07:09:47 +0000 (Tue, 03 Mar 2009) Log Message: ----------- Adding a newer revision of tiny15four Added Paths: ----------- trunk/diku/tiny15four/ trunk/diku/tiny15four/.project trunk/diku/tiny15four/apps/ trunk/diku/tiny15four/apps/Makerules trunk/diku/tiny15four/apps/beacon_test/ trunk/diku/tiny15four/apps/beacon_test/ping/ trunk/diku/tiny15four/apps/beacon_test/ping/Makefile trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc trunk/diku/tiny15four/apps/beacon_test/pong/ trunk/diku/tiny15four/apps/beacon_test/pong/Makefile trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc trunk/diku/tiny15four/apps/consoleTest/ trunk/diku/tiny15four/apps/consoleTest/ConsoleTestC.nc trunk/diku/tiny15four/apps/consoleTest/ConsoleTestP.nc trunk/diku/tiny15four/apps/consoleTest/Makefile trunk/diku/tiny15four/apps/gts_test/ trunk/diku/tiny15four/apps/gts_test/ping/ trunk/diku/tiny15four/apps/gts_test/ping/Makefile trunk/diku/tiny15four/apps/gts_test/ping/ping.nc trunk/diku/tiny15four/apps/gts_test/ping/pingM.nc trunk/diku/tiny15four/apps/gts_test/pong/ trunk/diku/tiny15four/apps/gts_test/pong/Makefile trunk/diku/tiny15four/apps/gts_test/pong/pong.nc trunk/diku/tiny15four/apps/gts_test/pong/pongM.nc trunk/diku/tiny15four/apps/non_beacon_test/ trunk/diku/tiny15four/apps/non_beacon_test/ping/ trunk/diku/tiny15four/apps/non_beacon_test/ping/Makefile trunk/diku/tiny15four/apps/non_beacon_test/ping/ping.nc trunk/diku/tiny15four/apps/non_beacon_test/ping/pingM.nc trunk/diku/tiny15four/apps/non_beacon_test/pong/ trunk/diku/tiny15four/apps/non_beacon_test/pong/Makefile trunk/diku/tiny15four/apps/non_beacon_test/pong/pong.nc trunk/diku/tiny15four/apps/non_beacon_test/pong/pongM.nc trunk/diku/tiny15four/apps/p2p_test/ trunk/diku/tiny15four/apps/p2p_test/ping/ trunk/diku/tiny15four/apps/p2p_test/ping/Makefile trunk/diku/tiny15four/apps/p2p_test/ping/ping.nc trunk/diku/tiny15four/apps/p2p_test/ping/pingM.nc trunk/diku/tiny15four/apps/p2p_test/pong/ trunk/diku/tiny15four/apps/p2p_test/pong/Makefile trunk/diku/tiny15four/apps/p2p_test/pong/pong.nc trunk/diku/tiny15four/apps/p2p_test/pong/pongM.nc trunk/diku/tiny15four/apps/radioTest/ trunk/diku/tiny15four/apps/radioTest/Makefile trunk/diku/tiny15four/apps/radioTest/RadioTestC.nc trunk/diku/tiny15four/apps/radioTest/RadioTestP.nc trunk/diku/tiny15four/apps/timerTest/ trunk/diku/tiny15four/apps/timerTest/Makefile trunk/diku/tiny15four/apps/timerTest/TimerTestC.nc trunk/diku/tiny15four/apps/timerTest/TimerTestP.nc trunk/diku/tiny15four/support/ trunk/diku/tiny15four/support/make/ trunk/diku/tiny15four/support/make/freescale802154.extra trunk/diku/tiny15four/support/make/tiny15four.extra trunk/diku/tiny15four/todo trunk/diku/tiny15four/tos/ trunk/diku/tiny15four/tos/chips/ trunk/diku/tiny15four/tos/chips/cc2430/ trunk/diku/tiny15four/tos/chips/cc2430/DebugC.nc trunk/diku/tiny15four/tos/chips/cc2430/HPLTimerP.nc trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/chips/cc2430/Tiny15FourTimerC.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/ trunk/diku/tiny15four/tos/chips/cc2430/phy/MacTimer.h trunk/diku/tiny15four/tos/chips/cc2430/phy/MacTimerP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/PhyAttributes.h trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430CspHandlerP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430InterruptHandlerP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyAttributesP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyEnergyDetectP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyReceiveP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/cc2430PhyTransmitP.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/csp.h trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/ trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430AckControl.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430CspEnergyDetect.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430CspInterrupt.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430CspRandom.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430CspReceive.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430CspTransmit.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430RxInterrupt.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/interfaces/cc2430TxInterrupt.nc trunk/diku/tiny15four/tos/chips/cc2430/phy/radioStates.h trunk/diku/tiny15four/tos/chips/cc2430/time.h trunk/diku/tiny15four/tos/chips/mc13192/ trunk/diku/tiny15four/tos/chips/mc13192/PhyAttributes.h trunk/diku/tiny15four/tos/chips/mc13192/Tiny15FourPhyC.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192Filters.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverConst.h trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyDriverM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInitM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInterrupt.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyInterruptM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimer.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192PhyTimerM.nc trunk/diku/tiny15four/tos/chips/mc13192/mc13192Registers.h trunk/diku/tiny15four/tos/chips/mc9s08gb60/ trunk/diku/tiny15four/tos/chips/mc9s08gb60/HPLTimerP.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/HplSpiP.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourRandomC.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/Tiny15FourTimerC.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/interfaces/ trunk/diku/tiny15four/tos/chips/mc9s08gb60/interfaces/FastSPI.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/mc13192SpiC.nc trunk/diku/tiny15four/tos/chips/mc9s08gb60/time.h trunk/diku/tiny15four/tos/interfaces/ trunk/diku/tiny15four/tos/interfaces/IeeeIndication.nc trunk/diku/tiny15four/tos/interfaces/IeeeIndicationResponse.nc trunk/diku/tiny15four/tos/interfaces/IeeeRequest.nc trunk/diku/tiny15four/tos/interfaces/IeeeRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/IeeeSyncRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/debug/ trunk/diku/tiny15four/tos/interfaces/debug/BufferedUart.nc trunk/diku/tiny15four/tos/interfaces/debug/ConsoleInput.nc trunk/diku/tiny15four/tos/interfaces/debug/ConsoleOutput.nc trunk/diku/tiny15four/tos/interfaces/debug/Debug.nc trunk/diku/tiny15four/tos/interfaces/mac/ trunk/diku/tiny15four/tos/interfaces/mac/BeaconDataService.nc trunk/diku/tiny15four/tos/interfaces/mac/BeaconGenerator.nc trunk/diku/tiny15four/tos/interfaces/mac/BeaconGtsService.nc trunk/diku/tiny15four/tos/interfaces/mac/CallbackService.nc trunk/diku/tiny15four/tos/interfaces/mac/CapEvents.nc trunk/diku/tiny15four/tos/interfaces/mac/CapRx.nc trunk/diku/tiny15four/tos/interfaces/mac/CapTx.nc trunk/diku/tiny15four/tos/interfaces/mac/CfpTx.nc trunk/diku/tiny15four/tos/interfaces/mac/Csma.nc trunk/diku/tiny15four/tos/interfaces/mac/Ed.nc trunk/diku/tiny15four/tos/interfaces/mac/FrameRx.nc trunk/diku/tiny15four/tos/interfaces/mac/FrameTx.nc trunk/diku/tiny15four/tos/interfaces/mac/IndirectTx.nc trunk/diku/tiny15four/tos/interfaces/mac/MacAddress.nc trunk/diku/tiny15four/tos/interfaces/mac/MacFrame.nc trunk/diku/tiny15four/tos/interfaces/mac/ModuleControl.nc trunk/diku/tiny15four/tos/interfaces/mac/PanConflict.nc trunk/diku/tiny15four/tos/interfaces/mac/PibDatabase.nc trunk/diku/tiny15four/tos/interfaces/mac/PollEvents.nc trunk/diku/tiny15four/tos/interfaces/mac/PollService.nc trunk/diku/tiny15four/tos/interfaces/mac/Realignment.nc trunk/diku/tiny15four/tos/interfaces/mac/Reset.nc trunk/diku/tiny15four/tos/interfaces/mac/RxFrame.nc trunk/diku/tiny15four/tos/interfaces/mac/ScanService.nc trunk/diku/tiny15four/tos/interfaces/mac/Superframe.nc trunk/diku/tiny15four/tos/interfaces/mac/TimingService.nc trunk/diku/tiny15four/tos/interfaces/macApi/ trunk/diku/tiny15four/tos/interfaces/macApi/IeeeAclDescriptor.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeeAddress.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeeMacPibAttribute.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeeMacSdu.nc trunk/diku/tiny15four/tos/interfaces/macApi/IeeePanDescriptor.nc trunk/diku/tiny15four/tos/interfaces/macApi/McpsDataIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/McpsDataRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/McpsPurgeRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeAssociateIndicationResponse.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeAssociateRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeBeaconNotifyIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeCommStatusIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeDisassociateIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeDisassociateRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeGetRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeGtsIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeGtsRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeOrphanIndicationResponse.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmePollRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeResetRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeRxEnableRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeScanRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeSetRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeStartRequestConfirm.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeSyncLossIndication.nc trunk/diku/tiny15four/tos/interfaces/macApi/MlmeSyncRequest.nc trunk/diku/tiny15four/tos/interfaces/macApi/macConstants.h trunk/diku/tiny15four/tos/interfaces/macApi/macTypes.h trunk/diku/tiny15four/tos/interfaces/phy/ trunk/diku/tiny15four/tos/interfaces/phy/PhyAttributes.nc trunk/diku/tiny15four/tos/interfaces/phy/PhyControl.nc trunk/diku/tiny15four/tos/interfaces/phy/PhyEnergyDetect.nc trunk/diku/tiny15four/tos/interfaces/phy/PhyReceive.nc trunk/diku/tiny15four/tos/interfaces/phy/PhyReset.nc trunk/diku/tiny15four/tos/interfaces/phy/PhyTransmit.nc trunk/diku/tiny15four/tos/interfaces/phy/PhyTypes.h trunk/diku/tiny15four/tos/interfaces/timing/ trunk/diku/tiny15four/tos/interfaces/timing/AsyncAlarm.nc trunk/diku/tiny15four/tos/interfaces/timing/LocalTime.nc trunk/diku/tiny15four/tos/interfaces/timing/SymbolChannel.nc trunk/diku/tiny15four/tos/interfaces/timing/SymbolCounter.nc trunk/diku/tiny15four/tos/interfaces/tools/ trunk/diku/tiny15four/tos/interfaces/tools/FIFOQueue.nc trunk/diku/tiny15four/tos/interfaces/tools/MemoryManager.nc trunk/diku/tiny15four/tos/interfaces/tools/QueueTypes.h trunk/diku/tiny15four/tos/interfaces/tools/Random.nc trunk/diku/tiny15four/tos/lib/ trunk/diku/tiny15four/tos/lib/Tiny15FourC.nc trunk/diku/tiny15four/tos/lib/Todo.txt trunk/diku/tiny15four/tos/lib/debug/ trunk/diku/tiny15four/tos/lib/debug/BufferedUartP.nc trunk/diku/tiny15four/tos/lib/debug/ConsoleP.nc trunk/diku/tiny15four/tos/lib/debug/Debug.h trunk/diku/tiny15four/tos/lib/debug/DebugConsoleC.nc trunk/diku/tiny15four/tos/lib/debug/DebugConsoleP.nc trunk/diku/tiny15four/tos/lib/freescale802154/ trunk/diku/tiny15four/tos/lib/freescale802154/802154.h trunk/diku/tiny15four/tos/lib/freescale802154/802_15_4.h trunk/diku/tiny15four/tos/lib/freescale802154/ADTBufferManM.nc trunk/diku/tiny15four/tos/lib/freescale802154/AbelReg.h trunk/diku/tiny15four/tos/lib/freescale802154/AppAspInterface.h trunk/diku/tiny15four/tos/lib/freescale802154/DigiType.h trunk/diku/tiny15four/tos/lib/freescale802154/Freescale802154M.nc trunk/diku/tiny15four/tos/lib/freescale802154/FreescaleBufferMngM.nc trunk/diku/tiny15four/tos/lib/freescale802154/Ieee802154Adts.h trunk/diku/tiny15four/tos/lib/freescale802154/Ieee802154C.nc trunk/diku/tiny15four/tos/lib/freescale802154/MacPhy.h trunk/diku/tiny15four/tos/lib/freescale802154/NV_Data.h trunk/diku/tiny15four/tos/lib/freescale802154/NwkMacInterface.h trunk/diku/tiny15four/tos/lib/freescale802154/PhyMacMsg.h trunk/diku/tiny15four/tos/lib/freescale802154/Phy_Spi.h trunk/diku/tiny15four/tos/lib/freescale802154/endianconv.h trunk/diku/tiny15four/tos/lib/freescale802154/macApi/ trunk/diku/tiny15four/tos/lib/freescale802154/macApi/AddressM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/McpsDataIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/McpsDataRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/McpsPurgeRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeAssociateIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeAssociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeBeaconNotifyIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeCommStatusIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeDisassociateIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeDisassociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeGetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeGtsIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeGtsRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeOrphanIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmePollRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeResetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeRxEnableRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeScanRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeSetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeStartRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeSyncLossIndicationM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/MlmeSyncRequestM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/PanDescriptorM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/PibAttributeM.nc trunk/diku/tiny15four/tos/lib/freescale802154/macApi/SduM.nc trunk/diku/tiny15four/tos/lib/mac/ trunk/diku/tiny15four/tos/lib/mac/AssociateM.nc trunk/diku/tiny15four/tos/lib/mac/BeaconGeneratorM.nc trunk/diku/tiny15four/tos/lib/mac/BeaconTrackerM.nc trunk/diku/tiny15four/tos/lib/mac/CallbackServiceM.nc trunk/diku/tiny15four/tos/lib/mac/CapControlM.nc trunk/diku/tiny15four/tos/lib/mac/CfpControlM.nc trunk/diku/tiny15four/tos/lib/mac/CsmaM.nc trunk/diku/tiny15four/tos/lib/mac/DataM.nc trunk/diku/tiny15four/tos/lib/mac/DummyM.nc trunk/diku/tiny15four/tos/lib/mac/EdM.nc trunk/diku/tiny15four/tos/lib/mac/FrameRxM.nc trunk/diku/tiny15four/tos/lib/mac/FrameTxM.nc trunk/diku/tiny15four/tos/lib/mac/FrameTxM_old.nc trunk/diku/tiny15four/tos/lib/mac/GetSetM.nc trunk/diku/tiny15four/tos/lib/mac/Ieee802154Adts.h trunk/diku/tiny15four/tos/lib/mac/IndirectTxM.nc trunk/diku/tiny15four/tos/lib/mac/MacAddressM.nc trunk/diku/tiny15four/tos/lib/mac/MacConst.h trunk/diku/tiny15four/tos/lib/mac/MacFrameM.nc trunk/diku/tiny15four/tos/lib/mac/MacPib.h trunk/diku/tiny15four/tos/lib/mac/MacPibDatabaseM.nc trunk/diku/tiny15four/tos/lib/mac/MacSuperframes.h trunk/diku/tiny15four/tos/lib/mac/OrphanHandlerM.nc trunk/diku/tiny15four/tos/lib/mac/PollM.nc trunk/diku/tiny15four/tos/lib/mac/PollServiceM.nc trunk/diku/tiny15four/tos/lib/mac/RxEnableM.nc trunk/diku/tiny15four/tos/lib/mac/ScanM.nc trunk/diku/tiny15four/tos/lib/mac/ScanServiceM.nc trunk/diku/tiny15four/tos/lib/mac/StartM.nc trunk/diku/tiny15four/tos/lib/mac/SuperframeM.nc trunk/diku/tiny15four/tos/lib/mac/TimingServiceM.nc trunk/diku/tiny15four/tos/lib/mac/Tiny15FourMacC.nc trunk/diku/tiny15four/tos/lib/mac/frame.h trunk/diku/tiny15four/tos/lib/mac/mac.h trunk/diku/tiny15four/tos/lib/mac/macFrame.h trunk/diku/tiny15four/tos/lib/mac/todo.txt trunk/diku/tiny15four/tos/lib/macApi/ trunk/diku/tiny15four/tos/lib/macApi/ADTModules/ trunk/diku/tiny15four/tos/lib/macApi/ADTModules/AddressM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/McpsDataIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/McpsDataRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/McpsPurgeRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeAssociateIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeAssociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeBeaconNotifyIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeCommStatusIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeDisassociateIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeDisassociateRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeGetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeGtsIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeGtsRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeOrphanIndicationResponseM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmePollRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeResetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeRxEnableRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeScanRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeSetRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeStartRequestConfirmM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeSyncLossIndicationM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/MlmeSyncRequestM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/PanDescriptorM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/PibAttributeM.nc trunk/diku/tiny15four/tos/lib/macApi/ADTModules/SduM.nc trunk/diku/tiny15four/tos/lib/timing/ trunk/diku/tiny15four/tos/lib/timing/AsyncAlarmC.nc trunk/diku/tiny15four/tos/lib/timing/AsyncAlarmM.nc trunk/diku/tiny15four/tos/lib/timing/LocalTime.h trunk/diku/tiny15four/tos/lib/timing/LocalTimeM.nc trunk/diku/tiny15four/tos/lib/timing/VirtualSymbolChannel.h trunk/diku/tiny15four/tos/lib/timing/VirtualSymbolChannelM.nc trunk/diku/tiny15four/tos/lib/timing/VirtualSymbolCounterM.nc trunk/diku/tiny15four/tos/lib/tools/ trunk/diku/tiny15four/tos/lib/tools/FIFOQueueM.nc trunk/diku/tiny15four/tos/lib/tools/FastLfsrM.nc trunk/diku/tiny15four/tos/lib/tools/Int64Compare.h trunk/diku/tiny15four/tos/lib/tools/RandomLfsrM.nc trunk/diku/tiny15four/tos/lib/tools/SimpleBufferManM.nc trunk/diku/tiny15four/tos/lib/tools/endianconv.h trunk/diku/tiny15four/tos/platforms/ trunk/diku/tiny15four/tos/platforms/dig528/ trunk/diku/tiny15four/tos/platforms/dig528/platform.t15f trunk/diku/tiny15four/tos/platforms/nano/ trunk/diku/tiny15four/tos/platforms/nano/CC2430ClockConfig.h trunk/diku/tiny15four/tos/platforms/nano/platform.t15f Added: trunk/diku/tiny15four/.project =================================================================== --- trunk/diku/tiny15four/.project (rev 0) +++ trunk/diku/tiny15four/.project 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>Tiny15Four</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> Added: trunk/diku/tiny15four/apps/Makerules =================================================================== --- trunk/diku/tiny15four/apps/Makerules (rev 0) +++ trunk/diku/tiny15four/apps/Makerules 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,28 @@ +# Jan Flora <jan...@di...>, December 2007 + +# $(error $(MAKECMDGOALS)) +MAKERULES:=$(TOSDIR)/../tools/make/Makerules +TOSMAKE_PATH += $(TINY15FOUR_DIR)/tools/make + +MAKECMDGOALS += freescale802154 + +MICA_DERIVE=mica2 mica2dot tnode +IS_DERIVE:=$(strip $(filter $(MICA_DERIVE),$(MAKECMDGOALS))) +ifneq ($(IS_DERIVE),) +$(if $(shell avr-as --help | grep allow-dollars),$(eval PFLAGS += -Wa,--allow-dollars),) +endif + +# Include EVB13192 if needed + +# Our evb13192 base directory +ifndef TINYOS_EVB13192DIR +TINYOS_EVB13192DIR = $(TOSROOT)/contrib/diku/evb13192 +endif +export TINYOS_EVB13192DIR + +IS_EVB13192:=$(strip $(filter dig528,$(MAKECMDGOALS))) +ifneq ($(IS_EVB13192),) + TOSMAKE_PATH += $(TINYOS_EVB13192DIR)/tools/make +endif + +include $(MAKERULES) \ No newline at end of file Added: trunk/diku/tiny15four/apps/beacon_test/ping/Makefile =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/ping/Makefile (rev 0) +++ trunk/diku/tiny15four/apps/beacon_test/ping/Makefile 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,4 @@ +COMPONENT=ping +ENVIRONMENT=RFD + +include ../../Makerules Added: trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc (rev 0) +++ trunk/diku/tiny15four/apps/beacon_test/ping/ping.nc 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,81 @@ +/* Copyright (c) 2007, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/* + @author Jan Flora <jan...@di...> +*/ +#define DBG_OFF 1 +#define BEACON_SUPPORT + +configuration ping +{ + +} +implementation +{ + components Main, + pingM, + Ieee802154C, + ConsoleDebugM, + ConsoleC; + + // Wire standard control + Main.StdControl -> Ieee802154C.StdControl; + Main.StdControl -> ConsoleC.StdControl; + Main.StdControl -> pingM.StdControl; + + // Connect debug. + ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; + Ieee802154C.Debug -> ConsoleDebugM.Debug; + pingM.Debug -> ConsoleDebugM.Debug; + + // Wire interface + pingM.IeeePanDescriptor -> Ieee802154C; + pingM.IeeePibAttribute -> Ieee802154C; + pingM.IeeeSdu -> Ieee802154C; + pingM.IeeeAddress -> Ieee802154C; + + // MCPS + pingM.McpsIndicationData -> Ieee802154C.McpsIndicationData; + pingM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + + pingM.McpsDataIndication -> Ieee802154C.McpsDataIndication; + pingM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + + // MLME + pingM.MlmeRequestConfirmAssociate -> Ieee802154C.MlmeRequestConfirmAssociate; + pingM.MlmeRequestConfirmScan -> Ieee802154C.MlmeRequestConfirmScan; + pingM.MlmeRequestConfirmSet -> Ieee802154C.MlmeRequestConfirmSet; + pingM.MlmeRequestSync -> Ieee802154C.MlmeRequestSync; + pingM.MlmeIndicationSyncLoss -> Ieee802154C.MlmeIndicationSyncLoss; + + pingM.MlmeAssociateRequestConfirm -> Ieee802154C.MlmeAssociateRequestConfirm; + pingM.MlmeScanRequestConfirm -> Ieee802154C.MlmeScanRequestConfirm; + pingM.MlmeSetRequestConfirm -> Ieee802154C.MlmeSetRequestConfirm; + pingM.MlmeSyncRequest -> Ieee802154C.MlmeSyncRequest; + pingM.MlmeSyncLossIndication -> Ieee802154C.MlmeSyncLossIndication; +} + Added: trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc (rev 0) +++ trunk/diku/tiny15four/apps/beacon_test/ping/pingM.nc 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,511 @@ +/* Copyright (c) 2007, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/* + @author Jan Flora <jan...@di...> +*/ + +#include <macTypes.h> +#include <macConstants.h> +#include <Int64Compare.h> + +module pingM +{ + provides + { + interface StdControl; + } + uses + { + interface IeeeMacPibAttribute as IeeePibAttribute; + interface IeeePanDescriptor; + interface IeeeMacSdu as IeeeSdu; + interface IeeeAddress; + + interface McpsDataIndication; + interface McpsDataRequestConfirm; + + interface MlmeAssociateRequestConfirm; + interface MlmeScanRequestConfirm; + interface MlmeSetRequestConfirm; + interface MlmeSyncRequest; + interface MlmeSyncLossIndication; + + // MCPS + interface IeeeIndication<Mcps_DataIndication> as McpsIndicationData; + interface IeeeRequestConfirm<Mcps_DataRequestConfirm> as McpsRequestConfirmData; + + // MLME + interface IeeeRequestConfirm<Mlme_AssociateRequestConfirm> as MlmeRequestConfirmAssociate; + interface IeeeRequestConfirm<Mlme_ScanRequestConfirm> as MlmeRequestConfirmScan; + interface IeeeSyncRequestConfirm<Mlme_SetRequestConfirm> as MlmeRequestConfirmSet; + interface IeeeRequest<Mlme_SyncRequest> as MlmeRequestSync; + interface IeeeIndication<Mlme_SyncLossIndication> as MlmeIndicationSyncLoss; + + interface Debug; + } +} +implementation +{ + //#define DBG_OFF 0 + #define DBG_LEVEL 1 + #include "Debug.h" + + #ifdef PROFILING + // Set up profiling pins. + TOSH_ASSIGN_PIN(PROFILING1, C, 5); + TOSH_ASSIGN_PIN(PROFILING2, C, 6); + TOSH_ASSIGN_PIN(PROFILING3, C, 7); + TOSH_ASSIGN_PIN(PROFILING4, G, 3); + TOSH_ASSIGN_PIN(PROFILING5, G, 1); + TOSH_ASSIGN_PIN(PROFILING6, B, 7); + TOSH_ASSIGN_PIN(PROFILING7, B, 3); + TOSH_ASSIGN_PIN(PROFILING8, B, 2); + TOSH_ASSIGN_PIN(PROFILING9, B, 1); + #endif + + uint8_t logicalChannel; + uint16_t myPanId; + uint8_t myMsduHandle = 0x01; + Ieee_Address coordAddr; + uint16_t superframeSpec; + + Ieee_Address localAddr; + Ieee_Msdu myMsdu; + + char *payload = "ping"; + + // Forward declarations of helper functions. + task void doPing(); + task void doScan(); + task void associate(); + task void sync(); + void processScan(Mlme_ScanRequestConfirm scanconfirm); + void setCoordAddrInfo(); + void setBeaconOrder(); + void setSuperframeOrder(); + void setAutoRequest(bool autoRequest); + result_t setAttribute(Ieee_PibAttribute attribute); + int strcmp(const char * a, const char * b); + + command result_t StdControl.init() + { + #ifdef PROFILING + // Setup profiling pins as output pins. + TOSH_MAKE_PROFILING1_OUTPUT(); + TOSH_MAKE_PROFILING2_OUTPUT(); + TOSH_MAKE_PROFILING3_OUTPUT(); + TOSH_MAKE_PROFILING4_OUTPUT(); + TOSH_MAKE_PROFILING5_OUTPUT(); + TOSH_MAKE_PROFILING6_OUTPUT(); + TOSH_MAKE_PROFILING7_OUTPUT(); + TOSH_MAKE_PROFILING8_OUTPUT(); + TOSH_MAKE_PROFILING9_OUTPUT(); + + // Clear all pins. + TOSH_CLR_PROFILING1_PIN(); + TOSH_CLR_PROFILING2_PIN(); + TOSH_CLR_PROFILING3_PIN(); + TOSH_CLR_PROFILING4_PIN(); + TOSH_CLR_PROFILING5_PIN(); + TOSH_CLR_PROFILING6_PIN(); + TOSH_CLR_PROFILING7_PIN(); + TOSH_CLR_PROFILING8_PIN(); + TOSH_CLR_PROFILING9_PIN(); + #endif + + return SUCCESS; + } + + command result_t StdControl.start() + { + uint8_t myAddr[8] = {0x1D, 0x00, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; + memcpy(aExtendedAddress, myAddr, 8); + post doScan(); + return SUCCESS; + } + + command result_t StdControl.stop() + { + return FAIL; + } + + /******************************* + Data handling + *******************************/ + + event void McpsIndicationData.indication(Mcps_DataIndication indication) + { + char *data; + uint8_t dataLen; + + #ifdef PROFILING + TOSH_SET_PROFILING1_PIN(); + #endif + + call IeeeSdu.create(&myMsdu); + call McpsDataIndication.getMsdu(indication, myMsdu); + data = (char*)call IeeeSdu.getPayload(myMsdu); + dataLen = call IeeeSdu.getPayloadLen(myMsdu); + + if (dataLen == 5 && 0 == strcmp("pong", data)) { + DBG_STR("Received a ping reply.",1); + } else { + DBG_STR("Ignoring data received different from ping reply.",1); + DBG_DUMP(data, dataLen, 1); + } + + call McpsDataIndication.destroy(indication); + call IeeeSdu.destroy(myMsdu); + + #ifdef PROFILING + TOSH_CLR_PROFILING1_PIN(); + #endif + } + + event void McpsRequestConfirmData.confirm( Mcps_DataRequestConfirm confirm ) + { + //uint8_t handle = call McpsDataRequestConfirm.getMsduHandle(confirm); + Ieee_Status status = call McpsDataRequestConfirm.getStatus(confirm); + + if (status == IEEE802154_SUCCESS) { + DBG_STR("Ping transmitted.",1); + } else { + DBG_STR("Ping failed.",1); + } + call McpsDataRequestConfirm.destroy(confirm); + + #ifdef PROFILING + TOSH_CLR_PROFILING2_PIN(); + #endif + } + + task void doPing() + { + Mcps_DataRequestConfirm request; + + #ifdef PROFILING + TOSH_SET_PROFILING2_PIN(); + #endif + + call IeeeSdu.create( &myMsdu ); + + // Create request + call McpsDataRequestConfirm.create(&request, localAddr, coordAddr, 5); + + call McpsDataRequestConfirm.getMsdu( request, myMsdu ); + memcpy(call IeeeSdu.getPayload( myMsdu ), payload, 5); + call McpsDataRequestConfirm.setMsduHandle( request, myMsduHandle ); + call McpsDataRequestConfirm.setTxOptions( request, IEEE802154_TxOptsAck); + + if (SUCCESS == call McpsRequestConfirmData.request(request)) { + DBG_STR("Ping was enqueued.",1); + myMsduHandle++; + } else { + DBG_STR("Transmission of ping failed.",1); + } + + // Clean up. + call IeeeSdu.destroy( myMsdu ); + } + + /******************************* + Association handling + *******************************/ + + event void MlmeRequestConfirmAssociate.confirm(Mlme_AssociateRequestConfirm confirm) + { + uint16_t myShortAddr; + Ieee_Status status = call MlmeAssociateRequestConfirm.getStatus(confirm); + + if (status == IEEE802154_SUCCESS) { + myShortAddr = call MlmeAssociateRequestConfirm.getAssocShortAddress(confirm); + // Create an address ADT. + call IeeeAddress.create( &localAddr ); + call IeeeAddress.setAddrMode( localAddr, 2 ); + call IeeeAddress.setAddress( localAddr, (uint8_t*)&myShortAddr ); + call IeeeAddress.setPanId( localAddr, myPanId); + DBG_STR("Associated to PAN.",1); + post doPing(); + } else { + DBG_STR("Association failed.",1); + DBG_STRINT("Status was: ",status,1); + } + call MlmeAssociateRequestConfirm.destroy(confirm); + + #ifdef PROFILING + TOSH_CLR_PROFILING3_PIN(); + #endif + } + + task void associate() + { + Mlme_AssociateRequestConfirm request; + + #ifdef PROFILING + TOSH_SET_PROFILING3_PIN(); + #endif + + call MlmeAssociateRequestConfirm.create(&request, coordAddr); + call MlmeAssociateRequestConfirm.setLogicalChannel(request, logicalChannel); + call MlmeAssociateRequestConfirm.setCapabilityInformation(request,IEEE802154_CapInfoAllocAddr); + + if (call MlmeRequestConfirmAssociate.request(request)) + { + DBG_STR("Associating to PAN",1); + } else { + DBG_STR("Could not request association to PAN...",1); + } + } + + + /******************************* + Scan handling + *******************************/ + + event void MlmeRequestConfirmScan.confirm(Mlme_ScanRequestConfirm confirm) + { + Ieee_Status status = call MlmeScanRequestConfirm.getStatus(confirm); + uint8_t scanType = call MlmeScanRequestConfirm.getScanType(confirm); + + if (scanType == IEEE802154_PassiveScan && status == IEEE802154_SUCCESS) { + processScan(confirm); + } else { + DBG_STR("Scan failed.",1); + } + call MlmeScanRequestConfirm.destroy(confirm); + + #ifdef PROFILING + TOSH_CLR_PROFILING4_PIN(); + #endif + } + + void processScan(Mlme_ScanRequestConfirm scanconfirm) + { + uint8_t linkQuality,bestLinkQuality = 0; + uint8_t i,listSize; + uint16_t sframeSpec; + Ieee_PanDescriptor pd,bestPd = NULL; + + listSize = call MlmeScanRequestConfirm.getResultListSize(scanconfirm); + DBG_STRINT("Examining :",listSize,1); + + // Find best PAN coordinator. + for (i = 0; i < listSize; i++) { + pd = call MlmeScanRequestConfirm.getPanDescriptor(scanconfirm,i); + sframeSpec = call IeeePanDescriptor.getSuperframeSpec(pd); + + // TODO: change this to be freescale independent +/* if ( (sframeSpec & gSuperFrameSpecMsbAssocPermit_c) && + (sframeSpec>>8 & gSuperFrameSpecLsbBO_c) == 0x7 ) {*/ + linkQuality = call IeeePanDescriptor.getLinkQuality(pd); + // Get the best + if (linkQuality >= bestLinkQuality) { + bestLinkQuality = linkQuality; + bestPd = pd; + } +// } + } + + if (bestPd) { + DBG_STR("Found PAN!",1); + call IeeeAddress.create(&coordAddr); + call IeeePanDescriptor.getCoordAddr(bestPd, coordAddr); + myPanId = call IeeeAddress.getPanId(coordAddr); + DBG_STRINT("PAN Id is:",myPanId,1); + logicalChannel = call IeeePanDescriptor.getLogicalChannel(bestPd); + superframeSpec = call IeeePanDescriptor.getSuperframeSpec(bestPd); + + // Get ready to synchronize with the coordinator. + setCoordAddrInfo(); + setBeaconOrder(); + setSuperframeOrder(); + // Make device retrieve indirect data automatically + // when indicated in the beacon. + setAutoRequest(TRUE); + post sync(); + } else { + DBG_STR("No PAN.",1); + } + } + + task void doScan() + { + Mlme_ScanRequestConfirm request; + + #ifdef PROFILING + TOSH_SET_PROFILING4_PIN(); + #endif + + // Create the scan request + // Scan channels 12 - 15 + call MlmeScanRequestConfirm.create(&request); + call MlmeScanRequestConfirm.setScanType(request,IEEE802154_PassiveScan); + call MlmeScanRequestConfirm.setScanChannels(request,0x0000F000); + call MlmeScanRequestConfirm.setScanDuration(request,0x8); + + if (call MlmeRequestConfirmScan.request(request)) + { + DBG_STR("Starting scan...",1); + } + else + { + DBG_STR("Could not start scan...",1); + } + } + + /******************************* + Synchronization handling + *******************************/ + + event void MlmeIndicationSyncLoss.indication( Mlme_SyncLossIndication indication) + { + Ieee_Status reason = call MlmeSyncLossIndication.getLossReason(indication); + DBG_STRINT("Synchronization lost. Reason: ",reason,1); + call MlmeSyncLossIndication.destroy(indication); + } + + task void sync() + { + Mlme_SyncRequest request; + + #ifdef PROFILING + TOSH_SET_PROFILING5_PIN(); + #endif + + //create sync request + call MlmeSyncRequest.create( &request ); + call MlmeSyncRequest.setLogicalChannel(request, logicalChannel); + call MlmeSyncRequest.setTrackBeacon(request, TRUE); + + //do request + if (SUCCESS == call MlmeRequestSync.request( request )) { + DBG_STR("Beacon tracking requested!",1); + post associate(); + } else { + DBG_STR("Beacon tracking request failed!",1); + } + + #ifdef PROFILING + TOSH_CLR_PROFILING5_PIN(); + #endif + } + + /******************************* + PIB attribute handling + *******************************/ + + void setCoordAddrInfo() + { + Ieee_PibAttribute attribute; + + call IeeePibAttribute.create(8,&attribute); + + if (call IeeeAddress.getAddrMode(coordAddr) == 2) { + uint16_t myAddr; + call IeeeAddress.getAddress(coordAddr, (uint8_t*)&myAddr); + call IeeePibAttribute.setMacCoordShortAddress(attribute,myAddr); + } else { + uint8_t myAddr[8]; + call IeeeAddress.getAddress(coordAddr, myAddr); + call IeeePibAttribute.setMacCoordExtendedAddress(attribute,myAddr); + } + // Set coordinator address + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + + call IeeePibAttribute.create(2,&attribute); + call IeeePibAttribute.setMacPanId(attribute,call IeeeAddress.getPanId(coordAddr)); + + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + } + + void setBeaconOrder() + { + Ieee_PibAttribute attribute; + + call IeeePibAttribute.create(1,&attribute); + call IeeePibAttribute.setMacBeaconOrder(attribute,(superframeSpec&0x000F)); + + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + } + + void setSuperframeOrder() + { + Ieee_PibAttribute attribute; + + call IeeePibAttribute.create(1,&attribute); + call IeeePibAttribute.setMacSuperframeOrder(attribute,(superframeSpec&0x00F0)>>4); + + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + } + + void setAutoRequest(bool autoRequest) + { + Ieee_PibAttribute attribute; + + call IeeePibAttribute.create(1,&attribute); + call IeeePibAttribute.setMacAutoRequest(attribute,autoRequest); + + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + } + + result_t setAttribute(Ieee_PibAttribute attribute) + { + Mlme_SetRequestConfirm request; + Ieee_Status status; + call MlmeSetRequestConfirm.create(&request); + call MlmeSetRequestConfirm.setPibAttribute(request,attribute); + request = call MlmeRequestConfirmSet.request(request); + + status = call MlmeSetRequestConfirm.getStatus(request); + if (SUCCESS != call IeeePibAttribute.destroy(attribute)) { + DBG_STR("Could not destroy attribute",3); + } + call MlmeSetRequestConfirm.destroy(request); + if (status != IEEE802154_SUCCESS) { + DBG_STR("Set operation was unsuccessful!",1); + return FAIL; + } + return SUCCESS; + } + + event void MlmeRequestConfirmSet.confirm(Mlme_SetRequestConfirm confirm) + { + // We don't do anything here as we handle set requests in sync. + } + + /** Help function, does string compare */ + int strcmp(const char * a, const char * b) + { + while (*a && *b && *a == *b) { ++a; ++b; }; + return *a - *b; + } +} \ No newline at end of file Added: trunk/diku/tiny15four/apps/beacon_test/pong/Makefile =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/pong/Makefile (rev 0) +++ trunk/diku/tiny15four/apps/beacon_test/pong/Makefile 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,4 @@ +COMPONENT=pong +ENVIRONMENT=FFDNGTS + +include ../../Makerules Added: trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc (rev 0) +++ trunk/diku/tiny15four/apps/beacon_test/pong/pong.nc 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,78 @@ +/* Copyright (c) 2007, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/* + @author Jan Flora <jan...@di...> +*/ +#define DBG_OFF 1 +#define COORDINATOR_SUPPORT +#define BEACON_SUPPORT + +configuration pong +{ + +} +implementation +{ + components Main, + pongM, + Ieee802154C, + ConsoleDebugM, + ConsoleC; + + // Wire standard control + Main.StdControl -> Ieee802154C.StdControl; + Main.StdControl -> ConsoleC.StdControl; + Main.StdControl -> pongM.StdControl; + + // Connect debug. + ConsoleDebugM.ConsoleOut -> ConsoleC.ConsoleOut; + Ieee802154C.Debug -> ConsoleDebugM.Debug; + pongM.Debug -> ConsoleDebugM.Debug; + + // Wire interface + pongM.IeeePibAttribute -> Ieee802154C; + pongM.IeeeSdu -> Ieee802154C; + pongM.IeeeAddress -> Ieee802154C; + + // MCPS + pongM.McpsIndicationData -> Ieee802154C.McpsIndicationData; + pongM.McpsRequestConfirmData -> Ieee802154C.McpsRequestConfirmData; + + pongM.McpsDataIndication -> Ieee802154C.McpsDataIndication; + pongM.McpsDataRequestConfirm -> Ieee802154C.McpsDataRequestConfirm; + + // MLME + pongM.MlmeIndicationResponseAssociate -> Ieee802154C.MlmeIndicationResponseAssociate; + pongM.MlmeRequestConfirmSet -> Ieee802154C.MlmeRequestConfirmSet; + pongM.MlmeRequestConfirmStart -> Ieee802154C.MlmeRequestConfirmStart; + pongM.MlmeIndicationCommStatus -> Ieee802154C.MlmeIndicationCommStatus; + + pongM.MlmeAssociateIndicationResponse -> Ieee802154C.MlmeAssociateIndicationResponse; + pongM.MlmeSetRequestConfirm -> Ieee802154C.MlmeSetRequestConfirm; + pongM.MlmeStartRequestConfirm -> Ieee802154C.MlmeStartRequestConfirm; + pongM.MlmeCommStatusIndication -> Ieee802154C.MlmeCommStatusIndication; +} \ No newline at end of file Added: trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc =================================================================== --- trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc (rev 0) +++ trunk/diku/tiny15four/apps/beacon_test/pong/pongM.nc 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,398 @@ +/* Copyright (c) 2007, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/* + @author Jan Flora <jan...@di...> +*/ + +#include <macTypes.h> +#include <macConstants.h> +#include <Int64Compare.h> + +module pongM +{ + provides + { + interface StdControl; + } + uses + { + interface IeeeMacPibAttribute as IeeePibAttribute; + interface IeeeMacSdu as IeeeSdu; + interface IeeeAddress; + + interface McpsDataIndication; + interface McpsDataRequestConfirm; + + interface MlmeAssociateIndicationResponse; + interface MlmeSetRequestConfirm; + interface MlmeStartRequestConfirm; + interface MlmeCommStatusIndication; + + // MCPS + interface IeeeIndication<Mcps_DataIndication> as McpsIndicationData; + interface IeeeRequestConfirm<Mcps_DataRequestConfirm> as McpsRequestConfirmData; + + // MLME + interface IeeeIndicationResponse<Mlme_AssociateIndicationResponse> as MlmeIndicationResponseAssociate; + interface IeeeSyncRequestConfirm<Mlme_SetRequestConfirm> as MlmeRequestConfirmSet; + interface IeeeRequestConfirm<Mlme_StartRequestConfirm> as MlmeRequestConfirmStart; + interface IeeeIndication<Mlme_CommStatusIndication> as MlmeIndicationCommStatus; + + interface Debug; + } +} +implementation +{ + //#define DBG_OFF 0 + #define DBG_LEVEL 1 + #include "Debug.h" + + #ifdef PROFILING + // Set up profiling pins. + TOSH_ASSIGN_PIN(PROFILING1, C, 5); + TOSH_ASSIGN_PIN(PROFILING2, C, 6); + TOSH_ASSIGN_PIN(PROFILING3, C, 7); + TOSH_ASSIGN_PIN(PROFILING4, G, 3); + TOSH_ASSIGN_PIN(PROFILING5, G, 1); + TOSH_ASSIGN_PIN(PROFILING6, B, 7); + TOSH_ASSIGN_PIN(PROFILING7, B, 3); + TOSH_ASSIGN_PIN(PROFILING8, B, 2); + TOSH_ASSIGN_PIN(PROFILING9, B, 1); + #endif + + uint8_t logicalChannel = 12; + uint16_t myPanId = 0xDEAD; + uint16_t myShortAddr = 0x0001; + uint8_t myMsduHandle = 0x01; + Ieee_Address pingReplyAddr; + + // Forward declarations of helper functions. + task void pingReply(); + task void startPan(); + result_t setAttribute(Ieee_PibAttribute attribute); + void setShort(uint16_t myShort); + void setAssoc(bool allow); + void setRxOnWhenIdle(bool status); + int strcmp(const char * a, const char * b); + + command result_t StdControl.init() + { + #ifdef PROFILING + // Setup profiling pins as output pins. + TOSH_MAKE_PROFILING1_OUTPUT(); + TOSH_MAKE_PROFILING2_OUTPUT(); + TOSH_MAKE_PROFILING3_OUTPUT(); + TOSH_MAKE_PROFILING4_OUTPUT(); + TOSH_MAKE_PROFILING5_OUTPUT(); + TOSH_MAKE_PROFILING6_OUTPUT(); + TOSH_MAKE_PROFILING7_OUTPUT(); + TOSH_MAKE_PROFILING8_OUTPUT(); + TOSH_MAKE_PROFILING9_OUTPUT(); + + // Clear all pins. + TOSH_CLR_PROFILING1_PIN(); + TOSH_CLR_PROFILING2_PIN(); + TOSH_CLR_PROFILING3_PIN(); + TOSH_CLR_PROFILING4_PIN(); + TOSH_CLR_PROFILING5_PIN(); + TOSH_CLR_PROFILING6_PIN(); + TOSH_CLR_PROFILING7_PIN(); + TOSH_CLR_PROFILING8_PIN(); + TOSH_CLR_PROFILING9_PIN(); + #endif + + call IeeeAddress.create(&pingReplyAddr); + return SUCCESS; + } + + command result_t StdControl.start() + { + uint8_t myAddr[8] = {0x61, 0x03, 0x01, 0xB0, 0x37, 0xC2, 0x50, 0x00}; + memcpy(aExtendedAddress, myAddr, 8); + post startPan(); + return SUCCESS; + } + + command result_t StdControl.stop() + { + return FAIL; + } + + /******************************* + Data handling + *******************************/ + + event void McpsIndicationData.indication(Mcps_DataIndication indication) + { + Ieee_Msdu msdu; + char *payload; + uint8_t payloadLen; + + #ifdef PROFILING + TOSH_SET_PROFILING1_PIN(); + #endif + + call IeeeSdu.create(&msdu); + call McpsDataIndication.getMsdu(indication, msdu); + payload = (char*)call IeeeSdu.getPayload(msdu); + payloadLen = call IeeeSdu.getPayloadLen(msdu); + + if (payloadLen == 5 && 0 == strcmp("ping", payload)) { + DBG_STR("Received a ping request.",1); + call McpsDataIndication.getSrcAddress(indication, pingReplyAddr); + post pingReply(); + } else { + DBG_STR("Ignoring data received different from ping request.",1); + DBG_DUMP(payload, payloadLen, 1); + } + + call McpsDataIndication.destroy(indication); + call IeeeSdu.destroy(msdu); + + #ifdef PROFILING + TOSH_CLR_PROFILING1_PIN(); + #endif + } + + event void McpsRequestConfirmData.confirm( Mcps_DataRequestConfirm confirm ) + { + //uint8_t handle = call McpsDataRequestConfirm.getMsduHandle(confirm); + Ieee_Status status = call McpsDataRequestConfirm.getStatus(confirm); + + if (status == IEEE802154_SUCCESS) { + DBG_STR("Ping reply transmitted.",1); + } else { + DBG_STR("Ping reply failed.",1); + } + call McpsDataRequestConfirm.destroy(confirm); + + #ifdef PROFILING + TOSH_CLR_PROFILING2_PIN(); + #endif + } + + task void pingReply() + { + Ieee_Address srcAddr; + Mcps_DataRequestConfirm request; + Ieee_Msdu myMsdu; + char *payload = "pong"; + + #ifdef PROFILING + TOSH_SET_PROFILING2_PIN(); + #endif + + if (FAIL == call IeeeAddress.create( &srcAddr )) { + DBG_STR("Failed to allocate SrcAddr",1); + } + if (FAIL == call IeeeSdu.create( &myMsdu )) { + DBG_STR("Failed to allocate SDU",1); + } + + // Fill out the source address. + call IeeeAddress.setAddrMode( srcAddr, 2 ); + call IeeeAddress.setAddress( srcAddr, (uint8_t*)&myShortAddr ); + call IeeeAddress.setPanId( srcAddr, myPanId); + + // Create request + call McpsDataRequestConfirm.create(&request, srcAddr, pingReplyAddr, 5); + + call McpsDataRequestConfirm.getMsdu( request, myMsdu ); + memcpy(call IeeeSdu.getPayload( myMsdu ), payload, 5); + call McpsDataRequestConfirm.setMsduHandle( request, myMsduHandle ); + call McpsDataRequestConfirm.setTxOptions( request, (IEEE802154_TxOptsAck | IEEE802154_TxOptsIndirectTx) ); + + if (SUCCESS == call McpsRequestConfirmData.request(request)) { + DBG_STR("Ping reply was enqueued.",1); + myMsduHandle++; + } else { + DBG_STR("Transmission of ping reply failed.",1); + } + + // Clean up. + call IeeeAddress.destroy( srcAddr ); + call IeeeSdu.destroy( myMsdu ); + } + + /******************************* + Association handling + *******************************/ + + async event void MlmeIndicationResponseAssociate.indication( Mlme_AssociateIndicationResponse indication ) + { + uint8_t assocDeviceAddr[8]; + + #ifdef PROFILING + TOSH_SET_PROFILING3_PIN(); + #endif + + call MlmeAssociateIndicationResponse.getDeviceAddress(indication, assocDeviceAddr); + DBG_STR("Device with address:",1); + DBG_DUMP(assocDeviceAddr, 8, 1); + DBG_STR("is requesting association.",1); + + // Assign short address 0xBEEF to the device. + call MlmeAssociateIndicationResponse.setDeviceAddress(indication,assocDeviceAddr); + call MlmeAssociateIndicationResponse.setAssocShortAddress(indication,0xBEEF); + call MlmeAssociateIndicationResponse.setStatus(indication,IEEE802154_SUCCESS); + call MlmeIndicationResponseAssociate.response(indication); + + #ifdef PROFILING + TOSH_CLR_PROFILING3_PIN(); + #endif + } + + event void MlmeIndicationCommStatus.indication( Mlme_CommStatusIndication indication ) + { + Ieee_Status status; + + // The comm status indication must be the result of an association response. + status = call MlmeCommStatusIndication.getStatus(indication); + + if (status == IEEE802154_SUCCESS) { + DBG_STR("Requesting device was granted association.",1); + } else { + DBG_STRINT("Transmitting associatin response failed with status: ",status,1); + } + + // Clean up. + call MlmeCommStatusIndication.destroy(indication); + } + + /******************************* + PAN coordinator role handling + *******************************/ + + task void startPan() + { + Mlme_StartRequestConfirm request; + + #ifdef PROFILING + TOSH_SET_PROFILING4_PIN(); + #endif + + DBG_STR("Starting up device as beaconing PAN coordinator...",1); + + // Set my short address and association permit first. + setShort(myShortAddr); + setAssoc(TRUE); + setRxOnWhenIdle(TRUE); + + // Establish device as a PAN coordinator. + call MlmeStartRequestConfirm.create(&request); + call MlmeStartRequestConfirm.setPanId(request,myPanId); + call MlmeStartRequestConfirm.setLogicalChannel(request,logicalChannel); + call MlmeStartRequestConfirm.setBeaconOrder(request,0x8); + call MlmeStartRequestConfirm.setSuperframeOrder(request,0x8); + call MlmeStartRequestConfirm.setPanCoordinator(request,TRUE); + call MlmeStartRequestConfirm.setBatteryLifeExtension(request,FALSE); + call MlmeStartRequestConfirm.setCoordRealignment(request,FALSE); + call MlmeStartRequestConfirm.setSecurityEnable(request,FALSE); + call MlmeRequestConfirmStart.request(request); + } + + event void MlmeRequestConfirmStart.confirm(Mlme_StartRequestConfirm confirm) + { + Ieee_Status status = call MlmeStartRequestConfirm.getStatus(confirm); + if (status == IEEE802154_SUCCESS) { + DBG_STR("Device is now acting as PAN coordinator.",1); + } else { + DBG_STRINT("Start request failed with status: ",status,1); + } + call MlmeStartRequestConfirm.destroy(confirm); + + #ifdef PROFILING + TOSH_CLR_PROFILING4_PIN(); + #endif + } + + /******************************* + PIB attribute handling + *******************************/ + + void setRxOnWhenIdle(bool status) + { + Ieee_PibAttribute attribute; + call IeeePibAttribute.create(1,&attribute); + call IeeePibAttribute.setMacRxOnWhenIdle(attribute,status); + + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + } + + void setShort(uint16_t myShort) + { + Ieee_PibAttribute attribute; + call IeeePibAttribute.create(2,&attribute); + call IeeePibAttribute.setMacShortAddress(attribute,myShort); + + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + } + + void setAssoc(bool allow) + { + Ieee_PibAttribute attribute; + call IeeePibAttribute.create(1,&attribute); + call IeeePibAttribute.setMacAssociationPermit(attribute,allow); + + // setAttribute is responsible for destroying the primitive. + setAttribute(attribute); + } + + result_t setAttribute(Ieee_PibAttribute attribute) + { + Mlme_SetRequestConfirm request; + Ieee_Status status; + call MlmeSetRequestConfirm.create(&request); + call MlmeSetRequestConfirm.setPibAttribute(request,attribute); + request = call MlmeRequestConfirmSet.request(request); + + status = call MlmeSetRequestConfirm.getStatus(request); + if (SUCCESS != call IeeePibAttribute.destroy(attribute)) { + DBG_STR("Could not destroy attribute",3); + } + call MlmeSetRequestConfirm.destroy(request); + if (status != IEEE802154_SUCCESS) { + DBG_STR("Set operation was unsuccessful!",1); + return FAIL; + } + return SUCCESS; + } + + event void MlmeRequestConfirmSet.confirm(Mlme_SetRequestConfirm confirm) + { + // We don't do anything here as we handle set requests in sync. + } + + /** Help function, does string compare */ + int strcmp(const char * a, const char * b) + { + while (*a && *b && *a == *b) { ++a; ++b; }; + return *a - *b; + } +} \ No newline at end of file Added: trunk/diku/tiny15four/apps/consoleTest/ConsoleTestC.nc =================================================================== --- trunk/diku/tiny15four/apps/consoleTest/ConsoleTestC.nc (rev 0) +++ trunk/diku/tiny15four/apps/consoleTest/ConsoleTestC.nc 2009-03-03 07:09:47 UTC (rev 1047) @@ -0,0 +1,42 @@ +/* Copyright (c) 2008, Jan Flora <jan...@di...> + * 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 University of Copenhagen 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. + */ + +/** + * @author Jan Flora <jan...@di...> + */ + +configuration ConsoleTestC +{ +} +implementation +{ + components MainC, + DebugC, + ConsoleTestP; + + ConsoleTestP.Boot -> MainC.Boot; + ConsoleTestP.Debug -> DebugC.Debug; +} \ No newline at end of file Added: trunk/dik... [truncated message content] |
From: <qz...@us...> - 2009-03-03 06:57:02
|
Revision: 1046 http://tinyos8051wg.svn.sourceforge.net/tinyos8051wg/?rev=1046&view=rev Author: qzban Date: 2009-03-03 06:56:48 +0000 (Tue, 03 Mar 2009) Log Message: ----------- Remove old tiny15four dir Added Paths: ----------- trunk/diku/.project Removed Paths: ------------- trunk/diku/Tiny15Four/ Added: trunk/diku/.project =================================================================== --- trunk/diku/.project (rev 0) +++ trunk/diku/.project 2009-03-03 06:56:48 UTC (rev 1046) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tinyos8051wg</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |