From 5683b66613c4182b6ec6a8e869bfa711c1f8b224 Mon Sep 17 00:00:00 2001 From: razvanm Date: Thu, 17 Sep 2009 23:35:02 +0000 Subject: [PATCH] Store the defines for default lpl in a global header file. --- tos/chips/cc2420/CC2420.h | 11 --------- tos/chips/cc2420/lpl/DefaultLpl.h | 8 ------- tos/chips/cc2420/lpl/DefaultLplP.nc | 1 + .../rf2xx/layers/LowPowerListeningLayerP.nc | 4 ---- tos/system/SystemLowPowerListeningP.nc | 2 ++ tos/types/Lpl.h | 23 +++++++++++++++++++ 6 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 tos/types/Lpl.h diff --git a/tos/chips/cc2420/CC2420.h b/tos/chips/cc2420/CC2420.h index a350b5b6..91138798 100644 --- a/tos/chips/cc2420/CC2420.h +++ b/tos/chips/cc2420/CC2420.h @@ -183,17 +183,6 @@ typedef nx_struct cc2420_packet_t { #define TINYOS_6LOWPAN_NETWORK_ID 0x3f #endif -/** - * The LPL defaults to stay-on. - */ -#ifndef LPL_DEF_LOCAL_WAKEUP -#define LPL_DEF_LOCAL_WAKEUP 0 -#endif - -#ifndef LPL_DEF_REMOTE_WAKEUP -#define LPL_DEF_REMOTE_WAKEUP 0 -#endif - enum { // size of the header not including the length byte MAC_HEADER_SIZE = sizeof( cc2420_header_t ) - 1, diff --git a/tos/chips/cc2420/lpl/DefaultLpl.h b/tos/chips/cc2420/lpl/DefaultLpl.h index f74db43b..760ece79 100644 --- a/tos/chips/cc2420/lpl/DefaultLpl.h +++ b/tos/chips/cc2420/lpl/DefaultLpl.h @@ -47,14 +47,6 @@ typedef enum { } lpl_sendstate_t; -/** - * Amount of time, in milliseconds, to keep the radio on after - * a successful receive addressed to this node - */ -#ifndef DELAY_AFTER_RECEIVE -#define DELAY_AFTER_RECEIVE 100 -#endif - /** * This is a measured value of the time in ms the radio is actually on * We round this up to err on the side of better performance ratios diff --git a/tos/chips/cc2420/lpl/DefaultLplP.nc b/tos/chips/cc2420/lpl/DefaultLplP.nc index 7398f3c9..4c5c63b4 100644 --- a/tos/chips/cc2420/lpl/DefaultLplP.nc +++ b/tos/chips/cc2420/lpl/DefaultLplP.nc @@ -40,6 +40,7 @@ * @author David Moss */ +#include "Lpl.h" #include "DefaultLpl.h" #include "AM.h" diff --git a/tos/chips/rf2xx/layers/LowPowerListeningLayerP.nc b/tos/chips/rf2xx/layers/LowPowerListeningLayerP.nc index 3030f26b..d290df37 100644 --- a/tos/chips/rf2xx/layers/LowPowerListeningLayerP.nc +++ b/tos/chips/rf2xx/layers/LowPowerListeningLayerP.nc @@ -52,10 +52,6 @@ module LowPowerListeningLayerP implementation { -#ifndef LPL_DEF_LOCAL_WAKEUP -#define LPL_DEF_LOCAL_WAKEUP 0 -#endif - enum { // minimum wakeup time to catch a transmission in milliseconds diff --git a/tos/system/SystemLowPowerListeningP.nc b/tos/system/SystemLowPowerListeningP.nc index db91cbf2..564db676 100644 --- a/tos/system/SystemLowPowerListeningP.nc +++ b/tos/system/SystemLowPowerListeningP.nc @@ -1,3 +1,5 @@ +#include "Lpl.h" + module SystemLowPowerListeningP { provides interface SystemLowPowerListening; diff --git a/tos/types/Lpl.h b/tos/types/Lpl.h new file mode 100644 index 00000000..05219baa --- /dev/null +++ b/tos/types/Lpl.h @@ -0,0 +1,23 @@ +#ifndef LPL_H +#define LPL_H + +/** + * Amount of time, in milliseconds, to keep the radio on after + * a successful receive addressed to this node + */ +#ifndef DELAY_AFTER_RECEIVE +#define DELAY_AFTER_RECEIVE 100 +#endif + +/** + * The LPL defaults to stay-on. + */ +#ifndef LPL_DEF_LOCAL_WAKEUP +#define LPL_DEF_LOCAL_WAKEUP 0 +#endif + +#ifndef LPL_DEF_REMOTE_WAKEUP +#define LPL_DEF_REMOTE_WAKEUP 0 +#endif + +#endif -- 2.39.2