From 912ea85199515f0d02899ad510495eef77691bc1 Mon Sep 17 00:00:00 2001 From: maniacbug Date: Tue, 9 Aug 2011 00:30:10 -0400 Subject: [PATCH] Make PERIOD configurable in Makefile --- examples/ipv6/rpl-collect/Makefile | 4 ++++ examples/ipv6/rpl-collect/collect-common.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/ipv6/rpl-collect/Makefile b/examples/ipv6/rpl-collect/Makefile index c2e7875ef..e37b71468 100644 --- a/examples/ipv6/rpl-collect/Makefile +++ b/examples/ipv6/rpl-collect/Makefile @@ -7,6 +7,10 @@ WITH_UIP6=1 UIP_CONF_IPV6=1 CFLAGS+= -DUIP_CONF_IPV6_RPL +ifdef PERIOD +CFLAGS=-DPERIOD=$(PERIOD) +endif + all: $(CONTIKI_PROJECT) include $(CONTIKI)/Makefile.include diff --git a/examples/ipv6/rpl-collect/collect-common.c b/examples/ipv6/rpl-collect/collect-common.c index f0257df51..aa5bcf5d8 100644 --- a/examples/ipv6/rpl-collect/collect-common.c +++ b/examples/ipv6/rpl-collect/collect-common.c @@ -49,8 +49,10 @@ static unsigned long time_offset; static int send_active = 1; +#ifndef PERIOD #define PERIOD 60 -#define RANDWAIT 60 +#endif +#define RANDWAIT (PERIOD) /*---------------------------------------------------------------------------*/ PROCESS(collect_common_process, "collect common process");