From 14b7a9a6475531e0006ffb91129dd5bcff043687 Mon Sep 17 00:00:00 2001 From: Thomas Eichinger Date: Mon, 12 May 2014 13:19:58 +0200 Subject: [PATCH 1/2] test application for OpenWSN on RIOT --- test_openwsn_pkg/Makefile | 54 ++++++++++++++++++++++++++++ test_openwsn_pkg/Makefile.iot-lab_M3 | 5 +++ test_openwsn_pkg/main.c | 6 ++++ 3 files changed, 65 insertions(+) create mode 100644 test_openwsn_pkg/Makefile create mode 100644 test_openwsn_pkg/Makefile.iot-lab_M3 create mode 100644 test_openwsn_pkg/main.c diff --git a/test_openwsn_pkg/Makefile b/test_openwsn_pkg/Makefile new file mode 100644 index 0000000..57826b7 --- /dev/null +++ b/test_openwsn_pkg/Makefile @@ -0,0 +1,54 @@ +#### +#### Sample Makefile for building apps with the RIOT OS +#### +#### The Sample Filesystem Layout is: +#### /this makefile +#### ../RIOT +#### ../../boards for board definitions (if you have one or more) +#### + +# name of your project +export PROJECT = test_openwsn_pkg + +# for easy switching of boards +ifeq ($(strip $(BOARD)),) + export BOARD = iot-lab_M3 +endif + +# this has to be the absolute path of the RIOT-base dir +export RIOTBASE = $(CURDIR)/../../RIOT + +ifeq ($(BOARD),iot-lab_M3) + include Makefile.$(BOARD) +endif + +# uncomment this to enable scheduler statistics for ps +#CFLAGS += -DSCHEDSTATISTICS + +# If you want to use valgrind, you should recompile native with either +# HAVE_VALGRIND_H or HAVE_VALGRIND_VALGRIND_H depending on the location +# of the valgrind header (i.e. or ) +# For more information about the valgrind support of RIOT read: +# RIOT/cpu/native/README +#CFLAGS += -DHAVE_VALGRIND_VALGRIND_H +#CFLAGS += -DHAVE_VALGRIND_H + +# Uncomment this to enable code in RIOT that does safety checking +# which is not needed in a production environment but helps in the +# development process: +#CFLAGS += -DDEVELHELP + +# Uncomment this to hide compiler invocation lines: +#QUIET = 1 + +USEPKG += openwsn + +export INCLUDES += -I${RIOTBASE}/core/include/ \ + -I${RIOTBASE}/sys/include/ \ + -I${RIOTBASE}/drivers/include/ \ + -I${RIOTBASE}/pkg/openwsn/RB-1.4/openwsn + +include $(RIOTBASE)/Makefile.include + +distclean: clean + $(MAKE) -C $(RIOTBASE)/pkg/$(USEPKG) distclean diff --git a/test_openwsn_pkg/Makefile.iot-lab_M3 b/test_openwsn_pkg/Makefile.iot-lab_M3 new file mode 100644 index 0000000..f5d30a4 --- /dev/null +++ b/test_openwsn_pkg/Makefile.iot-lab_M3 @@ -0,0 +1,5 @@ +export RIOTBOARD =$(CURDIR)/../../thirdparty_boards +export RIOTCPU =$(CURDIR)/../../thirdparty_cpu + +reset: + $(RIOTCPU)/$(CPU)/tools/reset.sh diff --git a/test_openwsn_pkg/main.c b/test_openwsn_pkg/main.c new file mode 100644 index 0000000..22e0a91 --- /dev/null +++ b/test_openwsn_pkg/main.c @@ -0,0 +1,6 @@ +#include "openwsn.h" + + +void main(void) { + openwsn_start_thread(); +} From 64173f0def4a1f32827a6fda3007651dba35b8bc Mon Sep 17 00:00:00 2001 From: Thomas Eichinger Date: Mon, 12 May 2014 17:07:07 +0200 Subject: [PATCH 2/2] addressing @Kijewski's comments --- test_openwsn_pkg/Makefile | 15 +-------------- test_openwsn_pkg/main.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/test_openwsn_pkg/Makefile b/test_openwsn_pkg/Makefile index 57826b7..b47162d 100644 --- a/test_openwsn_pkg/Makefile +++ b/test_openwsn_pkg/Makefile @@ -22,17 +22,6 @@ ifeq ($(BOARD),iot-lab_M3) include Makefile.$(BOARD) endif -# uncomment this to enable scheduler statistics for ps -#CFLAGS += -DSCHEDSTATISTICS - -# If you want to use valgrind, you should recompile native with either -# HAVE_VALGRIND_H or HAVE_VALGRIND_VALGRIND_H depending on the location -# of the valgrind header (i.e. or ) -# For more information about the valgrind support of RIOT read: -# RIOT/cpu/native/README -#CFLAGS += -DHAVE_VALGRIND_VALGRIND_H -#CFLAGS += -DHAVE_VALGRIND_H - # Uncomment this to enable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: @@ -43,9 +32,7 @@ endif USEPKG += openwsn -export INCLUDES += -I${RIOTBASE}/core/include/ \ - -I${RIOTBASE}/sys/include/ \ - -I${RIOTBASE}/drivers/include/ \ +export INCLUDES += -I${RIOTBASE}/drivers/include/ \ -I${RIOTBASE}/pkg/openwsn/RB-1.4/openwsn include $(RIOTBASE)/Makefile.include diff --git a/test_openwsn_pkg/main.c b/test_openwsn_pkg/main.c index 22e0a91..6d885e9 100644 --- a/test_openwsn_pkg/main.c +++ b/test_openwsn_pkg/main.c @@ -1,6 +1,16 @@ -#include "openwsn.h" +/* + * main.c - Test application for OpenWSN on RIOT + * Copyright (C) 2014 Thomas Eichinger + * + * Author : Thomas Eichinger + * + * This file subject to the terms and conditions of the LGPLv2. See the file + * LICENSE in the top level directory for more details. + */ +#include "openwsn.h" -void main(void) { +void main(void) +{ openwsn_start_thread(); }