1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #508 from thomaseichinger/openwsn-pkg

support openwsn as a pkg
This commit is contained in:
Thomas Eichinger 2014-01-20 06:03:12 -08:00
commit 41fca84c09
5 changed files with 38549 additions and 0 deletions

40
pkg/openwsn/Makefile Normal file
View File

@ -0,0 +1,40 @@
PKG_NAME=RB
PKG_URL=https://codeload.github.com/openwsn-berkeley/openwsn-fw
PKG_VERSION=1.4
PKG_EXT=zip
FETCH=$(shell which wget &> /dev/null && echo "wget" || echo "curl")
#UNPACK=tar -xvf
UNPACK=unzip
ifeq ($(FETCH),curl )
FETCH_FLAGS += -z $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT) -o
else
FETCH_FLAGS += -nc -O
endif
ifneq ($(RIOTBOARD),)
#include $(RIOTBOARD)/Makefile.base
include $(RIOTBOARD)/$(BOARD)/Makefile.include
endif
.PHONY: all clean
all: $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)/
make -C $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)
$(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)/: $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)
$(AD)rm -rf $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)
$(AD)$(UNPACK) $< -d $(PKG_NAME)-$(PKG_VERSION)
$(AD)cd $@ && sh ../structure_changes.sh
$(AD)cd $@ && patch -p0 -N -i ../patch.txt
$(CURDIR)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT):
# Get PKG_VERSION of package from PKG_URL
$(AD)$(FETCH) $(FETCH_FLAGS) $@ $(PKG_URL)/$(PKG_EXT)/$(PKG_NAME)-$(PKG_VERSION) || true
clean::
rm -rf $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)
distclean::
rm -f $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)

9
pkg/openwsn/Makefile.in Normal file
View File

@ -0,0 +1,9 @@
DIRS =
DIRS += openwsn
all::
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;
# remove compilation products
clean::
@for i in $(DIRS) ; do "$(MAKE)" -C $$i clean ; done ;

8
pkg/openwsn/README.md Normal file
View File

@ -0,0 +1,8 @@
# Compatibility
This port of the openwsn stack is compatible with the TelosB board only for now.
The hardware dependency will be reduced in the future and thous running on more
hardware platforms.
A test can be found in the [projects repository](https://github.com/RIOT-OS/projects/)
named ```test_openwsn_pkg``` with an example ```Makefile```.

38412
pkg/openwsn/patch.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
#!/usr/bin/zsh
printf "Moving openwsn stack ..."
# move openwsn stack directory up
mv openwsn-fw-RB-1.4/firmware/openos/openwsn/ ./
# and all needed hw dependent files too
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/spi.c openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/uart.c openwsn/uart_ow.c
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/leds.c openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/board.c openwsn/board_ow.c
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/board_info.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/radiotimer.c openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/eui64.c openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/telosb/debugpins.c openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/board.h openwsn/board_ow.h
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/debugpins.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/eui64.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/leds.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/radio.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/radiotimer.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/boards/uart.h openwsn/uart_ow.h
mv openwsn-fw-RB-1.4/firmware/openos/bsp/chips/spi.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/chips/cc2420/radio.c openwsn
mv openwsn-fw-RB-1.4/firmware/openos/bsp/chips/cc2420/cc2420.h openwsn
mv openwsn-fw-RB-1.4/firmware/openos/drivers/common/openhdlc.* openwsn
mv openwsn-fw-RB-1.4/firmware/openos/drivers/common/opentimers.* openwsn
mv openwsn-fw-RB-1.4/firmware/openos/drivers/common/openserial.{c,h} openwsn
mv openwsn-fw-RB-1.4/firmware/openos/kernel/openos/scheduler.{c,h} openwsn
printf "[OK]\n"
printf "Removing files not needed ... "
# remove all *dox files
for i in `find ./openwsn -name "*.dox"`; do
rm -f $i
done
rm -f openwsn/SConscript
rm -rf openwsn/02.5-MPLS
printf "[OK]\n"
printf "Initialize Makefile structure ..."
# create empty Makefiles
touch openwsn/Makefile
for i in `find ./openwsn -type d`; do
touch $i/Makefile
done
# meta Makefile
cp ../Makefile.in ./
mv ./Makefile.in ./Makefile
# oops too many Makefiles
rm -f openwsn/07-App/rxl1/Makefile \
openwsn/07-App/rt/Makefile \
openwsn/07-App/rrube/Makefile \
openwsn/07-App/rreg/Makefile \
openwsn/07-App/rleds/Makefile \
openwsn/07-App/rheli/Makefile \
openwsn/07-App/rex/Makefile \
openwsn/07-App/layerdebug/Makefile \
openwsn/07-App/imu/Makefile \
openwsn/07-App/heli/Makefile
printf "[OK]\n"
mkdir openwsn/07-App/r6tus
touch openwsn/07-App/r6tus/r6tus.c
touch openwsn/07-App/r6tus/r6tus.h
printf "Clean up ..."
# clean not need files
rm -rf openwsn-fw-RB-1.4
printf "[OK]\n"
printf "Remove CRLF line endings ... "
# deal with crlf line endings
for i in `find ./openwsn -type f`; do
perl -pi -e 's/\r\n/\n/g' $i
done
printf "[OK]\n"