diff --git a/Jamfile b/Jamfile deleted file mode 100644 index 3e199228c3be3986235f9c653f93b7b633e676ca..0000000000000000000000000000000000000000 --- a/Jamfile +++ /dev/null @@ -1,74 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP ; - -# -# Target directory: bin directory located in BUILD_ROOT -# -TARGET_DIR ?= [ FPath $(BUILD_ROOT) bin $(BOARD) $(PROJECT) ] ; -LOCATE_TARGET = $(TARGET_DIR) ; -ALL_LOCATE_TARGET = $(TARGET_DIR) ; - -echo "Building project '$(PROJECT)' for '$(BOARD)' board." ; - -# -# Buil utility targets -# -Help ? ; # display usage from manual -Help help ; -Help usage ; -Help targets ; -Cleanall cleanall ; # clean all binaries - -# -# Main target -# -Main $(TARGET) ; -Depends all : $(TARGET:S=.hex) ; # always build a hex-file - -LOCATE on $(TARGET) = bin ; -LOCATE on $(TARGET:S=.hex) = bin ; - -# -# Utility targets -# -Doc doc ; # build the documentation -Flash flash : $(TARGET:S=.hex) ; -Reset reset ; -Terminal term ; -Test test : all ; - -Debug debug : $(TARGET) ; -ListModules listmodules ; -ShowFlags showflags : $(TARGET) ; - -SubInclude TOP sys ; -SubInclude TOP core ; -SubInclude TOP drivers ; -SubInclude TOP board ; -SubInclude TOP projects $(PROJECT) ; diff --git a/Jamrules b/Jamrules deleted file mode 100644 index a74dff55dcef6ddba36bd73fe650297b5fa00c79..0000000000000000000000000000000000000000 --- a/Jamrules +++ /dev/null @@ -1,77 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -# -# Include build system functionality -# -include $(TOP)$(SLASH)Jamrules.common ; - -# -# Setup ukleos build system configuration (default values for common options) -# -PROJECT = $(PROJECT:E=default) ; -BOARD = $(BOARD:E=msba2) ; -SUFFIX ?= "" ; # must be at least "" !!! -TARGET = "$(BOARD)-$(PROJECT)$(SUFFIX)$(SUFEXE)" ; # main target binary -OPENOCD_IF ?= olimex-jtag-tiny-a ; - -TERMINAL ?= tools/pyterm/pyterm.py ; - -if $(NT) || $(OS) = CYGWIN { - PORT = $(PORT:E=1) ; -} else { - PORT = $(PORT:E=/dev/ttyUSB0) ; -} - -CCFLAGS += -DBOARD=BOARD_$(BOARD:U) ; -#CCFLAGS += -finstrument-functions -finstrument-functions-exclude-file-list=trace ; - -# -# core source directories -HDRS += $(TOP) ; -HDRS += [ FPath $(TOP) core include ] ; -HDRS += [ FPath $(TOP) sys include ] [ FPath $(TOP) sys config ] [ FPath $(TOP) sys drivers include ] [ FPath $(TOP) sys drivers cc110x ] [ FPath $(TOP) sys drivers nanopan5375 ] ; -HDRS += [ FPath $(TOP) sys net ] ; -HDRS += [ FPath $(TOP) sys lib ] [ FPath $(TOP) sys lib fat include ] ; -HDRS += [ FPath $(TOP) sys lib gps ] [ FPath $(TOP) sys lib gps drivers ] [ FPath $(TOP) sys lib gps geo ] ; -HDRS += [ FPath $(TOP) sys net phy ] [ FPath $(TOP) sys net mm ] ; - -# Include board files -include [ FPath $(TOP) board $(BOARD) Jamrules.$(BOARD) ] ; -# Include cpu files -include [ FPath $(TOP) cpu $(CPU) Jamrules.$(CPU) ] ; - -# -# standard target source directories -HDRS += [ FPath $(TOP) board $(BOARD) include ] ; -HDRS += [ FPath $(TOP) cpu $(CPU) include ] ; -HDRS += [ FPath $(TOP) projects $(PROJECT) ] ; - -# drivers -HDRS += [ FPath $(TOP) drivers include ] ; -HDRS += [ FPath $(TOP) drivers cc110x ] ; -HDRS += [ FPath $(TOP) drivers cc110x_ng include ] ; diff --git a/Jamrules.common b/Jamrules.common deleted file mode 100644 index da867cedf6d5ce213cccf9c3fe6460673cd2dc7f..0000000000000000000000000000000000000000 --- a/Jamrules.common +++ /dev/null @@ -1,360 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -# -# OS specifics -# -if $(NT) { - SLASH = \\ ; - POSIXSHELL = sh ; - NULLDEV = NUL ; - CAT = type ; - NOARSCAN = true ; - - # redefine build rules for gcc on NT - SUFOBJ = .o ; - SUFLIB = .a ; - actions As - { - $(AS) $(ASFLAGS) $(ASHDRS) -o $(<) $(>) - } - actions Cc - { - $(CC) -c -o $(<) $(CCFLAGS) -D$(MODULE_DEFINES) $(CCDEFS) $(CCHDRS) $(>) - } - rule FDefines { return -D$(<) ; } - rule FIncludes { return -I$(<) ; } - -} else { - NULLDEV = /dev/null ; - CAT = cat ; - RM = rm -rf ; - - # use english language output for gcc - actions Cc - { - LANG=C $(CC) -c -o $(<) $(CCFLAGS) -D$(MODULE_DEFINES) $(CCDEFS) $(CCHDRS) $(>) - } - - switch $(OS) { - case CYGWIN : - # archive scanning does not work on cygwin, so leave object files - NOARSCAN = true ; - } -} - -# -# Plausbility checks and defaults -# -SUFEXE = .elf ; - -# -# Rules and Actions -# - -# -# Concatenates path-segments into a OS specific path string -# Usage: PATH = [ FPath path-segments ] ; -rule FPath -{ - return $(<:J=$(SLASH)) ; -} - -# -# Generate object archive -actions updated together piecemeal Archive -{ - $(AR) $(ARFLAGS) $(<) $(>) -} - -# -# Link target -rule Link -{ - # add map file - Clean clean : $(<:S=.map) ; - # generation of hex file - Hexfile $(<:S=.hex) : $(<) ; -} -actions Link bind NEEDLIBS -{ - echo "Old firmware size:" - $(TOOLCHAIN)size $(<) 2> $(NULLDEV) || echo " No old binary for size comparison..." - - $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) -Wl,--start-group $(NEEDLIBS) $(LINKLIBS) -lm -Wl,--end-group -Wl,-Map=$(<:S=.map) || $(RM) -f $(<) $(<:S=.map) $(<:S=.hex) - - echo "New firmware size:" - $(TOOLCHAIN)size $(<) -} - -# -# Clean binaries -actions piecemeal together existing Clean -{ - # remove all jam targets - $(RM) $(>) -} - -# -# Clean binaries regardless of project and board -rule Cleanall { } -actions Cleanall -{ - echo "> Cleaning binaries" - $(RM) bin$(SLASH)* -# make -C $(TOP)$(SLASH)doc clean -} - -# -# Display usage text from manual -rule Help { } -actions Help -{ - $(CAT) $(TOP)$(SLASH)doc$(SLASH)src$(SLASH)manual$(SLASH)examples$(SLASH)jam-usage.txt -} - -# -# Compile documentation -rule Doc { } -actions Doc -{ - make -C $(TOP)$(SLASH)doc all -} - -# -# Generate hex-file from binary -rule Hexfile -{ - MakeLocate $(<) : $(LOCATE_TARGET) ; - Depends $(<) : $(>) ; - SEARCH on $(>) = $(LOCATE_TARGET) ; - Clean clean : $(<) ; -} -actions Hexfile -{ - $(OBJCOPY) -O ihex $(>) $(<) -} - -# -# Program binary to target device -rule Flash -{ - Depends $(<) : $(>) ; -} -actions Flash -{ - $(FLASHER) $(FLASHFLAGS) $(>) -} - -# -# Run all tests for active project -rule Test -{ - Depends $(<) : $(>) ; -} -actions Test -{ - export PORT=$(PORT); for tst in projects/$(PROJECT)/tests/*; do $tst; done -} - -# Reset connected sensor node -actions Reset -{ - $(RESET) > /dev/null 2>&1 -} - -# run a terminal -# -actions Terminal -{ - $(TERMINAL) $(TERMOPTS) $(PORT) -} - -# -# Run debug server -rule Debug -{ - Depends $(<) : $(>) ; -} -actions Debug -{ - $(GDB) $(GDBFLAGS) $(>) -} - -# -# Rules for convenient module building & dependency tracking -rule Module -{ - local _m = $(<:S=$(SUFLIB)) ; - -# echo Module Name: $(<) Files: $(>) Dependencies: $(3) ; - - DEFINED_MODULES += $(_m) ; - - ModuleFromObjects $(<) : $(>:S=$(SUFOBJ)) ; - ObjectsNoDep $(>) ; - - ModuleDepends $(_m) : $(3) ; - - if $(_m) in $(USE_MODULES) { - UseModule $(_m) ; - } -} - -# Add a pre-built library as module -# Syntax: BinModule <Module Name = $(<)> ; -rule BinModule -{ - local _m = $(<:S=$(SUFLIB)) ; - - DEFINED_MODULES += $(_m) ; - BINARY_MODULES += $(_m) ; - - ModuleDepends $(_m) : $(3) ; - - if $(_m) in $(USE_MODULES) { - UseModule $(_m) ; - } -} - -rule ModuleDepends -{ - local _m = $(<:S=$(SUFLIB)) ; - local _d = $(>:S=$(SUFLIB)) ; - -# for DEP in $(_d) { - Depends $(_m) : $(_d) ; - DEPENDS.$(_m) += $(_d) ; -# } -} - -rule UseModule -{ - local _m = $(<:S=$(SUFLIB)) ; - - if $(_m) in $(BINARY_MODULES) { - local _l _s ; - _l = $(<:S=$(SUFLIB)) ; # name of the library file - _s = [ FGristFiles $(_l) ] ; # source - MakeLocate $(_l) : $(LOCATE_TARGET) ; # locate to bin directory - File $(TARGET_DIR)/$(_l) : $(_s) ; - } - -# echo UseModule $(<) ; - if ! $(_m) in $(DEFINED_MODULES) { -# echo Module not defined yet. ; - USE_MODULES += $(_m) ; - } else { - LinkLibraries $(TARGET) : $(<) ; - local _mdefine = MODULE_$(_m:S=:U) ; - if ! $(_mdefine) in $(MODULE_DEFINES) { - MODULE_DEFINES += $(_mdefine) ; - } -# echo Dependencies of $(_m): $(DEPENDS.$(_m)) ; - for DEP in $(DEPENDS.$(_m)) { - UseModule $(DEP) ; - } - } -} - -# (slightly modified version of LibraryFromObjects) -rule ModuleFromObjects -{ - local _i _l _s ; - - # Add grist to file names - - _s = [ FGristFiles $(>) ] ; - _l = $(<:S=$(SUFLIB)) ; - - # Set LOCATE for the library and its contents. The bound - # value shows up as $(NEEDLIBS) on the Link actions. - # For compatibility, we only do this if the library doesn't - # already have a path. - - if ! $(_l:D) - { - MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ; - } - - if $(NOARSCAN) - { - # If we can't scan the library to timestamp its contents, - # we have to just make the library depend directly on the - # on-disk object files. - - Depends $(_l) : $(_s) ; - } - else - { - # If we can scan the library, we make the library depend - # on its members and each member depend on the on-disk - # object file. - - Depends $(_l) : $(_l)($(_s:BS)) ; - - for _i in $(_s) - { - Depends $(_l)($(_i:BS)) : $(_i) ; - } - } - - Clean clean : $(_l) ; - - if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; } - - Archive $(_l) : $(_s) ; - - if $(RANLIB) { Ranlib $(_l) ; } - - # If we can't scan the library, we have to leave the .o's around. - - if ! ( $(NOARSCAN) || $(NOARUPDATE) ) { RmTemps $(_l) : $(_s) ; } -} - -# -# Like Objects, but doesn't set dependencies on obj pѕeudotarget. -rule ObjectsNoDep -{ - local _i ; - - for _i in [ FGristFiles $(<) ] - { - Object $(_i:S=$(SUFOBJ)) : $(_i) ; - } -} - -actions ListModules { - echo $(MODULE_DEFINES) | tr ' ' '\n' | sort -} - -actions ShowFlags { - echo "CCFLAGS: " - echo $(CCFLAGS) $(CCDEFS) -D$(MODULE_DEFINES) | tr ' ' '\n ' | sort - echo "" | $(CC) -E -dD - -} - diff --git a/core/Jamfile b/core/Jamfile deleted file mode 100644 index becba93e2dfdaa25c7fa820ea960a9a4142863a3..0000000000000000000000000000000000000000 --- a/core/Jamfile +++ /dev/null @@ -1,37 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP core ; - -Module core : kernel_init.c sched.c mutex.c msg.c thread.c : core_lib ; -Module core_lib : queue.c clist.c bitarithm.c cib.c lifo.c ; - -Module hwtimer : hwtimer.c : hwtimer_cpu ; - -Module oneway_malloc : oneway_malloc.c ; - -UseModule core ; diff --git a/cpu/Jamfile b/cpu/Jamfile deleted file mode 100644 index 809d3a73e243c5db5b8df47e28a9503689fdc075..0000000000000000000000000000000000000000 --- a/cpu/Jamfile +++ /dev/null @@ -1,30 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP cpu ; - -# cpu subdirs are included from board specific jamfiles diff --git a/cpu/arm_common/Jamfile b/cpu/arm_common/Jamfile deleted file mode 100644 index 1889eef63e1eccd0502e115bfbc49b6dd72aaaee..0000000000000000000000000000000000000000 --- a/cpu/arm_common/Jamfile +++ /dev/null @@ -1,45 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP cpu arm_common ; - -Module arm_common : common.s bootloader.c VIC.c atomic.s arm_cpu.c iap.c ; -UseModule arm_common ; - -Module profiling : profiling.c ; -if $(PROFILING) { - UseModule profiling ; -} - -Module hwtimer_cpu : hwtimer_cpu.c ; - -Objects syscalls.c ; - -DEPENDS $(TARGET) : <cpu!$(CPU)>startup.o ; -DEPENDS $(TARGET) : <cpu!arm_common>syscalls.o ; - -LINKFLAGS on $(TARGET) += $(LINKFLAGS) [ FPath $(TARGET_DIR) startup.o ] [ FPath $(TARGET_DIR) syscalls.o ] ; diff --git a/cpu/arm_common/Jamrules.arm_common b/cpu/arm_common/Jamrules.arm_common deleted file mode 100644 index 14afd3a205a35ef98b1d7b2fbbed2b6b0b9e72be..0000000000000000000000000000000000000000 --- a/cpu/arm_common/Jamrules.arm_common +++ /dev/null @@ -1,57 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** - -# ============================================================================== -# generic arm definitions & targets -# ============================================================================== - -HDRS += [ FPath $(TOP) cpu arm_common include ] ; - -TOOLCHAIN = arm-elf- ; - -# -# Toolchain setup -# -CC = $(TOOLCHAIN)gcc ; -LINK = $(CC) ; - -OPTIM = -Os ; - -CCFLAGS += -std=gnu99 -Wall -mcpu=arm7tdmi-s ; -LINKFLAGS = -mcpu=arm7tdmi-s -static -lgcc -nostartfiles -T [ FPath $(TOP) cpu $(CPU) linkerscript.x ] ; - -if $(PROFILING) = 1 { - CCFLAGS += -g -finstrument-functions ; -} - -AS = $(TOOLCHAIN)as ; -ASFLAGS += -mcpu=arm7tdmi-s --defsym $(CPU)=1 ; - -AR = $(TOOLCHAIN)ar ; -ARFLAGS = -rc ; - -OBJCOPY = $(TOOLCHAIN)objcopy ; - diff --git a/cpu/cc430/Jamfile b/cpu/cc430/Jamfile deleted file mode 100644 index 886cb44296a22b972c042daed271bb7e397da91c..0000000000000000000000000000000000000000 --- a/cpu/cc430/Jamfile +++ /dev/null @@ -1,35 +0,0 @@ -# ****************************************************************************** -# Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP cpu cc430 ; - -Module hwtimer_cpu : hwtimer_cc430.c : hwtimer_msp430 ; -Module rtc : cc430-rtc.c ; -Module gpioint : cc430-gpioint.c ; -Module adc : cc430-adc.c : hwtimer ; - -SubInclude TOP cpu msp430-common ; diff --git a/cpu/cc430/Jamrules.cc430 b/cpu/cc430/Jamrules.cc430 deleted file mode 100644 index c66536fc9baf0349764af329e956db77d2e007d5..0000000000000000000000000000000000000000 --- a/cpu/cc430/Jamrules.cc430 +++ /dev/null @@ -1 +0,0 @@ -include [ FPath $(TOP) cpu msp430-common Jamrules.msp430-common ] ; diff --git a/cpu/lpc214x/Jamfile b/cpu/lpc214x/Jamfile deleted file mode 100644 index 2e82c4c061e9f67874110bfd9e01aea7a9010f50..0000000000000000000000000000000000000000 --- a/cpu/lpc214x/Jamfile +++ /dev/null @@ -1,33 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** - -SubDir TOP cpu lpc214x ; - -Library cpu.a : cpu.c ; - -Objects startup.s ; - -SubInclude TOP cpu arm_common ; diff --git a/cpu/lpc2387/Jamfile b/cpu/lpc2387/Jamfile deleted file mode 100644 index d390ef87d0a075abfc8dc5e3c31251c1d35ce0a4..0000000000000000000000000000000000000000 --- a/cpu/lpc2387/Jamfile +++ /dev/null @@ -1,41 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP cpu lpc2387 ; - -Module cpu : cpu.c lpc2387-lpm.c lpc23xx-iap.c ; -UseModule cpu ; - -Module rtc : lpc2387-rtc.c ; -Module gpioint : lpc2387-gpioint.c ; -Module adc : lpc2387-adc.c ; -Module mci : lpc2387-mci.c asmfunc.s : hwtimer ; - -Objects startup.s ; - -#SubInclude TOP cpu lpc2387 drivers ; -SubInclude TOP cpu arm_common ; diff --git a/cpu/lpc2387/Jamrules.lpc2387 b/cpu/lpc2387/Jamrules.lpc2387 deleted file mode 100644 index 40c6fd2aa90c0c2b6929593d2037b3e877a5ebd4..0000000000000000000000000000000000000000 --- a/cpu/lpc2387/Jamrules.lpc2387 +++ /dev/null @@ -1,31 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -HDRS += [ FPath $(TOP) cpu $(CPU) drivers include ] ; -HDRS += [ FPath $(TOP) cpu $(CPU) hal include ] ; - -include [ FPath $(TOP) cpu arm_common Jamrules.arm_common ] ; \ No newline at end of file diff --git a/cpu/msp430-common/Jamfile b/cpu/msp430-common/Jamfile deleted file mode 100644 index 19e40bb30fb489355f1af8a9436960588bca2e82..0000000000000000000000000000000000000000 --- a/cpu/msp430-common/Jamfile +++ /dev/null @@ -1,38 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP cpu msp430-common ; - -Module cpu : msp430-main.c cpu.c atomic.c irq.c ; -Module hwtimer_msp430 : hwtimer_cpu.c ; - -UseModule cpu ; -UseModule oneway_malloc ; - -Object startup.o : startup.c ; -DEPENDS $(TARGET) : startup.o ; - diff --git a/cpu/msp430-common/Jamrules.msp430-common b/cpu/msp430-common/Jamrules.msp430-common deleted file mode 100644 index aaba8a424b81906f26fa7245f72414cce01a81dd..0000000000000000000000000000000000000000 --- a/cpu/msp430-common/Jamrules.msp430-common +++ /dev/null @@ -1,39 +0,0 @@ -# -## msp430 based MCU Jamrules file -# - -echo "Building for board $(BOARD)." ; -echo "Building for MCU $(MCU)." ; - -HDRS += $(TOP)/cpu/msp430-common/include $(TOP)/cpu/$(CPU)/include $(TOP)/board/$(BOARD)/drivers $(TOP)/board/$(BOARD)/include $(TOP)/include $(TOP)/core/include ; - -TOOLCHAIN = msp430- ; -CC = msp430-gcc ; -LINK = msp430-gcc ; -OPTIM = -Os -gdwarf-2 ; -#OPTIM = -O0 -g ; -#OPTIM = -O2 ; -CCFLAGS += -std=gnu99 -Wall -mmcu=$(MCU) ; -LINKFLAGS = -mmcu=$(MCU) -lgcc $(TOP)/bin/$(BOARD)/$(PROJECT)/startup.o ; - -AS = msp430-as ; -ASFLAGS += -mmcu=$(MCU) --defsym $(CPU)=1 --gdwarf-2 ; - -AR = msp430-ar ; -ARFLAGS = -rc ; - -GDB = msp430-gdb ; -GDBFLAGS = -x $(TOP)/board/$(BOARD)/tools/gdbscript ; - -OBJCOPY = msp430-objcopy ; - -FLASHER ?= echo ; -FLASHFLAGS ?= "No flasher defined." ; - -RESET ?= $(FLASHER) $(FLASHFLAGS) reset ; - -# overwrite flash action in order to support mspdebug -actions Flash -{ - $(FLASHER) $(FLASHFLAGS) "prog $(>)" -} diff --git a/cpu/msp430x16x/Jamfile b/cpu/msp430x16x/Jamfile deleted file mode 100644 index 14aa4df13685d7fb1bc8baeb61c194eba81c14b5..0000000000000000000000000000000000000000 --- a/cpu/msp430x16x/Jamfile +++ /dev/null @@ -1,33 +0,0 @@ -# ****************************************************************************** -# Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP cpu msp430x16x ; - -Module flashrom : flashrom.c ; -Module hwtimer_cpu : hwtimer_msp430.c : hwtimer_msp430 ; - -SubInclude TOP cpu msp430-common ; diff --git a/cpu/msp430x16x/Jamrules.msp430x16x b/cpu/msp430x16x/Jamrules.msp430x16x deleted file mode 100644 index c66536fc9baf0349764af329e956db77d2e007d5..0000000000000000000000000000000000000000 --- a/cpu/msp430x16x/Jamrules.msp430x16x +++ /dev/null @@ -1 +0,0 @@ -include [ FPath $(TOP) cpu msp430-common Jamrules.msp430-common ] ; diff --git a/drivers/Jamfile b/drivers/Jamfile deleted file mode 100644 index 09eba8ba4e3b14c5b4965a277d5ef51593d3f4f8..0000000000000000000000000000000000000000 --- a/drivers/Jamfile +++ /dev/null @@ -1,37 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id: Jamfile 832 2009-03-13 16:45:41Z kaspar $ - -SubDir TOP drivers ; - -Module sht11 : sht11.c : hwtimer ; - -Module ltc4150 : ltc4150.c : board_ltc4150 hwtimer ; - -Module vti_ps : vti_ps.c : vti_ps_twi ; - -SubInclude TOP drivers cc110x ; -SubInclude TOP drivers cc110x_ng ; diff --git a/drivers/cc110x/Jamfile b/drivers/cc110x/Jamfile deleted file mode 100755 index a6ea7f5d5947c75546e4762459b2d29df80c5448..0000000000000000000000000000000000000000 --- a/drivers/cc110x/Jamfile +++ /dev/null @@ -1,35 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id: Jamfile 832 2009-03-13 16:45:41Z kaspar $ - -SubDir TOP drivers cc110x ; - -HDRS += $(TOP)/drivers/cc110x ; - -Module cc110x : cc1100.c cc1100-csmaca-mac.c cc1100-defaultSettings.c - cc1100_phy.c cc1100_spi.c - : board_cc110x vtimer protocol_multiplex gpioint ; - diff --git a/drivers/cc110x_ng/Jamfile b/drivers/cc110x_ng/Jamfile deleted file mode 100755 index b47dfc8905c455669ae7cdb8dfb6ab3dc18048f6..0000000000000000000000000000000000000000 --- a/drivers/cc110x_ng/Jamfile +++ /dev/null @@ -1,34 +0,0 @@ -# ****************************************************************************** -# Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of µkleos. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id: Jamfile 832 2009-03-13 16:45:41Z kaspar $ - -SubDir TOP drivers cc110x_ng ; - -HDRS += $(TOP)/drivers/cc110x_ng/include ; - -Module cc110x_ng : cc110x.c cc110x-rx.c cc110x-tx.c cc110x-defaultSettings.c : hwtimer board_cc110x ; -Module cc110x_spi : cc110x_spi.c ; -Module cc110x_cc430 : cc110x_cc430.c ; diff --git a/projects/WEAtHeR/Jamfile b/projects/WEAtHeR/Jamfile deleted file mode 100644 index 4974b6d04618fccf84408aff3d64c7abac8c4cce..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects WEAtHeR ; - -Module WEAtHeR : main.c weather_routing.c protocol_msg_gateway.c : ltc4150 cc110x gpioint vtimer shell shell_commands posix_io uart0 auto_init rtc ; - -UseModule WEAtHeR ; diff --git a/projects/WEAtHeR/main.c b/projects/WEAtHeR/main.c deleted file mode 100644 index b562d334cbdd61880cc71d7a1a88ad14338b29bf..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/main.c +++ /dev/null @@ -1,347 +0,0 @@ -/* stdlib includes */ -#include <time.h> -#include <string.h> -#include <stdlib.h> -#include <stdio.h> - -/* core includes */ -#include <msg.h> -#include <thread.h> -#include <hwtimer.h> - -#define ENABLE_DEBUG -#include <debug.h> - -/* sensors and actors */ -#include <board.h> -#include <sht11.h> -#include <ltc4150.h> - -/* shell */ -#include <shell.h> -#include <board_uart0.h> -#include <posix_io.h> - -/* transceiver */ -#include <cc1100.h> - -/* real time clock */ -#include <rtc.h> -#include <lpc2387-rtc.h> - -/* application header */ -#include "weather_routing.h" -#include "weather_protocol.h" -#include "protocol_msg_gateway.h" - -#define SECOND (1000 * 1000) -#define MINUTE (60 * SECOND) - -#define SENDING_INTERVAL (1 * SECOND) - -#define SHELL_STACK_SIZE (2048) -#define PH_STACK_SIZE (2048) - -/* size of weather data packet without hop list */ -#define EMPTY_WDP_SIZE (sizeof(weather_data_pkt_t) - MAX_HOP_LIST) - -/* default values */ -#define DEFAULT_INTERVAL (5 * SECOND) - -/* stack space for threads */ -#define SHELL_STACK_SIZE (4048) -#define PH_STACK_SIZE (4048) - -char shell_stack_buffer[SHELL_STACK_SIZE]; -char ph_stack_buffer[PH_STACK_SIZE]; - -/* per default acting only as relay */ -static uint8_t data_sink = 0; -static uint8_t data_src = 0; - -static uint32_t sending_interval = DEFAULT_INTERVAL; - -extern uint8_t gossip_probability; - -/* function prototypes */ -static void weather_send(char* unused); -static void weather_sink(char* unused); -static void set_interval(char* interval); -static void set_probability(char* prob); -static void print_cc1100_info(char* unused); - -/* shell commands */ -shell_t shell; -const shell_command_t sc[] = { - {"sender", "Enables node as data source.", weather_send}, - {"sink", "Enables node as data sink.", weather_sink}, - {"int", "Set the sending interval in seconds", set_interval}, - {"prob", "Set the gossiping probability", set_probability}, - {"cc1100", "Show state, statistics and config of cc1100", print_cc1100_info}, - {NULL, NULL, NULL}}; - -static void shell_runner(void) { - shell_init(&shell, sc, uart0_readc, uart0_putc); - posix_open(uart0_handler_pid, 0); - shell_run(&shell); -} - -static void weather_send(char* unused) { - if (data_src) { - data_src = 0; - puts("Disabling data source mode."); - } - else { - data_src = 1; - puts("Enabling data source mode."); - } -} - -static void weather_sink(char* unused) { - if (data_sink) { - data_sink = 0; - puts("Disabling data sink mode."); - } - else { - data_sink = 1; - puts("Enabling data sink mode."); - } -} - -static void set_interval(char* interval) { - uint16_t a; - - a = atoi(interval+4); - if (strlen(interval) > 4) { - printf("[WEAtHeR] Set interval to %u\n ", a); - sending_interval = a * SECOND; - } - else { - printf("[WEAtHeR] Current interval is %lu\n ", (sending_interval / SECOND)); - } -} - -static void set_probability(char* prob) { - uint16_t a; - - a = atoi(prob+4); - if (strlen(prob) > 4) { - printf("[WEAtHeR] Set probability to %hu\n ", a); - gossip_probability = a; - } - else { - printf("[WEAtHeR] Current probability is %hu\n ", gossip_probability); - } -} - -static void print_cc1100_info(char* unused) { - puts("=================================================="); - cc1100_print_statistic(); - puts("--------------------------------------------------"); - cc1100_print_config(); - puts("=================================================="); -} - -/* packet handling */ -static void handle_packet(void* msg, int msg_size, packet_info_t* packet_info) { - weather_packet_header_t *header = (weather_packet_header_t*) msg; - - /* packet origins at current node, just ignore it */ - if (header->src == cc1100_get_address()) { - return; - } - DEBUG("\n\t Pkt received from phy: %u (%u bytes)\n" - "\t -> SEQ: %u | TYPE: %u | SRC: %hu \n\n", - packet_info->phy_src, - msg_size, - header->seq_nr, - header->type, - header->src - ); - /* while not acting as sink and packet contains data, route the packet */ - if (!data_sink) { - if (header->type == WEATHER_DATA) { - weather_data_pkt_t* wdp = (weather_data_pkt_t*) msg; - DEBUG("$0;%hu;%hu;%04lX;%04X;%.2f;%.2f;%.2f;%.2f\n", - header->src, - 0, - wdp->timestamp, - 0, - wdp->temperature, - wdp->relhum, - wdp->relhum_temp, - wdp->energy); - DEBUG("Not for me, routing, baby!\n"); - route_packet(msg, msg_size); - } - - return; - } - - /* if current node acts as sink, handle packet */ - switch (header->type) { - case WEATHER_HELLO: { - if (msg_size < sizeof(weather_hello_pkt_t)) { - puts("Bad hello packet received."); - } else { - puts("Hello packet received - no handler implemented"); - } - break; - } - case WEATHER_CHAT: { - puts("\n*================================================================================*"); - printf("\tCHAT MESSAGE from %hu: %s\n\n", packet_info->phy_src, ((weather_chat_pkt_t*) msg)->mesg); - puts("*================================================================================*\n"); - break; - } - case WEATHER_DATA: { - weather_data_pkt_t* wdp = (weather_data_pkt_t*) msg; - uint8_t i; - time_t local_time = rtc_time(NULL); - /* <node_id_source>;<node_id_sink>;<timestamp_source>;<timestamp_sink>;<temperature>;<humidity_relative>;<humitidy_absolut>;<energy_counter> */ - printf("$1;%hu;%u;%04lX;%04lX;%.2f;%.2f;%.2f;%.2f;", - header->src, - cc1100_get_address(), - wdp->timestamp, - local_time, - wdp->temperature, - wdp->relhum, - wdp->relhum_temp, - wdp->energy); - for (i = 0; i < wdp->hop_counter; i++) { - printf("%03u-", wdp->hops[i]); - } - puts(""); - break; - } - default: { - printf("Unknown packet type \"%i\" received.\n", header->type); - } - } -} - -/* endless loop for packet handling */ -static void protocol_handler_thread(void) { - msg_t m; - puts("Protocol handler thread started."); - - while(1) { - msg_receive(&m); - - packet_t packet; - int pos = m.content.value; - packet = packet_buffer[pos]; - - handle_packet(packet.payload, packet.msg_size, &(packet.packet_info)); - DEBUG("Packet handler done\n"); - } -} - -int main(void) { - weather_data_pkt_t wdp; - sht11_val_t sht11_val; - - /* initialize variables */ - uint8_t success = 0; - int sending_state = 0; - gossip_probability = FLOODING_PROB; - - /* fill some fields of the packet */ - wdp.header.seq_nr = 0; - wdp.header.type = WEATHER_DATA; - wdp.hop_counter = 1; - - /* set initial channel */ - cc1100_set_channel(10); - - /* boot screen */ - puts(""); - puts("WEAtHeR: Wireless Energy-Aware mulTi-Hop sEnsor Reading."); - puts(""); - printf("Sending interval: %lu\n", sending_interval / SECOND); - - /* start shell */ - thread_create(shell_stack_buffer, SHELL_STACK_SIZE, PRIORITY_MAIN-1, CREATE_STACKTEST, shell_runner, "shell"); - - /* initialize message gateway */ - init_protocol_msg_gateway(); - /* create thread for radio packet handling */ - int pid = thread_create(ph_stack_buffer, PH_STACK_SIZE, PRIORITY_MAIN-2, CREATE_STACKTEST, protocol_handler_thread, "protocol_handler"); - set_protocol_handler_thread(pid); - - /* start coulomb counter and RTC */ - ltc4150_start(); - rtc_enable(); - - /* loop forever */ - while (1) { - DEBUG("Measurement in progress...\n"); -#ifndef ENABLE_DEBUG - success = sht11_read_sensor(&sht11_val, HUMIDITY|TEMPERATURE); -#else - success = 1; - sht11_val.temperature = 1; - sht11_val.relhum = 2; - sht11_val.relhum_temp = 3; -#endif - DEBUG("...done.\n"); - - if (data_src) { - wdp.header.src = cc1100_get_address(); - DEBUG("Src filled\n"); - wdp.timestamp = rtc_time(NULL); - DEBUG("Timestamp filled\n"); - wdp.energy = ltc4150_get_total_mAh(); - DEBUG("Energy filled\n"); - - if (!success) { - printf("error;error;error\n"); - } - else { - wdp.temperature = sht11_val.temperature; - wdp.relhum = sht11_val.relhum; - wdp.relhum_temp = sht11_val.relhum_temp; - wdp.hops[0] = cc1100_get_address(); - DEBUG("Ready for sending\n"); - /* send packet with one entry in hop list */ - sending_state = cc1100_send_csmaca(0, WEATHER_PROTOCOL_NR, 0, (char*)&wdp, (EMPTY_WDP_SIZE + 1)); - if (sending_state > 0) { - DEBUG("Sending %lu bytes.\n", (EMPTY_WDP_SIZE + 1)); - wdp.header.seq_nr++; - } - else { - printf("Error on sending packet with code %i!\n", sending_state); - } - } - LED_GREEN_TOGGLE; - } - else { - LED_RED_TOGGLE; - } - - if (!success) { - printf("error;error;error\n"); - } - else { -#ifdef ENABLE_DEBUG - puts("=================================================="); - cc1100_print_statistic(); - puts("--------------------------------------------------"); - cc1100_print_config(); - puts("=================================================="); -#endif - - printf("$0;%hu;%hu;%04lX;%04X;%.2f;%.2f;%.2f;%.2f\n", - cc1100_get_address(), - 0, - rtc_time(NULL), - 0, - sht11_val.temperature, - sht11_val.relhum, - sht11_val.relhum_temp, - ltc4150_get_total_mAh()); - } - hwtimer_wait(sending_interval); - } - puts("Something went wrong."); -} diff --git a/projects/WEAtHeR/protocol_msg_gateway.c b/projects/WEAtHeR/protocol_msg_gateway.c deleted file mode 100644 index baccab5e9aea79387cad9d2efc9920388a82830d..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/protocol_msg_gateway.c +++ /dev/null @@ -1,58 +0,0 @@ -#include <stdint.h> -#include <stdio.h> -#include <radio/radio.h> -#include <radio/types.h> -#include <string.h> -#include <msg.h> -#include <cc1100.h> - -#include <board.h> -#include "protocol_msg_gateway.h" -#include "weather_protocol.h" - -#define NUM_PROTOCOL_HANDLER_PIDS 8 - -static uint16_t protocol_handler_pid; - -static int packet_buffer_next = 0; -packet_t packet_buffer[PACKET_BUFFER_SIZE]; - -static void protocol_msg_gateway(void* payload, int msg_size, packet_info_t* packet_info) { - msg_t m; - - if (!cc1100_get_address()) { - puts("No address configured, not processing incoming packet"); - return; - } - - if (protocol_handler_pid <= 0) { - puts("protocol_handler(): received packet without protocol handler. msg dropped."); - return; - } - - int mypos = packet_buffer_next++; - if (packet_buffer_next == PACKET_BUFFER_SIZE) packet_buffer_next = 0; - - packet_t *p = &(packet_buffer[mypos]); - p->packet_info = *packet_info; - p->msg_size = msg_size; - memcpy(p->payload, payload, msg_size); - - m.type = 0; - m.content.value = mypos; - int success = msg_send_int(&m, protocol_handler_pid); - if (! success) { - /* should set timer to retry. Dropping pkt for now. */ - puts("protocol_handler(): msg dropped."); - } -} - -void init_protocol_msg_gateway() { - puts("Init protocol msg gateway"); - cc1100_set_packet_handler(WEATHER_PROTOCOL_NR, protocol_msg_gateway); -} - -int set_protocol_handler_thread(int pid) { - protocol_handler_pid = pid; - return 0; -} diff --git a/projects/WEAtHeR/protocol_msg_gateway.h b/projects/WEAtHeR/protocol_msg_gateway.h deleted file mode 100644 index dd190da99f87638d07d2d6e56fdc46055c0cc158..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/protocol_msg_gateway.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __PROTOCOL_MSG_GATEWAY_H -#define __PROTOCOL_MSG_GATEWAY_H - -#define PACKET_BUFFER_SIZE 32 -#define MAXIMUM_PAYLOAD_SIZE 64 - -typedef struct { - packet_info_t packet_info; - unsigned int msg_size; - char payload[MAXIMUM_PAYLOAD_SIZE]; -} packet_t; - -void init_protocol_msg_gateway(); -int set_protocol_handler_thread(int pid); - -extern packet_t packet_buffer[PACKET_BUFFER_SIZE]; - -#endif /* __PROTOCOL_MSG_GATEWAY_H */ diff --git a/projects/WEAtHeR/tests/hello-world b/projects/WEAtHeR/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/WEAtHeR/weather_protocol.h b/projects/WEAtHeR/weather_protocol.h deleted file mode 100644 index 8785fd0264709fbff25624238b3e8511e8962e5c..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/weather_protocol.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef WEATHER_PROTOCOL_H_ -#define WEATHER_PROTOCOL_H_ - -#include <stdint.h> -#include <radio/radio.h> - -#define WEATHER_PROTOCOL_NR 6 -#define MAX_HOP_LIST (11) - -typedef enum { - WEATHER_HELLO, - WEATHER_CHAT, - WEATHER_DATA -} packet_types; - -typedef struct { - uint16_t seq_nr; - uint8_t src; - uint8_t type; -} weather_packet_header_t; - -typedef struct __attribute__ ((packed)) { - weather_packet_header_t header; -} weather_hello_pkt_t; - -typedef struct { - weather_packet_header_t header; - uint8_t len; - char mesg[40]; -} weather_chat_pkt_t; - -typedef struct __attribute__ ((packed)) { - weather_packet_header_t header; - time_t timestamp; - double temperature; - double relhum; - double relhum_temp; - double energy; - uint8_t hop_counter; - uint8_t hops[MAX_HOP_LIST]; -} weather_data_pkt_t; - -#endif diff --git a/projects/WEAtHeR/weather_routing.c b/projects/WEAtHeR/weather_routing.c deleted file mode 100644 index 3e572a96cd4c399b413e7b0f9ecb4e708d6e1d34..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/weather_routing.c +++ /dev/null @@ -1,77 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <time.h> -#include <cc1100.h> - -#include "weather_protocol.h" -#include "weather_routing.h" - -#define ENABLE_DEBUG -#include <debug.h> - -uint8_t gossip_probability; - -static source_timestamp_t sources[MAX_SOURCES]; - -static uint8_t update_sources(uint8_t id, time_t timestamp) { - uint8_t i; - - DEBUG("updating sources list\n"); - for (i = 0; i < MAX_SOURCES; i++) { - /* source id found */ - if (sources[i].id == id) { - DEBUG("source already known, comparing timestamps: %04lX : %04lX\n", sources[i].timestamp, timestamp); - /* more current timestamp received, updating */ - if (sources[i].timestamp < timestamp) { - sources[i].timestamp = timestamp; - return 1; - } - /* timestamp too old, discard this packet */ - else { - puts("Timestamp too old, not routing"); - return 0; - } - } - /* source id not yet stored creating new entry */ - else if (!sources[i].id) { - puts("got to know a new source"); - sources[i].id = id; - sources[i].timestamp = timestamp; - return 1; - } - } - puts("No more sources could be stored!"); - return 0; -} - -void route_packet(void* msg, int msg_size) { - weather_packet_header_t *header = (weather_packet_header_t*) msg; - weather_data_pkt_t* wdp = NULL; - int state = 0; - - if (header->type == WEATHER_DATA) { - wdp = (weather_data_pkt_t*) msg; - if (!update_sources(wdp->header.src, wdp->timestamp)) { - return; - } - } - - if ((100.0 * rand()/(double) RAND_MAX) <= gossip_probability) { - printf("Broadcasting packet..."); - /* if broadcasting weather data, append current hop */ - if (wdp != NULL) { - if (wdp->hop_counter < MAX_HOP_LIST) { - wdp->hops[wdp->hop_counter] = cc1100_get_address(); - wdp->hop_counter++; - } - } - state = cc1100_send_csmaca(0, WEATHER_PROTOCOL_NR, 0, (char*)msg, msg_size); - if (state > 0) { - puts("successful!"); - } - else { - printf("failed with code %i!\n", state); - } - } -} - diff --git a/projects/WEAtHeR/weather_routing.h b/projects/WEAtHeR/weather_routing.h deleted file mode 100644 index 14d050177e545e975ba903c43dfadde7838c962f..0000000000000000000000000000000000000000 --- a/projects/WEAtHeR/weather_routing.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef WEATHER_ROUTING_H -#define WEATHER_ROUTING_H - -#include <time.h> - -#define FLOODING_PROB (100) -#define MAX_SOURCES (10) -#define MAX_INTERVAL (5 * 60) - -typedef struct { - uint8_t id; - time_t timestamp; -} source_timestamp_t; - -void route_packet(void* msg, int msg_size); - -#endif /* WEATHER_ROUTING_H */ diff --git a/projects/blinker/Jamfile b/projects/blinker/Jamfile deleted file mode 100644 index f3861a731a9d8572ac6b803e93a1ce3c3620c71e..0000000000000000000000000000000000000000 --- a/projects/blinker/Jamfile +++ /dev/null @@ -1,6 +0,0 @@ -SubDir TOP projects hello-world ; -# LOCATE_TARGET = $(SEARCH_SOURCE)/bin ; - -Library hello-world : main.c ; - -LinkLibraries $(BOARD).elf : hello-world ; diff --git a/projects/blinker/main.c b/projects/blinker/main.c deleted file mode 100644 index 971c506d7dea1235593537298f24dc175b33de67..0000000000000000000000000000000000000000 --- a/projects/blinker/main.c +++ /dev/null @@ -1,21 +0,0 @@ -#include <board.h> -#include "hwtimer.h" - -void wait(void) -{ /* simple delay function */ - volatile int i; /* declare i as volatile int */ - for(i = 0; i < 32000; i++); /* repeat 32000 times (nop) */ -} - - -int main(void) -{ - for(;;) - { /* infinite loop */ - LED_RED_ON; - wait(); /* call delay function */ - LED_RED_OFF; - wait(); - } -} - diff --git a/projects/blinker/tests/hello-world b/projects/blinker/tests/hello-world deleted file mode 100755 index 6f4a6ca8114811b10ab0ba8bd7193769aab5f889..0000000000000000000000000000000000000000 --- a/projects/blinker/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/cc110x/Jamfile b/projects/cc110x/Jamfile deleted file mode 100644 index 46afa8f33544e4e815d971886d3bd51511c501ab..0000000000000000000000000000000000000000 --- a/projects/cc110x/Jamfile +++ /dev/null @@ -1,9 +0,0 @@ -SubDir TOP projects cc110x ; -# LOCATE_TARGET = $(SEARCH_SOURCE)/bin ; - -Library cc110x : main.c ; - -UseModule cc110x ; -UseModule gpioint ; - -LinkLibraries $(BOARD).elf : cc110x ; diff --git a/projects/cc110x/main.c b/projects/cc110x/main.c deleted file mode 100644 index 59a91c2c87a6e14b2d3dabddb1c9f48f21f8a464..0000000000000000000000000000000000000000 --- a/projects/cc110x/main.c +++ /dev/null @@ -1,84 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <thread.h> -#include <msg.h> -#include <kernel.h> - -#include <cc1100.h> -#include <radio/radio.h> - -#include "gpioint.h" -#include "hwtimer.h" -#include "swtimer.h" - -/*---------------------------------------------------------------------------*/ - -static int message_counter = 0; -static uint32_t content; - -static void protocol_handler(void* msg, int msg_size, packet_info_t* packet_info) -{ - message_counter++; - content = *(uint32_t*) msg; - puts("."); -} - -int main(void) -{ -// minimal -#ifdef MODULE_GPIOINT - gpioint_init(); -#endif - - hwtimer_init(); - printf("hwtimer....[OK]\n"); - - // timers - swtimer_init(); - printf("swtimer....[OK]\n"); - - // Adjust hwtimer with current CPU speed - hwtimer_wait(200000); - -// benchmark_init(); - -// uint32_t speed = get_system_speed(); -// printf("System speed: %lu\n", speed); - hwtimer_init_comp(F_CPU); - printf("hwtimer fcpu....[OK]\n"); - - -#ifdef SENDER - printf("I'm Alice!\n"); - char *payload = "Hello!\n"; -#else - printf("I'm Bob!\n"); -#endif - - // radio stack - cc1100_init(); - cc1100_set_packet_handler(4, protocol_handler); - cc1100_set_channel(0); -// cc1100_set_output_power(5); - printf("cc1100..[OK]\n"); - - uint32_t i = 0; - -#ifdef SENDER - cc1100_set_address(2); - - -// while(1) { - puts("."); - int result = cc1100_send_csmaca(1, 4, 2, i, sizeof(i)); - printf("%i\n", result); - hwtimer_wait(1000 * 1000); -// } -#else - cc1100_set_address(1); - while(1) { - printf("Waiting...\n"); - hwtimer_wait(200000); - } -#endif -} diff --git a/projects/chronos_cc110x_ng/Jamfile b/projects/chronos_cc110x_ng/Jamfile deleted file mode 100644 index 8085574cbbafa088ce94ec6be8974df88d2a1bdf..0000000000000000000000000000000000000000 --- a/projects/chronos_cc110x_ng/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects chronos_cc110x_ng ; - -Module chronos_cc110x_ng : main.c : cc110x_ng transceiver auto_init board_display ; - -UseModule chronos_cc110x_ng ; diff --git a/projects/chronos_cc110x_ng/main.c b/projects/chronos_cc110x_ng/main.c deleted file mode 100644 index 4d19a34222dabfb783ab19c2c1c6e5a2b8931b47..0000000000000000000000000000000000000000 --- a/projects/chronos_cc110x_ng/main.c +++ /dev/null @@ -1,101 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <time.h> - -#include <display.h> - -#include <thread.h> -#include <board.h> -#include <hwtimer.h> -#include <msg.h> -#include <transceiver.h> -#include <cc110x_ng.h> - -#define RADIO_STACK_SIZE (512) -#define SEND_SIZE CC1100_MAX_DATA_LENGTH - -#define RCV_BUFFER_SIZE (4) - -#define SENDING_DELAY (5 * 1000) - -char radio_stack_buffer[RADIO_STACK_SIZE]; - -uint8_t snd_buffer[SEND_SIZE]; - -msg_t msg_q[RCV_BUFFER_SIZE]; - -static msg_t mesg; -static transceiver_command_t tcmd; -static radio_packet_t p; - -void send(radio_address_t dst, uint8_t len, uint8_t *data); - -void send(radio_address_t dst, uint8_t len, uint8_t *data) { - mesg.type = SND_PKT; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &p; - - p.length = len; - p.dst = dst; - display_chars(LCD_SEG_L2_5_0, "CC1100", SEG_OFF); - display_chars(LCD_SEG_L2_5_0, (char*) itoa(p.dst, 6, 0), SEG_ON); - - p.data = data; - msg_send(&mesg, transceiver_pid, 1); -} - - -void radio(void) { - msg_t m; - radio_packet_t *p; - - msg_init_queue(msg_q, RCV_BUFFER_SIZE); - - while (1) { - msg_receive(&m); - if (m.type == PKT_PENDING) { - - p = (radio_packet_t*) m.content.ptr; - display_chars(LCD_SEG_L2_5_0, "CC1100", SEG_OFF); - display_chars(LCD_SEG_L2_5_0, (char*) p->data, SEG_ON); - send(p->src, p->length, p->data); - - - p->processing--; - } - else if (m.type == ENOBUFFER) { - } - else { - } - } -} - -int main(void) { - int radio_pid; - - radio_address_t addr = 43; - memset(snd_buffer, 43, SEND_SIZE); - radio_pid = thread_create(radio_stack_buffer, RADIO_STACK_SIZE, PRIORITY_MAIN-2, CREATE_STACKTEST, radio, "radio"); - transceiver_init(TRANSCEIVER_CC1100); - transceiver_start(); - transceiver_register(TRANSCEIVER_CC1100, radio_pid); - - lcd_init(); - clear_display_all(); - mesg.type = SET_ADDRESS; - mesg.content.ptr = (char*) &tcmd; - - display_chars(LCD_SEG_L2_5_0, "CC1100", SEG_ON); - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &addr; - msg_send(&mesg, transceiver_pid, 1); - - send(0, SEND_SIZE, snd_buffer); - - while (1) { - hwtimer_wait(SENDING_DELAY); - display_chars(LCD_SEG_L1_3_0, itoa(hwtimer_now(), 4, 0), SEG_ON); - } -} diff --git a/projects/chronos_cc110x_ng/tests/hello-world b/projects/chronos_cc110x_ng/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/chronos_cc110x_ng/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/chronos_default/Jamfile b/projects/chronos_default/Jamfile deleted file mode 100644 index 0e68768aa26d42cab62d97b3dcf623b433c77b00..0000000000000000000000000000000000000000 --- a/projects/chronos_default/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects chronos_default ; - -Module chronos_default : main.c altitude.c : transceiver cc110x_ng rtc board_buzzer board_display auto_init gpioint display_putchar battery vti_ps ; - -UseModule chronos_default ; diff --git a/projects/chronos_default/main.c b/projects/chronos_default/main.c deleted file mode 100644 index 8189f3fd52be5f8e37c6bbb1d9034d8ffc282efc..0000000000000000000000000000000000000000 --- a/projects/chronos_default/main.c +++ /dev/null @@ -1,167 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <time.h> - -#include <display.h> -#include <cc430-rtc.h> -#include <gpioint.h> -#include <buttons.h> -#include <buzzer.h> - -#include <thread.h> -#include <board.h> -#include <hwtimer.h> -#include <vtimer.h> -#include <msg.h> -#include <transceiver.h> -#include <cc110x_ng.h> -#include <battery.h> - -#include <vti_ps.h> -#include "altitude.h" - -#define BUTTON_EVENT_STAR (0x01) -#define BUTTON_EVENT_NUM (0x02) -#define BUTTON_EVENT_UP (0x04) -#define BUTTON_EVENT_DOWN (0x08) -#define BUTTON_EVENT_BACKLIGHT (0x10) - -#define BUTTON_HANDLER_STACK_SIZE (256) -#define RADIO_STACK_SIZE (512) -#define SEND_SIZE CC1100_MAX_DATA_LENGTH - -#define RCV_BUFFER_SIZE (4) - -#define SENDING_DELAY (5 * 1000) - -char radio_stack_buffer[RADIO_STACK_SIZE]; -char button_handler_stack_buffer[BUTTON_HANDLER_STACK_SIZE]; - -uint8_t snd_buffer[SEND_SIZE]; - -msg_t msg_q[RCV_BUFFER_SIZE]; - -static msg_t mesg; -static transceiver_command_t tcmd; -static radio_packet_t p; - -static int button_handler_pid; -static uint8_t button_event = 0; -static uint8_t mode = 0; - -void send(radio_address_t dst, uint8_t len, uint8_t *data); - -void send(radio_address_t dst, uint8_t len, uint8_t *data) { - mesg.type = SND_PKT; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &p; - - p.length = len; - p.dst = dst; - - p.data = data; - msg_send(&mesg, transceiver_pid, 1); -} - -void radio(void) { - msg_t m; - radio_packet_t *p; - - msg_init_queue(msg_q, RCV_BUFFER_SIZE); - - while (1) { - msg_receive(&m); - if (m.type == PKT_PENDING) { - - p = (radio_packet_t*) m.content.ptr; - send(p->src, p->length, p->data); - - p->processing--; - } - else if (m.type == ENOBUFFER) { - } - else { - } - } -} - -void button_handler(void) { - while (1) { - if (button_event & BUTTON_EVENT_STAR) { - buzzer_beep(15, 5000); - mode++; - button_event &= ~BUTTON_EVENT_STAR; - } - thread_sleep(); - } -} - -void change_mode(void) { - button_event |= BUTTON_EVENT_STAR; - thread_wakeup(button_handler_pid); -} - -int main(void) { - int radio_pid; - uint32_t voltage; - struct tm now; - - ps_init(); - reset_altitude_measurement(); - - now.tm_hour = 3; - now.tm_min = 59; - now.tm_sec = 42; - - rtc_set_localtime(&now); - - now.tm_min = 6; - - rtc_set_alarm(&now, RTC_ALARM_MIN); - - button_handler_pid = thread_create(button_handler_stack_buffer, BUTTON_HANDLER_STACK_SIZE, PRIORITY_MAIN+1, CREATE_STACKTEST, button_handler, "button_handler"); - gpioint_set(2, BUTTON_STAR_PIN, (GPIOINT_RISING_EDGE | GPIOINT_DEBOUNCE), change_mode); - - radio_address_t addr = 43; - memset(snd_buffer, 43, SEND_SIZE); - /* - radio_pid = thread_create(radio_stack_buffer, RADIO_STACK_SIZE, PRIORITY_MAIN-2, CREATE_STACKTEST, radio, "radio"); - transceiver_init(TRANSCEIVER_CC1100); - transceiver_start(); - transceiver_register(TRANSCEIVER_CC1100, radio_pid); - - mesg.type = SET_ADDRESS; - mesg.content.ptr = (char*) &tcmd; - - printf("CC430"); - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &addr; - msg_send(&mesg, transceiver_pid, 1); - - send(12, SEND_SIZE, snd_buffer); -*/ - while (1) { - hwtimer_wait(SENDING_DELAY); - rtc_get_localtime(&now); - - voltage = battery_get_voltage(); - switch (mode) { - case 0: - printf("\n%lu", voltage); - break; - case 1: - printf("\n%02u:%02u", now.tm_hour, now.tm_min); - break; - case 2: - start_altitude_measurement(); - printf("\n%u", sAlt.altitude); - stop_altitude_measurement(); - break; - default: - mode = 0; - break; - } - } -} diff --git a/projects/chronos_default/tests/hello-world b/projects/chronos_default/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/chronos_default/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/default/Jamfile b/projects/default/Jamfile deleted file mode 100644 index 70d0ae1ce80c60fa66bc083bf9859ccfe4c88225..0000000000000000000000000000000000000000 --- a/projects/default/Jamfile +++ /dev/null @@ -1,20 +0,0 @@ -# -# ukleos default project. Consists of a shell. -# -# Copyright (C) 2008, 2009 Kaspar Schleiser <kaspar@schleiser.de> -# - -SubDir TOP projects default ; - -switch $(BOARD) { - case "msb-430h" : - Module default_project : main.c : shell posix_io uart0 shell_commands ps sht11 cc110x_ng transceiver auto_init ; - case "msba2" : - Module default_project : main.c : shell posix_io uart0 shell_commands ps rtc sht11 ltc4150 cc110x_ng transceiver gpioint auto_init config mci ; - case "msb-430" : - Module default_project : main.c : shell posix_io uart0 shell_commands ps sht11 auto_init ; - case "*" : - exit "Board not supported for this project" ; -} - -UseModule default_project ; diff --git a/projects/default/main.c b/projects/default/main.c deleted file mode 100644 index 1a5fea9261349097113d3ac12bb999ecd38f38b8..0000000000000000000000000000000000000000 --- a/projects/default/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de> - */ - -#include <stdio.h> -#include <string.h> - -#include <posix_io.h> -#include <ltc4150.h> -#include <shell.h> -#include <shell_commands.h> -#include <board_uart0.h> -#include <transceiver.h> - -static int shell_readc() { - char c = 0; - (void) posix_read(uart0_handler_pid, &c, 1); - return c; -} - -static void shell_putchar(int c) { - (void) putchar(c); -} - -int main(void) { - shell_t shell; - (void) posix_open(uart0_handler_pid, 0); -#ifdef MODULE_LTC4150 - ltc4150_start(); -#endif -#ifdef MODULE_TRANSCEIVER - transceiver_init(TRANSCEIVER_CC1100); - (void) transceiver_start(); -#endif - - (void) puts("Welcome to ukleos!"); - - shell_init(&shell, NULL, shell_readc, shell_putchar); - - shell_run(&shell); - return 0; -} - - diff --git a/projects/energy2/Jamfile b/projects/energy2/Jamfile deleted file mode 100644 index a23cf6163c1553ee2e39bf17c3c0b3ff143d9424..0000000000000000000000000000000000000000 --- a/projects/energy2/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects energy2 ; - -Module energy2 : main.c testThread.c testSHT11.c led.c testShell.c testLTC4150.c : auto_init hwtimer swtimer sht11 shell posix_io ps uart0 ltc4150 ; - -UseModule energy2 ; diff --git a/projects/energy2/led.c b/projects/energy2/led.c deleted file mode 100644 index a26701707fde081bc3cd6af849f5ab39aadcc6ea..0000000000000000000000000000000000000000 --- a/projects/energy2/led.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * led.c - * - * Created on: 30.05.2012 - * Author: julsch - */ - -#include "led.h" - -#ifndef SWTIMER_H_ -#include <swtimer.h> -#endif - -#ifndef BOARD_H_ -#include <board.h> -#endif - - -char led_stack[MINIMUM_STACK_SIZE+1024]; -int led_pid; -static int timesInThread; -static long int toggleSpeedInThread; - - -/****************************************************************************** - * LED FUNCTIONS - *****************************************************************************/ - -/** - * Toggle the LED n times. - */ -void toggleLedNTimes(int times, long int toggleSpeed) { - LED_RED_ON; - - for (int var = 1; var < times; var++) { - //hwtimer_wait(toggleSpeed); - swtimer_usleep(toggleSpeed); - LED_RED_TOGGLE; - } -} - -/*void toggleLedInThread(void) { - toggleLedNTimes(timesInThread, toggleSpeedInThread); -} - -void toggleLedNTimesInThread(int times, long int toggleSpeed) { - timesInThread = times; - toggleSpeedInThread = toggleSpeed; - led_pid = thread_create(led_stack,sizeof(led_stack),PRIORITY_MIN,CREATE_STACKTEST,toggleLedInThread,"toggle led"); -}*/ - - diff --git a/projects/energy2/led.h b/projects/energy2/led.h deleted file mode 100644 index 5b38a392ef2147bfac75b9e1f5bc8cc68e97b865..0000000000000000000000000000000000000000 --- a/projects/energy2/led.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * led.h - * - * Provides some useful functions to generate different user signals with the - * red LED. - * - * Created on: 30.05.2012 - * Author: julsch - */ - -#ifndef LED_H_ -#define LED_H_ - -#include <thread.h> - -/** - * Toggle the LED n times. - */ -void toggleLedNTimes(int times, long int toggleSpeed); - -//void toggleLedNTimesInThread(int times, long int toggleSpeed); - - -#endif /* LED_H_ */ - - - - diff --git a/projects/energy2/main.c b/projects/energy2/main.c deleted file mode 100644 index 08bb67ca547e44dac872363255bdbbdbf9d9fdc7..0000000000000000000000000000000000000000 --- a/projects/energy2/main.c +++ /dev/null @@ -1,70 +0,0 @@ -#include <stdio.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <board.h> - - -//#include "testThread.h" - -// init MSB -void initMSBModules(void); - -// led functions -//void toggleLedNTimes(int times, long int toggleSpeed); - -// thread functions -//void testThreadFunctions(void); -//int createThread(void (*threadFunction)(char *), char *stack, int stacksize); -//void runThread(void); -//void runThread2(void); - - -// global variables -int thread1 = -1; -int thread2 = -1; -int pid = -1; - -//char stack[2048]; - -/** - * This is the hello-world main file. Here are the first steps for testing and learning c programming. - * @return the program status - */ -int main(void) { - //BEGIN: ORGINAL - //printf("Hello world!\n"); - //END: ORGINAL - - //printf("main loop\n"); - initMSBModules(); - - // --- testing --- - //testThreadFunctions(); - //testSHT11Functions(); - //startShell(); - testLTCFunctions(); - - printf("main loop\n"); - while(1) { - toggleLedNTimes(2,62500LU); - //printf("main loop\n"); - } - - return 0; -} - -/****************************************************************************** - * Initialze MSB modules - *****************************************************************************/ - -/** - * Initiliaze modules of the MSB for the hello-world program. - */ -void initMSBModules(void) { - printf("init MSB modules\n"); - // do nothing because auto_init initiate all init method without parameters - - //hwtimer_init(); - //swtimer_init(); - //sht11_init(); -} diff --git a/projects/energy2/testLTC4150.c b/projects/energy2/testLTC4150.c deleted file mode 100644 index 8cce9ef4807d8f0c580e48d4fe113accfde63870..0000000000000000000000000000000000000000 --- a/projects/energy2/testLTC4150.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * testLTC4150.c - * - * Created on: 05.06.2012 - * Author: julsch - */ - -#include "testLTC4150.h" - -void testLTCFunctions(void) { - startCurrentMeasurement(); - - int i = 0; - while(i < 10) { - printCurrent(); - //printAverageCurrent(); - swtimer_usleep(1000000LU); - //toggleLedNTimes(2,62500LU); - //printf("now %lu",hwtimer_arch_now()); - i++; - } -} - -void startCurrentMeasurement(void) { - printf("starting ltc4150 measuring\n"); - ltc4150_start(); -} - - -void stopCurrentMeasurement(void) { - printf("stopping ltc4150 measuring\n"); - ltc4150_stop(); -} - - -void resetCurrentMeasurement(void) { - printf("restarting ltc4150 measuring\n"); - ltc4150_start(); -} - -double getAverageCurrent(void) { - return ltc4150_get_avg_mA(); -} - -double getCurrent(void) { - return ltc4150_get_current_mA(); -} - -void printAverageCurrent(void) { - double avg = ltc4150_get_avg_mA(); - printf("avg %.4f mA\n", avg); -} - -void printCurrent(void) { - double avg = ltc4150_get_current_mA(); - printf("current %.4f mA\n", avg); -} - -void printCurrentWithLED(void) { - LED_RED_ON; - swtimer_usleep(2000000LU); - double avg = ltc4150_get_current_mA(); - printf("current %.4f mA\n", avg); - LED_RED_OFF; -} - -void printCurrentWithoutLED(void) { - LED_RED_OFF; - swtimer_usleep(2000000LU); - double avg = ltc4150_get_current_mA(); - printf("current %.4f mA\n", avg); -} - - - diff --git a/projects/energy2/testLTC4150.h b/projects/energy2/testLTC4150.h deleted file mode 100644 index ccc24325b611174047a69a6ee38814116407ca77..0000000000000000000000000000000000000000 --- a/projects/energy2/testLTC4150.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * testLTC4150.h - * - * Created on: 05.06.2012 - * Author: julsch - */ - -#ifndef TESTLTC4150_H_ -#define TESTLTC4150_H_ - -#include <swtimer.h> -#include "led.h" -#include <ltc4150.h> -#include <board.h> - -void testLTCFunctions(void); - -void startCurrentMeasurement(void); -void stopCurrentMeasurement(void); -void resetCurrentMeasurement(void); - -double getAverageCurrent(void); -double getCurrent(void); - -void printAverageCurrent(void); -void printCurrent(void); - -void printCurrentWithLED(void); -void printCurrentWithoutLED(void); - -#endif /* TESTLTC4150_H_ */ diff --git a/projects/energy2/testSHT11.c b/projects/energy2/testSHT11.c deleted file mode 100644 index ae4201719fd9990a37049c22b9294ff522f2b565..0000000000000000000000000000000000000000 --- a/projects/energy2/testSHT11.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * testSHT11.c - * Testing sht11 funstions - * - * Created on: 01.06.2012 - * Author: julsch - */ - -#include "testSHT11.h" - -#ifndef THREAD_H_ -#include <thread.h> -#endif - -#ifndef LED_H_ -#include "led.h" -#endif - -// interprocess communication, stack and pid for thread -static sht11_mode_t printingMode; -char stack[8196]; -int pid; - -/** - * Testing SHT11 functions. - */ -void testSHT11Functions(void) { - //printf("resut of 'or': %d\n",HUMIDITY | TEMPERATURE); - - // simple measurement test - /*while(1) { - //printMeasurement(HUMIDITY | TEMPERATURE); - printMeasurement(TEMPERATURE); - swtimer_usleep(1000000LU); - }*/ - - // measurement test in thread - - printingMode = HUMIDITY; - printf("create SHT11 thread\n"); - pid = thread_create(stack, sizeof(stack), 0, STATUS_SLEEPING, getMeasurementInThread, "nr2"); - - int i=0; - while (1) { - i++; - - if (i==2) { - printingMode = HUMIDITY; - } else if (i == 5) { - printingMode = HUMIDITY | TEMPERATURE; - } else { - printingMode = TEMPERATURE; - } - swtimer_usleep(2000000LU); - thread_wakeup(pid); - - i = i % 5; - - } -} - -void getMeasurementInThread(void) { - //thread_print_stack(); - while(1) { - toggleLedNTimes(10,62500LU); - printf("Reading measurements with type %d from SHT11\n", printingMode); - printMeasurement(printingMode); - thread_sleep(); - } -} - -/** - * Depending on parameter sht11_mode_t the procedure prints rel. humidity, - * temperature and/or temperature compensated relative humidity. - * @param sht11_mode_t is value HUMIDITY or/and TEMPERATURE - */ -void printMeasurement(sht11_mode_t mode) { - sht11_val_t sht11_val; - uint8_t success = 0; - success = sht11_read_sensor(&sht11_val, mode); - if (!success) { - printf("Error while reading humidity"); - } else { - toggleLedNTimes(2,50000LU); - switch (mode) { - case HUMIDITY: - printf("%5.2f%% relative humidity\n", sht11_val.relhum); - break; - case TEMPERATURE: - printf("%5.2f%°C temperature\n", sht11_val.temperature); - break; - case HUMIDITY | TEMPERATURE: - printf("%5.2f%°C temperature,\n", sht11_val.temperature); - printf("%5.2f%% relative humidity,\n", sht11_val.relhum); - printf("%5.2f%% temperature compensated relative humidity.\n", sht11_val.relhum_temp); - break; - default: - break; - } - } -} diff --git a/projects/energy2/testSHT11.h b/projects/energy2/testSHT11.h deleted file mode 100644 index e77028f1334261c1bb8d12b54084ae16477bdcde..0000000000000000000000000000000000000000 --- a/projects/energy2/testSHT11.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * testSHT11.h - * - * Created on: 01.06.2012 - * Author: julsch - */ - -#ifndef TESTSHT11_H_ -#define TESTSHT11_H_ - -#ifndef SHT11_H_ -#include <sht11.h> -#endif - -/** - * Testing SHT11 functions. - */ -void testSHT11Functions(void); - -/** - * - */ -void getMeasurementInThread(void); - -/** - * Depending on parameter sht11_mode_t the procedure prints rel. humidity, - * temperature and/or temperature compensated relative humidity. - * @param sht11_mode_t is value HUMIDITY or/and TEMPERATURE - */ -void printMeasurement(sht11_mode_t mode); - - -#endif /* TESTSHT11_H_ */ diff --git a/projects/energy2/testShell.c b/projects/energy2/testShell.c deleted file mode 100644 index bcdb495ea7af1687f2e0d7f92e8a69faaabe7616..0000000000000000000000000000000000000000 --- a/projects/energy2/testShell.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * testShell.c - * - * Created on: 05.06.2012 - * Author: julsch - */ - -#include "testShell.h" -#include "testSHT11.h" -#include "testLTC4150.h" - -//global variables -char shell_stack[MINIMUM_STACK_SIZE+4096]; -shell_t shell; -int shell_pid; - -//#ifdef _TESTSHELL_H_ -extern void printAverageCurrent(void); -extern void printCurrent(void); -//#endif - -void print_teststart(char* str) { - printf("[TEST_START]\n"); -} - -void print_testend(char* str) { - printf("[TEST_END]\n"); -} - -void print_temp(char* str) { - printMeasurement(TEMPERATURE); -} - -void print_avg_current(void) { - printAverageCurrent(); -} - -void print_current(void) { - printCurrent(); -} - -int shell_readc() { - char c = 0; - posix_read(uart0_handler_pid, &c, 1); - return c; -} - -void shell_putchar(int c) { - putchar(c); -} - -const shell_command_t shell_commands[] = { - {"start", "", print_teststart}, - {"end", "", print_testend}, - {"temp","",print_temp}, - {"curLTC","",print_current}, - {"avgLTC","",print_avg_current}, - {"upLTC","",startCurrentMeasurement}, - {"cur_LEDON","",printCurrentWithLED}, - {"cur_LEDOFF","",printCurrentWithoutLED}, - {"ps","",thread_print_all}, - {NULL, NULL, NULL} -}; - -void shell_runner(void) { - - posix_open(uart0_handler_pid, 0); - printf("INIT SHELL.\n"); - shell_init(&shell,shell_commands, shell_readc, shell_putchar); - printf("RUN SHELL.\n"); - shell_run(&shell); -} - -void startShell(void) { - //printf("Moin. build on %s %s SVN-Revision: %s\n", kernel_builddate, kernel_buildtime, kernel_svnrevision); - printf("My Shell.\n"); - - board_uart0_init(); - - //posix_open(uart0_handler_pid, 0); - //printf("INIT SHELL.\n"); - //shell_init(&shell,shell_commands, shell_readc, shell_putchar); - //printf("RUN SHELL.\n"); - //shell_run(&shell); - - // Does not work, maybe the wrong thread is active when entering a command - shell_pid = thread_create(shell_stack,sizeof(shell_stack),PRIORITY_MAIN-1,CREATE_STACKTEST,shell_runner,"s1"); -} - - - diff --git a/projects/energy2/testShell.h b/projects/energy2/testShell.h deleted file mode 100644 index 35ae8114ed0713b6963176fd010a652401d8adef..0000000000000000000000000000000000000000 --- a/projects/energy2/testShell.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * testShell.h - * - * Created on: 05.06.2012 - * Author: julsch - */ - -#ifndef TESTSHELL_H_ -#define TESTSHELL_H_ - -#include <posix_io.h> -#include <shell.h> -#include <board_uart0.h> - -#include <string.h> -#include <stdio.h> -#include <malloc.h> -#include <thread.h> -#include <ps.h> - - -void startShell(void); -void print_teststart(char* str); -void print_testend(char* str); -int shell_readc(); -void shell_putchar(int c); - -#endif /* TESTSHELL_H_ */ diff --git a/projects/energy2/testShell.m b/projects/energy2/testShell.m deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/projects/energy2/testThread.c b/projects/energy2/testThread.c deleted file mode 100644 index 1c643e7bb36e4b8a128cadf0f5faea34e807e3a2..0000000000000000000000000000000000000000 --- a/projects/energy2/testThread.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * testThread.c - * testing thread functions in ukleos - * Created on: 01.06.2012 - * Author: julsch - */ - -#include "testThread.h" -#ifndef THREAD_H_ -#include <thread.h> -#endif - - -/** - * Testing thread functions - * Thread exmaple only works, if the content of the body is included in the - * main. In testThreadFunction the example does not work. - */ -void testThreadFunctions(void) { - printf("init thread\n"); - toggleLedNTimes(10,125000LU); - - int thread1 = -1; - int thread2 = -1; - - thread1 = createThread(runThread, second_thread_stack, sizeof(second_thread_stack)); - thread2 = createThread(runThread2, third_thread_stack, sizeof(third_thread_stack)); -} - -/** - * howto-exmaple to create a thread in ukleos. The new thread runs the first time after the caller function returns or the procedure ends. - * The caller function has to declared the stack. - */ -int createThread(void (*threadFunction)(void), char *stack, int stacksize) { - int threadID; - - printf("create thread\n"); - threadID = thread_create(stack, stacksize, 0, CREATE_WOUT_YIELD | CREATE_STACKTEST, threadFunction, "nr2"); - return threadID; -} - - -/** - * Thread execution function. The function print the whole ABC on serial and redo this on an infinite loop - */ -void runThread(void) { - char *value = 'A'; - while(1) { - swtimer_usleep(500000LU); - printf("Message %c\n", value); - if (value == 90) { - value = 64; - toggleLedNTimes(10,50000LU); - } - value++; - } -} - -/** - * Second thread execution function. The function prints numbers between 1 and 90 in an infinite loop. - */ -void runThread2(void) { - char *value = 1; - while(1) { - swtimer_usleep(500000LU); - printf("Message %d\n", value); - if (value == 90) { - value = 1; - toggleLedNTimes(10,50000LU); - } - value++; - } -} - - diff --git a/projects/energy2/testThread.h b/projects/energy2/testThread.h deleted file mode 100644 index 10a1ab5a9c8c3eb26dc1e4ac9ffc46c63d54020d..0000000000000000000000000000000000000000 --- a/projects/energy2/testThread.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * testThread.h - * - * Created on: 01.06.2012 - * Author: julsch - */ - -#ifndef TESTTHREAD_H_ -#define TESTTHREAD_H_ - - -char second_thread_stack[8192]; -char third_thread_stack[8192]; - - -/** - * Testing thread functions - * Thread exmaple only works, if the content of the body is included in the - * main. In testThreadFunction the example does not work. - */ -void testThreadFunctions(void); - -/** - * howto-exmaple to create a thread in ukleos. The new thread runs the first time after the caller function returns or the procedure ends. - * The caller function has to declared the stack. - */ -int createThread(void (*threadFunction)(void), char *stack, int stacksize); - -/** - * Thread execution function. The function print the whole ABC on serial and redo this on an infinite loop - */ -void runThread(void); - -/** - * Second thread execution function. The function prints numbers between 1 and 90 in an infinite loop. - */ -void runThread2(void); - - - - -#endif /* TESTTHREAD_H_ */ diff --git a/projects/energy2/tests/hello-world b/projects/energy2/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/energy2/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/energy_profile_functions/Jamfile b/projects/energy_profile_functions/Jamfile deleted file mode 100644 index 6263981a89e60fc266ecae58787977d913744f81..0000000000000000000000000000000000000000 --- a/projects/energy_profile_functions/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects energy_profile_functions ; - -Module energy_profile_functions : main.c led.c : auto_init swtimer ; - -UseModule energy_profile_functions ; diff --git a/projects/energy_profile_functions/led.c b/projects/energy_profile_functions/led.c deleted file mode 100644 index a26701707fde081bc3cd6af849f5ab39aadcc6ea..0000000000000000000000000000000000000000 --- a/projects/energy_profile_functions/led.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * led.c - * - * Created on: 30.05.2012 - * Author: julsch - */ - -#include "led.h" - -#ifndef SWTIMER_H_ -#include <swtimer.h> -#endif - -#ifndef BOARD_H_ -#include <board.h> -#endif - - -char led_stack[MINIMUM_STACK_SIZE+1024]; -int led_pid; -static int timesInThread; -static long int toggleSpeedInThread; - - -/****************************************************************************** - * LED FUNCTIONS - *****************************************************************************/ - -/** - * Toggle the LED n times. - */ -void toggleLedNTimes(int times, long int toggleSpeed) { - LED_RED_ON; - - for (int var = 1; var < times; var++) { - //hwtimer_wait(toggleSpeed); - swtimer_usleep(toggleSpeed); - LED_RED_TOGGLE; - } -} - -/*void toggleLedInThread(void) { - toggleLedNTimes(timesInThread, toggleSpeedInThread); -} - -void toggleLedNTimesInThread(int times, long int toggleSpeed) { - timesInThread = times; - toggleSpeedInThread = toggleSpeed; - led_pid = thread_create(led_stack,sizeof(led_stack),PRIORITY_MIN,CREATE_STACKTEST,toggleLedInThread,"toggle led"); -}*/ - - diff --git a/projects/energy_profile_functions/led.h b/projects/energy_profile_functions/led.h deleted file mode 100644 index 5b38a392ef2147bfac75b9e1f5bc8cc68e97b865..0000000000000000000000000000000000000000 --- a/projects/energy_profile_functions/led.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * led.h - * - * Provides some useful functions to generate different user signals with the - * red LED. - * - * Created on: 30.05.2012 - * Author: julsch - */ - -#ifndef LED_H_ -#define LED_H_ - -#include <thread.h> - -/** - * Toggle the LED n times. - */ -void toggleLedNTimes(int times, long int toggleSpeed); - -//void toggleLedNTimesInThread(int times, long int toggleSpeed); - - -#endif /* LED_H_ */ - - - - diff --git a/projects/energy_profile_functions/main.c b/projects/energy_profile_functions/main.c deleted file mode 100644 index 6e2e7f01903109d8a0ec397af9e5f01d55277667..0000000000000000000000000000000000000000 --- a/projects/energy_profile_functions/main.c +++ /dev/null @@ -1,31 +0,0 @@ -//#include <stdio.h> -//#include "trace.h" - -#include "led.c" - -int main(void) { - printf("Hello world!\n"); - - int i = 0; - while(1) { - i++; - jumpToDummyFunction(); - jumpWithoutProfileFunction(); - if (i >= 20) { - break; - } - } - - return 0; -} - - -void jumpToDummyFunction() { - - printf("This is a dummy.\n"); -} - -void __attribute__((__no_instrument_function__)) jumpWithoutProfileFunction() { - printf("no profile\n"); -} - diff --git a/projects/energy_profile_functions/tests/hello-world b/projects/energy_profile_functions/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/energy_profile_functions/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/energy_profile_functions/trace.c b/projects/energy_profile_functions/trace.c deleted file mode 100644 index acac35ec9094b2708f96af22061b1c701e3c3c34..0000000000000000000000000000000000000000 --- a/projects/energy_profile_functions/trace.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * trace.c - * - * Created on: 19.06.2012 - * Author: julsch - */ -//#include "led.h" - -void __attribute__((no_instrument_function)) __cyg_profile_func_enter (void *func, void *caller) { - //if(fp_trace != NULL) { - printf("e %p %p\n", func, caller); - //} - //toggleLedNTimes(2,62500LU); -} - -void __attribute__((no_instrument_function)) __cyg_profile_func_exit (void *func, void *caller) { - //if(fp_trace != NULL) { - printf("x %p %p\n", func, caller); - //} - //toggleLedNTimes(2,62500LU); -} - - diff --git a/projects/energy_profile_functions/trace.h b/projects/energy_profile_functions/trace.h deleted file mode 100644 index fa8295db48359f6101b97d46232557358c6ca1c8..0000000000000000000000000000000000000000 --- a/projects/energy_profile_functions/trace.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * trace.h - * - * Created on: 19.06.2012 - * Author: julsch - */ - -#ifndef TRACE_H_ -#define TRACE_H_ - -void __attribute__((no_instrument_function))__cyg_profile_func_enter (void *func, void *caller); -void __attribute__((no_instrument_function))__cyg_profile_func_exit (void *func, void *caller); - - -#endif /* TRACE_H_ */ diff --git a/projects/hello-world/Jamfile b/projects/hello-world/Jamfile deleted file mode 100644 index 8bedf45b40a8eea0830c6305f45c1a779dfaac4e..0000000000000000000000000000000000000000 --- a/projects/hello-world/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects hello-world ; - -Module hello_world : main.c ; - -UseModule hello_world ; \ No newline at end of file diff --git a/projects/hello-world/main.c b/projects/hello-world/main.c deleted file mode 100644 index 4273d27aafc892de89897a721e8fdf3a993fc1bd..0000000000000000000000000000000000000000 --- a/projects/hello-world/main.c +++ /dev/null @@ -1,15 +0,0 @@ -//#include <stdio.h> -//#include "math.h" - -/** - * This is the hello-world main file. Here are the first steps for testing and learning c programming. - * @return the program status - */ -int main(void) { - //BEGIN: ORGINAL - printf("Hello world!\n"); - //END: ORGINAL - - return 0; -} - diff --git a/projects/hello-world/tests/hello-world b/projects/hello-world/tests/hello-world deleted file mode 100755 index 80cda76a1794cb7ba4ec0763c70e272a0d3c0052..0000000000000000000000000000000000000000 --- a/projects/hello-world/tests/hello-world +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -exec jam reset - -expect { - "Hello world!" {} - timeout { - puts "\nTest not successful!\n" - exit 1 - } -} - -puts "\nTest successful!\n" - diff --git a/projects/hello-world/tests/hello-world.py b/projects/hello-world/tests/hello-world.py deleted file mode 100755 index ffc523b5e9cce86f8b2e9e08bb67046696c391e8..0000000000000000000000000000000000000000 --- a/projects/hello-world/tests/hello-world.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python -import pexpect -import os -import subprocess - -# testing hello world - -child = pexpect.spawn ("pseudoterm %s" % os.environ["PORT"]) - -null = open('/dev/null', 'wb') -subprocess.call(['jam', 'reset'], stdout=null) - -child.expect ('Hello world!\r\n') -print("Test successful!") diff --git a/projects/hi_earth/Jamfile b/projects/hi_earth/Jamfile deleted file mode 100644 index 812f2c91274a779d5625941aaa48f1b3e092c5e2..0000000000000000000000000000000000000000 --- a/projects/hi_earth/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects hi_earth ; - -Module hi_earth : main.c : auto_init display_putchar ; - -UseModule hi_earth ; diff --git a/projects/hi_earth/main.c b/projects/hi_earth/main.c deleted file mode 100644 index f4be0369e1c96f27f1661d2b03c9b12676b8f00d..0000000000000000000000000000000000000000 --- a/projects/hi_earth/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <stdio.h> -int main(void) -{ - printf("Hi Earth\n"); - - while(1) { - } -} diff --git a/projects/laser/Jamfile b/projects/laser/Jamfile deleted file mode 100644 index 9a9c559502321cac80635b5e7d47050d691b0738..0000000000000000000000000000000000000000 --- a/projects/laser/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects laser ; - -Module laser : main.c : sht11 ltc4150 swtimer auto_init ; - -UseModule laser ; diff --git a/projects/laser/main.c b/projects/laser/main.c deleted file mode 100644 index e3c3d4f83e4148e979c3dca4c73423d2af22c1c8..0000000000000000000000000000000000000000 --- a/projects/laser/main.c +++ /dev/null @@ -1,33 +0,0 @@ -#include <stdio.h> -#include <sht11.h> -#include <board.h> -#include <swtimer.h> -#include <ltc4150.h> - -int main(void) -{ - sht11_val_t sht11_val; - double mAh = 0; - - uint8_t success = 0; - - puts(""); - puts("LaSeR: Longterm Sensor Reader initialized."); - puts("Printing \"temperature in °C;relative humidity;temperature compensated relative humidity\"."); - puts(""); - - ltc4150_start(); - - while (1) { - success = sht11_read_sensor(&sht11_val, HUMIDITY|TEMPERATURE); - mAh = ltc4150_get_total_mAh(); - if (!success) { - printf("error;error;error\n"); - } - else { - printf("%.2f;%.2f;%.2f;%.2f\n", sht11_val.temperature, sht11_val.relhum, sht11_val.relhum_temp, mAh); - } - LED_RED_TOGGLE; - swtimer_usleep(60 * 1000*1000); - } -} diff --git a/projects/long_term/Jamfile b/projects/long_term/Jamfile deleted file mode 100644 index 80311d08a0e93ec0e6323f5afbf65ffbc1ec973c..0000000000000000000000000000000000000000 --- a/projects/long_term/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects long_term ; - -Module long_term : main.c : swtimer ; - -UseModule long_term ; diff --git a/projects/long_term/main.c b/projects/long_term/main.c deleted file mode 100644 index 751b7b666e8f65756e516dfd0043d8f89fafc458..0000000000000000000000000000000000000000 --- a/projects/long_term/main.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <stdio.h> -#include <stdint.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <board.h> - -int main(void) -{ - hwtimer_init(); - swtimer_init(); - uint32_t i = 0; - - while (1) { - printf("(%10lu) Still running...\n", i++); - LED_RED_TOGGLE; - swtimer_usleep(10000); - } -} diff --git a/projects/msb430_cc110x_ng/Jamfile b/projects/msb430_cc110x_ng/Jamfile deleted file mode 100644 index 61234651ec4b4b3645c0a98d64fe7695bc1b54a7..0000000000000000000000000000000000000000 --- a/projects/msb430_cc110x_ng/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects msb430_cc110x_ng ; - -Module msb430_cc110x_ng : main.c : cc110x_ng transceiver swtimer shell shell_commands ps posix_io uart0 auto_init config ; - -UseModule msb430_cc110x_ng ; diff --git a/projects/msb430_cc110x_ng/main.c b/projects/msb430_cc110x_ng/main.c deleted file mode 100644 index 418e94e34d0af35d6d645bfb912092a74f13c35b..0000000000000000000000000000000000000000 --- a/projects/msb430_cc110x_ng/main.c +++ /dev/null @@ -1,158 +0,0 @@ -#include <stdio.h> -#include <string.h> - -#include <shell.h> -#include <board_uart0.h> -#include <posix_io.h> -#include <thread.h> -#include <board.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <msg.h> -#include <transceiver.h> -#include <cc110x_ng.h> - -#define SHELL_STACK_SIZE (512) -#define RADIO_STACK_SIZE (512) - -#define SND_BUFFER_SIZE (3) -#define RCV_BUFFER_SIZE (4) - -#define SENDING_DELAY (5 * 1000) - -char shell_stack_buffer[SHELL_STACK_SIZE]; -char radio_stack_buffer[RADIO_STACK_SIZE]; - -uint8_t snd_buffer[SND_BUFFER_SIZE][CC1100_MAX_DATA_LENGTH]; - -msg_t msg_q[RCV_BUFFER_SIZE]; - -static msg_t mesg; -static transceiver_command_t tcmd; -static radio_packet_t p; - -void sender(char *count); -void print_buffer(char *unused); - -shell_t shell; -const shell_command_t sc[] = { - {"snd", "", sender}, - {"buffer", "", print_buffer}, - {NULL, NULL, NULL} -}; - -void send(radio_address_t dst, uint8_t len, uint8_t *data); - -void send(radio_address_t dst, uint8_t len, uint8_t *data) { - mesg.type = SND_PKT; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &p; - - p.length = len; - p.dst = dst; - - p.data = data; - msg_send(&mesg, transceiver_pid, 1); -} - -void shell_runner(void) { - shell_init(&shell, sc, uart0_readc, uart0_putc); - posix_open(uart0_handler_pid, 0); - shell_run(&shell); -} - - -void sender(char *count) { - unsigned int c = 3; - unsigned int i; - - mesg.type = SND_PKT; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &p; - - p.length = CC1100_MAX_DATA_LENGTH; - p.dst = 0; - - for (i = 0; i < c; i++) { - puts("."); - p.data = snd_buffer[i % SND_BUFFER_SIZE]; - msg_send(&mesg, transceiver_pid, 1); - hwtimer_wait(50000); - } -} - -void print_buffer(char *unused) { - uint8_t i; - extern radio_packet_t transceiver_buffer[]; - for (i = 0; i < TRANSCEIVER_BUFFER_SIZE; i++) { - printf("[%u] %u # %u # %u\n", i, transceiver_buffer[i].processing, transceiver_buffer[i].length, transceiver_buffer[i].data[i]); - } - extern rx_buffer_t cc110x_rx_buffer[]; - for (i = 0; i < TRANSCEIVER_BUFFER_SIZE; i++) { - printf("[%u] %u # %u \n", i, cc110x_rx_buffer[i].packet.length, cc110x_rx_buffer[i].packet.data[i]); - } -} - -void radio(void) { - msg_t m; - radio_packet_t *p; - uint8_t i; - - msg_init_queue(msg_q, RCV_BUFFER_SIZE); - - while (1) { - msg_receive(&m); - if (m.type == PKT_PENDING) { - p = (radio_packet_t*) m.content.ptr; - printf("Packet waiting, process %p...\n", p); - printf("\tLength:\t%u\n", p->length); - printf("\tSrc:\t%u\n", p->src); - printf("\tDst:\t%u\n", p->dst); - printf("\tLQI:\t%u\n", p->lqi); - printf("\tRSSI:\t%u\n", p->rssi); - - for (i = 0; i < p->length; i++) { - printf("%02X ", p->data[i]); - } - send(p->src, p->length, p->data); - p->processing--; - printf("\n"); - } - else if (m.type == ENOBUFFER) { - puts("Transceiver buffer full"); - } - else { - puts("Unknown packet received"); - } - } -} - -int main(void) { - int radio_pid; - uint8_t i; - for (i = 0; i < SND_BUFFER_SIZE; i++) { - memset(snd_buffer[i], i, CC1100_MAX_DATA_LENGTH); - } - thread_create(shell_stack_buffer, SHELL_STACK_SIZE, PRIORITY_MAIN-2, CREATE_STACKTEST, shell_runner, "shell"); - radio_pid = thread_create(radio_stack_buffer, RADIO_STACK_SIZE, PRIORITY_MAIN-2, CREATE_STACKTEST, radio, "radio"); - transceiver_init(TRANSCEIVER_CC1100); - transceiver_start(); - transceiver_register(TRANSCEIVER_CC1100, radio_pid); - sender(NULL); - - printf("Config:\n"); - printf("\tid: %u\n", sysconfig.id); - printf("\taddr: %u\n", sysconfig.radio_address); - printf("\tchannel: %u\n", sysconfig.radio_channel); - - while (1) { - extern void thread_print_all(void); - thread_print_all(); - print_buffer(NULL); - hwtimer_wait(50000); - } -} diff --git a/projects/msb430_cc110x_ng/tests/hello-world b/projects/msb430_cc110x_ng/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/msb430_cc110x_ng/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/new_project.sh b/projects/new_project.sh deleted file mode 100644 index 54d8ced50b87ae42170ed1dac541457f885e01ea..0000000000000000000000000000000000000000 --- a/projects/new_project.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -u - -if [ -e ${1} ]; then - echo "Directory \"${1}\" exists. Will not overwrite." - exit 1 -fi - -echo "Creating project ${1}..." - -cp -r skel ${1} -rm -rf ${1}/.svn/ ${1}/tests/.svn/ -sed -i -e "s/skel/${1}/g" ${1}/main.c -sed -i -e "s/skel/${1}/g" ${1}/Jamfile - -echo "Done." - diff --git a/projects/pingpong/Jamfile b/projects/pingpong/Jamfile deleted file mode 100644 index 2de8f82530654b04282893336fc8ed35ce18672b..0000000000000000000000000000000000000000 --- a/projects/pingpong/Jamfile +++ /dev/null @@ -1,4 +0,0 @@ -SubDir TOP projects pingpong ; - -Module pingpong : main.c ; -UseModule pingpong ; diff --git a/projects/pingpong/main.c b/projects/pingpong/main.c deleted file mode 100644 index 0a4a910a9bc54e2310fb5e06c280fd70219c7538..0000000000000000000000000000000000000000 --- a/projects/pingpong/main.c +++ /dev/null @@ -1,35 +0,0 @@ -#include <stdio.h> -#include <thread.h> -#include <msg.h> -#include <kernel.h> - -void second_thread(void) { - printf("second_thread starting.\n"); - msg_t m; - - while(1) { - msg_receive(&m); -// printf("2nd: got msg from %i\n", m.sender_pid); - m.content.value++; - msg_send(&m, m.sender_pid, true); - } -} - -char second_thread_stack[KERNEL_CONF_STACKSIZE_MAIN]; - -int main(void) -{ - printf("Hello world!\n"); - - msg_t m; - - int pid = thread_create(second_thread_stack, sizeof(second_thread_stack), PRIORITY_MAIN-1, CREATE_WOUT_YIELD | CREATE_STACKTEST, second_thread, "pong"); - - m.content.value = 1; - - while(1) { - msg_send(&m, pid, true); - msg_receive(&m); - printf("Got msg with content %i\n", m.content.value); - } -} diff --git a/projects/pingpong/tests/hello-world b/projects/pingpong/tests/hello-world deleted file mode 100755 index 6f4a6ca8114811b10ab0ba8bd7193769aab5f889..0000000000000000000000000000000000000000 --- a/projects/pingpong/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/pingpong_sync/Jamfile b/projects/pingpong_sync/Jamfile deleted file mode 100644 index 85229b05d0d6db7184e07edad156699bc47da9ed..0000000000000000000000000000000000000000 --- a/projects/pingpong_sync/Jamfile +++ /dev/null @@ -1,6 +0,0 @@ -SubDir TOP projects pingpong_sync ; -# LOCATE_TARGET = $(SEARCH_SOURCE)/bin ; - -Library pingpong_sync : main.c ; - -LinkLibraries $(BOARD).elf : pingpong_sync ; diff --git a/projects/pingpong_sync/main.c b/projects/pingpong_sync/main.c deleted file mode 100644 index 47989a2678c9c8e43b782b13e8e1da3bec8c86ee..0000000000000000000000000000000000000000 --- a/projects/pingpong_sync/main.c +++ /dev/null @@ -1,34 +0,0 @@ -#include <stdio.h> -#include <thread.h> -#include <msg.h> -#include <kernel.h> - -void second_thread(void) { - printf("second_thread starting.\n"); - msg_t m; - int i = 1; - while(1) { - msg_receive(&m); -// printf("2nd: got msg from %i\n", m.sender_pid); - m.content.value++; - msg_reply(&m, &m); - } -} - -char second_thread_stack[8192]; - -int main(void) -{ - printf("Hello world!\n"); - - msg_t m; - - int pid = thread_create(second_thread_stack, sizeof(second_thread_stack), PRIORITY_MAIN-1, CREATE_WOUT_YIELD | CREATE_STACKTEST, second_thread, "pong"); - - m.content.value = 1; - - while(1) { - msg_send_receive(&m, &m, pid); - printf("Got msg with content %i\n", m.content.value); - } -} diff --git a/projects/pingpong_sync/tests/hello-world b/projects/pingpong_sync/tests/hello-world deleted file mode 100755 index 6f4a6ca8114811b10ab0ba8bd7193769aab5f889..0000000000000000000000000000000000000000 --- a/projects/pingpong_sync/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/simple_weather_station/Jamfile b/projects/simple_weather_station/Jamfile deleted file mode 100644 index e49a167fa2349275b05926c6584bdc7d348d5aec..0000000000000000000000000000000000000000 --- a/projects/simple_weather_station/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects simple_weather_station ; - -Module simple_weather_station : main.c : swtimer sht11 ; - -UseModule simple_weather_station ; diff --git a/projects/simple_weather_station/main.c b/projects/simple_weather_station/main.c deleted file mode 100644 index 24062965348885bf44df345fd14a5fae83c4e20f..0000000000000000000000000000000000000000 --- a/projects/simple_weather_station/main.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <stdio.h> -#include <stdint.h> -#include <sht11.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <board.h> - -int main(void) -{ - sht11_val_t sht11_val; - uint8_t success = 0; - - hwtimer_init(); - swtimer_init(); - sht11_init(); - while (1) { - success = sht11_read_sensor(&sht11_val, HUMIDITY|TEMPERATURE); - if (!success) { - printf("Error reading SHT11\n"); - } - else { - printf("%-6.2f°C %5.2f%% (%5.2f%%)\n", sht11_val.temperature, sht11_val.relhum, sht11_val.relhum_temp); - } - LED_RED_TOGGLE; - swtimer_usleep(1000 * 1000); - } -} diff --git a/projects/sixborder/Jamfile b/projects/sixborder/Jamfile deleted file mode 100644 index c5cf73051af5db007cbff6d6ed26e92a28ea34b2..0000000000000000000000000000000000000000 --- a/projects/sixborder/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects sixborder ; - -Module sixborder : main.c : auto_init uart0 posix_io cc110x_ng 6lowpan vtimer rtc destiny ; - -UseModule sixborder ; diff --git a/projects/sixborder/main.c b/projects/sixborder/main.c deleted file mode 100644 index f3ffa2c759e5b186f5f5cd793d19ba70ed3207ec..0000000000000000000000000000000000000000 --- a/projects/sixborder/main.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdio.h> -#include <string.h> - -#include <transceiver.h> -#include <vtimer.h> -#include "sys/net/sixlowpan/sixlowip.h" -#include "sys/net/sixlowpan/sixlowborder.h" -#include "sys/net/sixlowpan/sixlowerror.h" - -int main(void) -{ - border_initialize(TRANSCEIVER_CC1100, NULL); -} diff --git a/projects/sixborder/tests/hello-world b/projects/sixborder/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/sixborder/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/sixlowpan/Jamfile b/projects/sixlowpan/Jamfile deleted file mode 100644 index 9ef028dbaa0f5df097bc9ff6013af819b25e1f31..0000000000000000000000000000000000000000 --- a/projects/sixlowpan/Jamfile +++ /dev/null @@ -1,11 +0,0 @@ -# -# FireKernel example project Jamfile -# -# Copyright (C) 2008, 2009 Kaspar Schleiser <kaspar@schleiser.de> -# - -SubDir TOP projects sixlowpan ; - -Module sixlowpan : main.c : ps shell_commands config shell posix_io uart0 cc110x_ng 6lowpan vtimer auto_init rtc rpl ; - -UseModule sixlowpan ; diff --git a/projects/sixlowpan/main.c b/projects/sixlowpan/main.c deleted file mode 100644 index dc3de949db6c153cd89a359ae349ba4452327b05..0000000000000000000000000000000000000000 --- a/projects/sixlowpan/main.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <malloc.h> - -#include <posix_io.h> -#include <shell.h> -#include <board_uart0.h> -#include <vtimer.h> -#include <ltc4150.h> -#include <thread.h> -#include <cc110x_ng.h> -#include <transceiver.h> -#include <time.h> -#include <rtc.h> -#include "sys/net/sixlowpan/sixlowmac.h" -#include "sys/net/sixlowpan/sixlowip.h" -#include "sys/net/sixlowpan/sixlowborder.h" -#include "sys/net/sixlowpan/sixlowpan.h" -#include "sys/net/sixlowpan/sixlowerror.h" - -void init(char *str){ - char command; - uint16_t r_addr; - ipv6_addr_t std_addr; - - int res = sscanf(str, "init %c %hu", &command, &r_addr); - - if(res < 1){ - printf("Usage: init {h | r | a | e} radio_address\n"); - printf("\th\tinitialize as host\n"); - printf("\tr\tinitialize as router\n"); - printf("\ta\tinitialize as ad-hoc router\n"); - printf("\tb\tinitialize as border router\n\n"); - printf("\tradio_address must be an 8 bit integer\n"); - } - - ipv6_init_address(&std_addr,0xABCD,0,0,0,0x1034,0x00FF,0xFE00,r_addr); - - switch (command) { - case 'h': - printf("INFO: Initialize as host on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - sixlowpan_init(TRANSCEIVER_CC1100,r_addr,0); - break; - case 'r': - printf("INFO: Initialize as router on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - sixlowpan_init(TRANSCEIVER_CC1100, r_addr,0); - ipv6_init_iface_as_router(); - break; - case 'a': - printf("INFO: Initialize as adhoc router on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - sixlowpan_adhoc_init(TRANSCEIVER_CC1100, &std_addr, r_addr); - break; - case 'b': - printf("INFO: Initialize as border router on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - res = border_initialize(TRANSCEIVER_CC1100, &std_addr); - switch (res) { - case (SUCCESS): printf("INFO: Border router initialized.\n"); break; - case (SIXLOWERROR_ADDRESS): printf("ERROR: Illegal IP address: "); - ipv6_print_addr(&std_addr); break; - default: printf("ERROR: Unknown error (%d).\n", res); break; - } - break; - default: - printf("ERROR: Unknown command '%c'\n", command); - break; - } -} - -void bootstrapping(char *str){ - sixlowpan_bootstrapping(); -} - -void send_packet(char *str){ - uint8_t test[2]; - test[0] = 30; - test[1] = 98; - - ipv6_addr_t ipaddr; - ipv6_init_address(&ipaddr, 0xabcd, 0x0, 0x0, 0x0, 0x3612, 0x00ff, 0xfe00, 0x0005); - ipv6_print_addr(&ipaddr); - - for(int j=0;j<100;j++){ - test[0] = j; - for(int i=0;i<1000;i++){ - sixlowpan_send(&ipaddr, test, 2, 0); - } - //lib6lowpan_bootstrapping(&addr8); - } -} - -void set_radio_chann(char *str){ - uint16_t chann; - int res = sscanf(str, "set_chann %hu", &chann); - if(res < 1){ - printf("Usage: set_chann [channel]\n"); - } - - cc110x_set_channel(chann); -} - -void get_r_address(char *str){ - printf("radio: %hu\n", cc110x_get_address()); -} - -void ip(char *str){ - ipv6_iface_print_addrs(); -} - -void context(char *str){ - uint8_t i; - lowpan_context_t *context; - - for(i = 0; i < LOWPAN_CONTEXT_MAX; i++){ - context = lowpan_context_num_lookup(i); - if (context != NULL) { - printf("%2d\tLifetime: %5u\tLength: %3d\t",context->num,context->lifetime,context->length); - ipv6_print_addr(&(context->prefix)); - } - } -} - -const shell_command_t shell_commands[] = { - {"send", "", send_packet}, - {"init", "", init}, - {"addr", "", get_r_address}, - {"set_chann", "", set_radio_chann}, - {"boot", "", bootstrapping}, - {"ip", "", ip}, - {"context", "", context}, - {NULL, NULL, NULL} -}; - -int main(void) { - printf("6LoWPAN\n"); - vtimer_init(); - - posix_open(uart0_handler_pid, 0); - //struct tm now; - //rtc_get_localtime(&now); - - //srand((unsigned int)now.tm_sec); - //uint8_t random = rand() % 256; - //printf("address: %d\n", random); - - shell_t shell; - shell_init(&shell, shell_commands, uart0_readc, uart0_putc); - - shell_run(&shell); - - return 0; -} - - diff --git a/projects/sixlowpan/tests/hello-world b/projects/sixlowpan/tests/hello-world deleted file mode 100755 index 6f4a6ca8114811b10ab0ba8bd7193769aab5f889..0000000000000000000000000000000000000000 --- a/projects/sixlowpan/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/skel/Jamfile b/projects/skel/Jamfile deleted file mode 100644 index cf61c5db8a304264eda8c33b23507523b5e738ae..0000000000000000000000000000000000000000 --- a/projects/skel/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects skel ; - -Module skel : main.c ; - -UseModule skel ; diff --git a/projects/skel/main.c b/projects/skel/main.c deleted file mode 100644 index 2aa451ee0666a59816359ae3fd2678d125b7d357..0000000000000000000000000000000000000000 --- a/projects/skel/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <stdio.h> - -int main(void) -{ - puts("Hello world!\n"); - - while(1); -} diff --git a/projects/skel/tests/hello-world b/projects/skel/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/skel/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/test_cc110x_ng/Jamfile b/projects/test_cc110x_ng/Jamfile deleted file mode 100644 index 5ef69ea238a5a997905d98a550084984aca3babf..0000000000000000000000000000000000000000 --- a/projects/test_cc110x_ng/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_cc110x_ng ; - -Module test_cc110x_ng : main.c : cc110x_ng shell shell_commands transceiver ps rtc posix_io uart0 auto_init swtimer config ltc4150 ; - -UseModule test_cc110x_ng ; diff --git a/projects/test_cc110x_ng/main.c b/projects/test_cc110x_ng/main.c deleted file mode 100644 index 0ee8d2f09d7b6fc1bf721882e566cd9ec2fe637c..0000000000000000000000000000000000000000 --- a/projects/test_cc110x_ng/main.c +++ /dev/null @@ -1,199 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <transceiver.h> - -#include <shell.h> -#include <board_uart0.h> -#include <posix_io.h> -#include <thread.h> -#include <board.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <msg.h> -#include <cc110x_ng.h> - -#define SHELL_STACK_SIZE (2048) -#define RADIO_STACK_SIZE (2048) - -#define SND_BUFFER_SIZE (100) -#define RCV_BUFFER_SIZE (64) - -#define SENDING_DELAY (5 * 1000) - -char shell_stack_buffer[SHELL_STACK_SIZE]; -char radio_stack_buffer[RADIO_STACK_SIZE]; - -uint8_t snd_buffer[SND_BUFFER_SIZE][CC1100_MAX_DATA_LENGTH]; - -msg_t msg_q[RCV_BUFFER_SIZE]; - -static msg_t mesg; -static transceiver_command_t tcmd; -static radio_packet_t p; -static uint16_t a; - -static uint32_t sending_delay = SENDING_DELAY; - -void sender(char *count); -void print_buffer(char *unused); -void switch2rx(char *unused); -void powerdown(char *unused); -void set_delay(char *delay); -#ifdef DBG_IGNORE -void ignore(char *addr); -#endif - -shell_t shell; -const shell_command_t sc[] = { - {"on", "", switch2rx}, - {"off", "", powerdown}, - {"snd", "", sender}, - {"delay", "", set_delay}, - {"buffer", "", print_buffer}, -#ifdef DBG_IGNORE - {"ign", "ignore node", ignore}, -#endif - {NULL, NULL, NULL}}; - -void shell_runner(void) { - shell_init(&shell, sc, uart0_readc, uart0_putc); - posix_open(uart0_handler_pid, 0); - shell_run(&shell); -} - -void sender(char *count) { - unsigned int c, i; - - mesg.type = SND_PKT; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &p; - - p.length = CC1100_MAX_DATA_LENGTH; - p.dst = 0; - - sscanf(count, "snd %u", &c); - for (i = 0; i < c; i++) { - puts("."); - p.data = snd_buffer[i % SND_BUFFER_SIZE]; - msg_send(&mesg, transceiver_pid, 1); - swtimer_usleep(sending_delay); - } -} - -void print_buffer(char *unused) { - uint8_t i; - extern radio_packet_t transceiver_buffer[]; - for (i = 0; i < TRANSCEIVER_BUFFER_SIZE; i++) { - printf("[%u] %u # %u # %u\n", i, transceiver_buffer[i].processing, transceiver_buffer[i].length, transceiver_buffer[i].data[i]); - } - extern rx_buffer_t cc110x_rx_buffer[]; - for (i = 0; i < TRANSCEIVER_BUFFER_SIZE; i++) { - printf("[%u] %u # %u \n", i, cc110x_rx_buffer[i].packet.length, cc110x_rx_buffer[i].packet.data[i]); - } -} - -void switch2rx(char *unused) { - mesg.type = SWITCH_RX; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - puts("Turning transceiver on"); - if (msg_send(&mesg, transceiver_pid, 1)) { - puts("\tsuccess"); - } -} - -void powerdown(char *unused) { - mesg.type = POWERDOWN; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - puts("Turning transceiver off"); - if (msg_send(&mesg, transceiver_pid, 1)) { - puts("\tsuccess"); - } -} - -void set_delay(char *delay) { - uint32_t d; - - if (sscanf(delay, "delay %lu", &d) == 1) { - sending_delay = d; - } - else { - puts("Usage:\tdelay <µs>"); - } -} - -#ifdef DBG_IGNORE -void ignore(char *addr) { - uint16_t a; - mesg.type = DBG_IGN; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &a; - if (sscanf(addr, "ign %hu", &a) == 1) { - printf("msg_q: %hu/%hu/%lu Transceiver PID: %i (%p), rx_buffer_next: %u\n", - msg_q[63].sender_pid, msg_q[63].type, msg_q[63].content.value, transceiver_pid, &transceiver_pid, rx_buffer_next); - printf("sending to transceiver (%u): %u\n", transceiver_pid, (*(uint8_t*)tcmd.data)); - msg_send(&mesg, transceiver_pid, 1); - } - else { - puts("Usage:\tign <addr>"); - } -} -#endif - -void radio(void) { - msg_t m; - radio_packet_t *p; - uint8_t i; - - msg_init_queue(msg_q, RCV_BUFFER_SIZE); - - while (1) { - msg_receive(&m); - if (m.type == PKT_PENDING) { - p = (radio_packet_t*) m.content.ptr; - printf("Packet waiting, process %p...\n", p); - printf("\tLength:\t%u\n", p->length); - printf("\tSrc:\t%u\n", p->src); - printf("\tDst:\t%u\n", p->dst); - printf("\tLQI:\t%u\n", p->lqi); - printf("\tRSSI:\t%u\n", p->rssi); - - for (i = 0; i < p->length; i++) { - printf("%02X ", p->data[i]); - } - p->processing--; - printf("\n"); - } - else if (m.type == ENOBUFFER) { - puts("Transceiver buffer full"); - } - else { - puts("Unknown packet received"); - } - } -} - -int main(void) { - int radio_pid; - uint8_t i; - for (i = 0; i < SND_BUFFER_SIZE; i++) { - memset(snd_buffer[i], i, CC1100_MAX_DATA_LENGTH); - } - thread_create(shell_stack_buffer, SHELL_STACK_SIZE, PRIORITY_MAIN-1, CREATE_STACKTEST, shell_runner, "shell"); - radio_pid = thread_create(radio_stack_buffer, RADIO_STACK_SIZE, PRIORITY_MAIN-2, CREATE_STACKTEST, radio, "radio"); - transceiver_init(TRANSCEIVER_CC1100); - transceiver_start(); - transceiver_register(TRANSCEIVER_CC1100, radio_pid); - - while (1) { -// LED_GREEN_TOGGLE; - hwtimer_wait(1000 * 1000); - } -} diff --git a/projects/test_cc110x_ng/tests/hello-world b/projects/test_cc110x_ng/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/test_cc110x_ng/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/test_float/Jamfile b/projects/test_float/Jamfile deleted file mode 100644 index d55247f1e528cbbd75d3f65fdd1c2ee3162edfde..0000000000000000000000000000000000000000 --- a/projects/test_float/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_float ; - -Module test_float : main.c ; - -UseModule test_float ; diff --git a/projects/test_float/main.c b/projects/test_float/main.c deleted file mode 100644 index c183c13d5b747d7ee95946f67a95eb566d2df554..0000000000000000000000000000000000000000 --- a/projects/test_float/main.c +++ /dev/null @@ -1,17 +0,0 @@ -#include <stdio.h> -#include <board.h> -#include <math.h> - -int main(void) -{ - double x = 1234567./1024., z; - while (1) { - x += 0.1; - z = x - floor(x); - if (z >= 1) { - putchar('+'); - } else { - putchar('-'); - } - } -} diff --git a/projects/test_getpid/Jamfile b/projects/test_getpid/Jamfile deleted file mode 100644 index 1ae54b3928361e9a4a31eead055a634b99d2e440..0000000000000000000000000000000000000000 --- a/projects/test_getpid/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_getpid ; - -Module test_getpid : main.c ; - -UseModule test_getpid ; diff --git a/projects/test_getpid/main.c b/projects/test_getpid/main.c deleted file mode 100644 index 3a118383294b4e344e3bd72eee04ad9c06e6bb23..0000000000000000000000000000000000000000 --- a/projects/test_getpid/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <stdio.h> -#include <thread.h> - -int main(void) -{ - int pid = thread_getpid(); - printf("PID: %i\n", pid); -} diff --git a/projects/test_hwtimer/Jamfile b/projects/test_hwtimer/Jamfile deleted file mode 100644 index e9f9af9ec8e536b9a43c4ba7879e9286afca5185..0000000000000000000000000000000000000000 --- a/projects/test_hwtimer/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_hwtimer ; - -Module test_hwtimer : main.c : hwtimer ; - -UseModule test_hwtimer ; diff --git a/projects/test_hwtimer/main.c b/projects/test_hwtimer/main.c deleted file mode 100644 index 8e215d1056c90f5d74160b69d01936c763d1a9c6..0000000000000000000000000000000000000000 --- a/projects/test_hwtimer/main.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <stdio.h> -#include <hwtimer.h> -#include <kernel.h> -#include <board.h> - -void callback(void* ptr) { - puts((char*)ptr); -} - -extern uint32_t hwtimer_now(); - -int main(void) -{ - puts("hwtimer test project."); - - puts("Initializing hwtimer..."); - hwtimer_init(); - - puts("Initializing hwtimer [OK]."); - - -// while (TA0R < 20000); - - hwtimer_set(20000LU, callback, (void*)"callback1"); - hwtimer_set(50000LU, callback, (void*)"callback2"); - hwtimer_set(30000LU, callback, (void*)"callback3"); - - puts("hwtimer set."); -} diff --git a/projects/test_hwtimer/tests/test_ktimer b/projects/test_hwtimer/tests/test_ktimer deleted file mode 100755 index d391d2019bf9646b02f4641df5352db0503091a7..0000000000000000000000000000000000000000 --- a/projects/test_hwtimer/tests/test_ktimer +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) -exec jam reset - -expect { - "OK" {} - timeout { exit 1 } -} - -expect { - "callback1" {} - timeout { exit 1 } -} - -expect { - "callback3" {} - timeout { exit 1 } -} - -expect { - "callback2" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/test_hwtimer_basic/Jamfile b/projects/test_hwtimer_basic/Jamfile deleted file mode 100644 index e9f9af9ec8e536b9a43c4ba7879e9286afca5185..0000000000000000000000000000000000000000 --- a/projects/test_hwtimer_basic/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_hwtimer ; - -Module test_hwtimer : main.c : hwtimer ; - -UseModule test_hwtimer ; diff --git a/projects/test_hwtimer_basic/main.c b/projects/test_hwtimer_basic/main.c deleted file mode 100644 index 8e215d1056c90f5d74160b69d01936c763d1a9c6..0000000000000000000000000000000000000000 --- a/projects/test_hwtimer_basic/main.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <stdio.h> -#include <hwtimer.h> -#include <kernel.h> -#include <board.h> - -void callback(void* ptr) { - puts((char*)ptr); -} - -extern uint32_t hwtimer_now(); - -int main(void) -{ - puts("hwtimer test project."); - - puts("Initializing hwtimer..."); - hwtimer_init(); - - puts("Initializing hwtimer [OK]."); - - -// while (TA0R < 20000); - - hwtimer_set(20000LU, callback, (void*)"callback1"); - hwtimer_set(50000LU, callback, (void*)"callback2"); - hwtimer_set(30000LU, callback, (void*)"callback3"); - - puts("hwtimer set."); -} diff --git a/projects/test_hwtimer_basic/tests/test_hwtimer.py b/projects/test_hwtimer_basic/tests/test_hwtimer.py deleted file mode 100755 index 34b9ce0634ca9265383b3f0c5f3fa2f2ecf2493d..0000000000000000000000000000000000000000 --- a/projects/test_hwtimer_basic/tests/test_hwtimer.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python - -import pexpect -import os -import subprocess - -child = pexpect.spawn ("board/msba2/tools/bin/pseudoterm %s" % os.environ["PORT"]) - -null = open('/dev/null', 'wb') -subprocess.call(['jam', 'reset'], stdout=null) - -child.expect ('[OK].\r\n'); -child.expect ('callback1\r\n'); -child.expect ('callback3\r\n'); -child.expect ('callback2\r\n'); -print("Test successful!") - diff --git a/projects/test_ltc4150/Jamfile b/projects/test_ltc4150/Jamfile deleted file mode 100644 index aec5fc617df9d1a231f239db4b5079862326bab1..0000000000000000000000000000000000000000 --- a/projects/test_ltc4150/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_ltc4150 ; - -Module test_ltc4150 : main.c : ltc4150 swtimer auto_init ; - -UseModule test_ltc4150 ; diff --git a/projects/test_ltc4150/main.c b/projects/test_ltc4150/main.c deleted file mode 100644 index 9d04f73fcb311d6597d1f05e03e0f8d184741a30..0000000000000000000000000000000000000000 --- a/projects/test_ltc4150/main.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <stdio.h> -#include <ltc4150.h> -#include <swtimer.h> - -void busy_wait(unsigned int n) { - for (volatile unsigned int i = 0; i < n; i++) {} -} - -int main(void) -{ - ltc4150_start(); - while(1) { - printf("Power usage: %.4f mA (%.4f mA avg)\n", ltc4150_get_current_mA(), ltc4150_get_avg_mA()); - swtimer_usleep(100000); - } - - return 0; -} diff --git a/projects/test_periodic_sleep/Jamfile b/projects/test_periodic_sleep/Jamfile deleted file mode 100644 index b9b41cb80e7930c80a4b9eaf93dc545b38784046..0000000000000000000000000000000000000000 --- a/projects/test_periodic_sleep/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_periodic_sleep ; - -Module test_periodic_sleep : main.c : swtimer ; - -UseModule test_periodic_sleep ; diff --git a/projects/test_periodic_sleep/main.c b/projects/test_periodic_sleep/main.c deleted file mode 100644 index 11733221d0f046ba4386e118a8371f8f77f7e558..0000000000000000000000000000000000000000 --- a/projects/test_periodic_sleep/main.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <stdio.h> -#include <hwtimer.h> -#include <swtimer.h> - -#define PERIOD (1000000L) - -int main(void) -{ - hwtimer_init(); - swtimer_init(); - puts("Software timer periodic wakeup test.\n"); - - int64_t diff = 0; - int64_t before = 0; - int64_t new_period = 0; - - while(1) { - before = swtimer_now(); - new_period = PERIOD - diff ; - printf("%lli\n", new_period); - swtimer_usleep(new_period); - printf("%llu \t %lli\n", swtimer_now(), diff); - diff = (swtimer_now() - before) - PERIOD + diff + 2; - } -} - diff --git a/projects/test_periodic_sleep/tests/hello-world b/projects/test_periodic_sleep/tests/hello-world deleted file mode 100755 index 6f4a6ca8114811b10ab0ba8bd7193769aab5f889..0000000000000000000000000000000000000000 --- a/projects/test_periodic_sleep/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/test_rpl/Jamfile b/projects/test_rpl/Jamfile deleted file mode 100644 index e7412482f4f6797bf6823f823383547ecbfd2115..0000000000000000000000000000000000000000 --- a/projects/test_rpl/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_rpl ; - -Module test_rpl : main.c : shell shell_commands ps posix_io uart0 auto_init vtimer 6lowpan uart0 posix_io cc110x rpl ; - -UseModule test_rpl ; diff --git a/projects/test_rpl/main.c b/projects/test_rpl/main.c deleted file mode 100644 index ea2b321526893042bd9ff89aa0a2fe10265c6e90..0000000000000000000000000000000000000000 --- a/projects/test_rpl/main.c +++ /dev/null @@ -1,224 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <vtimer.h> -#include <thread.h> - -#include <posix_io.h> -#include <shell.h> -#include <shell_commands.h> -#include <board_uart0.h> - -#include "sys/net/sixlowpan/sixlowip.h" -#include "sys/net/sixlowpan/sixlowpan.h" -#include "sys/net/sixlowpan/sixlowerror.h" -#include "sys/net/sixlowpan/rpl/rpl.h" -#include "sys/net/sixlowpan/rpl/rpl_dodag.h" - -#define TR_WD_STACKSIZE (256) - -char tr_wd_stack[TR_WD_STACKSIZE]; - -void wakeup_thread(void) { - while (1) { - if (thread_getstatus(transceiver_pid) == STATUS_SLEEPING) { - vtimer_usleep(500 * 1000); - if (thread_getstatus(transceiver_pid) == STATUS_SLEEPING) { - //puts("WAKEUP!"); - thread_wakeup(transceiver_pid); - } - } - vtimer_usleep(1000 * 1000); - - } -} - -void init(char *str){ - transceiver_command_t tcmd; - msg_t m; - uint8_t chan = 10; - - char command; - uint16_t r_addr; - - int res = sscanf(str, "init %c %hu", &command, &r_addr); - - if(res < 1){ - printf("Usage: init address\n"); - printf("\tr\tinitialize as root\n"); - printf("\tn\tinitialize as node router\n"); - printf("\taddress must be an 8 bit integer\n"); - } - - uint8_t state; - switch (command) { - case 'r': - printf("INFO: Initialize as root on address %d\n", r_addr); - if (r_addr > 255) { - printf("ERROR: address not an 8 bit integer\n"); - return; - } - state = rpl_init(TRANSCEIVER_CC1100, r_addr); - if(state != SUCCESS){ - printf("Error initializing RPL\n"); - } - rpl_init_root(); - break; - case 'n': - printf("INFO: Initialize as node on address %d\n", r_addr); - if (r_addr > 255) { - printf("ERROR: address not an 8 bit integer\n"); - return; - } - state = rpl_init(TRANSCEIVER_CC1100, r_addr); - if(state != SUCCESS){ - printf("Error initializing RPL\n"); - } - break; - default: - printf("ERROR: Unknown command '%c'\n", command); - return; - } - - /* set channel to 10 */ - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &chan; - m.type = SET_CHANNEL; - m.content.ptr = (void*) &tcmd; - - msg_send_receive(&m, &m, transceiver_pid); - - /* start transceiver watchdog */ - thread_create(tr_wd_stack, TR_WD_STACKSIZE, PRIORITY_MAIN-3, CREATE_STACKTEST, wakeup_thread, "TX/RX WD"); - - } -void loop(char *str){ - rpl_routing_entry_t * rtable; - while(1){ - rtable = rpl_get_routing_table(); - rpl_dodag_t * mydodag = rpl_get_my_dodag(); - if(mydodag == NULL){ - vtimer_usleep(20 * 1000 * 1000); - continue; - } - printf("---------------------------\n"); - printf("OUTPUT\n"); - printf("my rank: %d\n", mydodag->my_rank); - printf("my preferred parent:\n"); - ipv6_print_addr(&mydodag->my_preferred_parent->addr); - printf("parent lifetime: %d\n",mydodag->my_preferred_parent->lifetime); - printf("---------------------------$\n"); - for(int i=0;i<RPL_MAX_ROUTING_ENTRIES;i++){ - if(rtable[i].used){ - ipv6_print_addr(&rtable[i].address); - puts("next hop"); - ipv6_print_addr(&rtable[i].next_hop); - printf("entry %d lifetime %d\n",i,rtable[i].lifetime); - if(!rpl_equal_id(&rtable[i].address, &rtable[i].next_hop)){ - puts("multi-hop"); - } - printf("---------------------------$\n"); - } - } - printf("########################\n"); - vtimer_usleep(20 * 1000 * 1000); - } - - -} - -void table(char *str){ - rpl_routing_entry_t * rtable; - rtable = rpl_get_routing_table(); - printf("---------------------------\n"); - printf("OUTPUT\n"); - printf("---------------------------\n"); - for(int i=0;i<RPL_MAX_ROUTING_ENTRIES;i++){ - if(rtable[i].used){ - ipv6_print_addr(&rtable[i].address); - printf("entry %d lifetime %d\n",i,rtable[i].lifetime); - if(!rpl_equal_id(&rtable[i].address, &rtable[i].next_hop)){ - puts("multi-hop"); - } - printf("--------------\n"); - } - } - printf("$\n"); -} - -void dodag(char *str){ - printf("---------------------------\n"); - rpl_dodag_t * mydodag = rpl_get_my_dodag(); - if(mydodag == NULL){ - printf("Not part of a dodag\n"); - printf("---------------------------$\n"); - return; - } - printf("Part of Dodag:\n"); - ipv6_print_addr(&mydodag->dodag_id); - printf("my rank: %d\n", mydodag->my_rank); - printf("my preferred parent:\n"); - ipv6_print_addr(&mydodag->my_preferred_parent->addr); - printf("---------------------------$\n"); -} - -extern void cc1100_print_config(void); -extern void cc1100_print_statistic(void); - -void cc1100_cfg(char* unused) { - cc1100_print_config(); - puts("============================================="); - cc1100_print_statistic(); -} - - -void wakeup(char* unused) { - thread_wakeup(10); -} - -const shell_command_t shell_commands[] = { - {"init", "", init}, - {"table", "", table}, - {"dodag", "", dodag}, - {"cc1100", "", cc1100_cfg}, - {"wakeup", "", wakeup}, - {"loop", "", loop}, - {NULL, NULL, NULL} -}; - -int main(void) { - printf("RPL Test Application\n"); - - - posix_open(uart0_handler_pid, 0); - - shell_t shell; - shell_init(&shell, shell_commands, uart0_readc, uart0_putc); - - shell_run(&shell); - - return 0; -} - - - -int old_main(void) -{ - timex_t mytime = timex_set(10,0); - while(1){ - - rpl_routing_entry_t * rtable; - rtable = rpl_get_routing_table(); - printf("---------------------------\n"); - printf("OUTPUT\n"); - printf("---------------------------\n"); - for(int i=0;i<RPL_MAX_ROUTING_ENTRIES;i++){ - if(rtable[i].used){ - ipv6_print_addr(&rtable[i].address); - printf("--------------\n"); - } - } - - vtimer_sleep(mytime); - }; -} - diff --git a/projects/test_rpl/tests/hello-world b/projects/test_rpl/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/test_rpl/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/test_shell/Jamfile b/projects/test_shell/Jamfile deleted file mode 100644 index 59a9713e85e295edd7d035745c87bd789631e291..0000000000000000000000000000000000000000 --- a/projects/test_shell/Jamfile +++ /dev/null @@ -1,11 +0,0 @@ -# -# FireKernel example project Jamfile -# -# Copyright (C) 2008, 2009 Kaspar Schleiser <kaspar@schleiser.de> -# - -SubDir TOP projects test_shell ; - -Module test_shell : test_shell.c : shell posix_io ps uart0 shell_commands ; - -UseModule test_shell ; diff --git a/projects/test_shell/test_shell.c b/projects/test_shell/test_shell.c deleted file mode 100644 index d754f66df28bf81c4c14fc44c22d006e66ca5733..0000000000000000000000000000000000000000 --- a/projects/test_shell/test_shell.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de> - */ - -#include <stdio.h> -#include <string.h> -#include <malloc.h> - -#include <posix_io.h> -#include <shell.h> -#include <board_uart0.h> - - -void print_teststart(char* str) { - printf("[TEST_START]\n"); -} - -void print_testend(char* str) { - printf("[TEST_END]\n"); -} - -int shell_readc() { - char c = 0; - posix_read(uart0_handler_pid, &c, 1); - return c; -} - -void shell_putchar(int c) { - putchar(c); -} - -const shell_command_t shell_commands[] = { - {"start_test", "", print_teststart}, - {"end_test", "", print_testend}, - {NULL, NULL, NULL} -}; - -int main(void) { - //printf("Moin. build on %s %s SVN-Revision: %s\n", kernel_builddate, kernel_buildtime, kernel_svnrevision); - printf("test_shell.\n"); - - board_uart0_init(); - - posix_open(uart0_handler_pid, 0); - - shell_t shell; - shell_init(&shell, shell_commands, shell_readc, shell_putchar); - - shell_run(&shell); - - return 0; -} - - diff --git a/projects/test_shell/tests/01-basic b/projects/test_shell/tests/01-basic deleted file mode 100755 index fd3bf5d993d2ad1659efe4ca574981a04d02542c..0000000000000000000000000000000000000000 --- a/projects/test_shell/tests/01-basic +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "start_test\n" -expect { - "\[TEST_START\]" {} - timeout { exit 1 } -} - -expect { - ">" {} - timeout { exit 1 } -} - -send "end_test\n" -expect { - "\[TEST_END\]" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" diff --git a/projects/test_shell/tests/02-inputlength-regression b/projects/test_shell/tests/02-inputlength-regression deleted file mode 100755 index a93e3526acea59d30af39af58d2e50c6f554ea3c..0000000000000000000000000000000000000000 --- a/projects/test_shell/tests/02-inputlength-regression +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect - -set timeout 1 - -spawn pseudoterm $env(PORT) - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - - -send "start_test\n" -expect { - "\[TEST_START\]" {} - timeout { exit 1 } -} - -expect { - ">" {} - timeout { exit 1 } -} - -send "end_test\n" - -expect { - "\[TEST_END\]" {} - timeout { exit 1 } -} - -sleep 1 -puts "\nTest successful!\n" diff --git a/projects/test_shell/tests/02-unknown-command b/projects/test_shell/tests/02-unknown-command deleted file mode 100755 index d47c20cf55459fa698f8a8f31583b35b1e9aaf15..0000000000000000000000000000000000000000 --- a/projects/test_shell/tests/02-unknown-command +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/expect - -set timeout 2 - -spawn pseudoterm $env(PORT) - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "some_definately_unknown_command\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" diff --git a/projects/test_sleep/Jamfile b/projects/test_sleep/Jamfile deleted file mode 100644 index 83289e1e2e42feb6c5e38a182d83005b4913ead2..0000000000000000000000000000000000000000 --- a/projects/test_sleep/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_sleep ; - -Module test_sleep : main.c : hwtimer ps ; - -UseModule test_sleep ; diff --git a/projects/test_sleep/main.c b/projects/test_sleep/main.c deleted file mode 100644 index 59e9e0013d1ec258d8b8037f42d776a72ec6ca2b..0000000000000000000000000000000000000000 --- a/projects/test_sleep/main.c +++ /dev/null @@ -1,46 +0,0 @@ -#include <stdio.h> -#include <thread.h> -#include <kernel.h> -#include <hwtimer.h> -#include <ps.h> - -int integer = 0; -int i = 0; - -void second_thread(void) { - printf("Woke up!\n"); - while(1) { - integer++; - printf("sleeper: running. integer=%i, i=%i.\n", integer, i); - if (integer % 1 == 0) { - printf("Going to sleep.\n"); - thread_sleep(); - } - } -} - -char second_thread_stack[KERNEL_CONF_STACKSIZE_DEFAULT*2]; - -int main(void) -{ - hwtimer_init(); - - int pid = thread_create(second_thread_stack, sizeof(second_thread_stack), PRIORITY_MAIN-1, CREATE_STACKTEST | CREATE_SLEEPING | CREATE_WOUT_YIELD, second_thread, "sleeper"); - - if (pid < 0) { - puts("Error creating second_thread! Stopping test."); - while(1); - } - - while(1) { - i++; - printf(" main: running. integer=%i, i=%i.\n", integer, i); - if (i % 1 == 0) { - thread_print_all(); - printf("Waking up sleeper.\n"); - thread_wakeup(pid); - thread_print_all(); - thread_yield(); - } - } -} diff --git a/projects/test_suite/Jamfile b/projects/test_suite/Jamfile deleted file mode 100644 index dfb96deb7dd10261cb82f00a2026b3c954474022..0000000000000000000000000000000000000000 --- a/projects/test_suite/Jamfile +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (C) 2008, 2009, 2010 FU Berlin -# -# Author: Kaspar Schleiser <kaspar.schleiser@fu-berlin.de> -# - -SubDir TOP projects test_suite ; - -Module test_suite : test_suite.c mutex_trylock_fail.c thread_sleep.c - : shell posix_io ps uart0 hwtimer ; - -UseModule test_suite ; diff --git a/projects/test_suite/mutex_trylock_fail.c b/projects/test_suite/mutex_trylock_fail.c deleted file mode 100644 index 079d0d960c59401d1a0d55747c1b6aa2e531d1ba..0000000000000000000000000000000000000000 --- a/projects/test_suite/mutex_trylock_fail.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <stdio.h> -#include <mutex.h> - -#include <thread.h> -#include <flags.h> -#include <kernel.h> - -mutex_t mutex; - -static void second_thread(void) { - puts(" 2nd: trying to lock mutex..."); - mutex_trylock(&mutex); - puts(" 2nd: done."); -} - -static char second_stack[KERNEL_CONF_STACKSIZE_MAIN]; - -void mutex_trylock_fail(char* cmdline) -{ - puts("main: locking mutex..."); - mutex_lock(&mutex); - - puts("main: creating thread..."); - thread_create(second_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN-1, CREATE_STACKTEST, second_thread, "nr2"); - - puts("main: thread created. Unlocking mutex..."); - mutex_unlock(&mutex, true); - - puts("main: mutex unlocked."); -} diff --git a/projects/test_suite/test_suite.c b/projects/test_suite/test_suite.c deleted file mode 100644 index 40a019fc02dbb3a8d51db84b37f4d5337a61b90b..0000000000000000000000000000000000000000 --- a/projects/test_suite/test_suite.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de> - */ - -#include <stdio.h> -#include <string.h> -#include <malloc.h> - -#include <posix_io.h> -#include <shell.h> -#include <board_uart0.h> - -void print_teststart(char* str) { - printf("[TEST_START]\n"); -} - -void print_testend(char* str) { - printf("[TEST_END]\n"); -} - -int shell_readc() { - char c = 0; - posix_read(uart0_handler_pid, &c, 1); - return c; -} - -void shell_putchar(int c) { - putchar(c); -} - -void mutex_trylock_fail(char* cmdline); -void test_thread_sleep(char* line); - -const shell_command_t shell_commands[] = { - {"start_test", "", print_teststart}, - {"end_test", "", print_testend}, - {"mutex_trylock_fail", "", mutex_trylock_fail}, - {"thread_sleep", "", test_thread_sleep}, - {NULL, NULL, NULL} -}; - -int main(void) { - //printf("Moin. build on %s %s SVN-Revision: %s\n", kernel_builddate, kernel_buildtime, kernel_svnrevision); - printf("test_shell.\n"); - - board_uart0_init(); - - posix_open(uart0_handler_pid, 0); - - shell_t shell; - shell_init(&shell, shell_commands, shell_readc, shell_putchar); - - shell_run(&shell); - - return 0; -} - - diff --git a/projects/test_suite/tests/01-basic b/projects/test_suite/tests/01-basic deleted file mode 100755 index 5f6068fc7857b20d97fed85477f7ebe5945ae734..0000000000000000000000000000000000000000 --- a/projects/test_suite/tests/01-basic +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "start_test\n" -expect { - "\[TEST_START\]" {} - timeout { exit 1 } -} - -expect { - ">" {} - timeout { exit 1 } -} - -send "end_test\n" - -expect { - "\[TEST_END\]" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" diff --git a/projects/test_suite/tests/02-inputlength-regression b/projects/test_suite/tests/02-inputlength-regression deleted file mode 100755 index 2f4a32d3d1d35a7305c89c023537eab49513ae1e..0000000000000000000000000000000000000000 --- a/projects/test_suite/tests/02-inputlength-regression +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/expect - -set timeout 1 - -spawn pseudoterm $env(PORT) - - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - -send "123456789012345678901234567890123456789012345678901234567890\n" -expect { - "shell: command not found." {} - timeout { exit 1 } -} - - -send "start_test\n" -expect { - "\[TEST_START\]" {} - timeout { exit 1 } -} - -expect { - ">" {} - timeout { exit 1 } -} - -send "end_test\n" - -expect { - "\[TEST_END\]" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" diff --git a/projects/test_suite/tests/02-unknown-command b/projects/test_suite/tests/02-unknown-command deleted file mode 100755 index 44c86dd30937867be84e41783cece32b227c1ed2..0000000000000000000000000000000000000000 --- a/projects/test_suite/tests/02-unknown-command +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/expect - -set timeout 2 - -spawn pseudoterm $env(PORT) - -sleep 1 -send "\n" -send "\n" - -expect { - ">" {} - timeout { exit 1 } -} - -send "some_definately_unknown_command\n" -expect { - "shell: command "some_definately_unknown_command" not found." {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" diff --git a/projects/test_suite/tests/03-mutex_trylock_fail b/projects/test_suite/tests/03-mutex_trylock_fail deleted file mode 100755 index f04cb8b270a0118f61cedbc246e7f5e59cc15fa7..0000000000000000000000000000000000000000 --- a/projects/test_suite/tests/03-mutex_trylock_fail +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "start_test\n" -expect { - "\[TEST_START\]" {} - timeout { exit 1 } -} - -expect { - ">" {} - timeout { exit 1 } -} - -send "mutex_trylock_fail\n" -expect { - "main: locking mutex..." {} - timeout { exit 1 } -} -expect { - "main: creating thread..." {} - timeout { exit 1 } -} -expect { - "2nd: trying to lock mutex..." {} - timeout { exit 1 } -} -expect { - "2nd: done." {} - timeout { exit 1 } -} -expect { - "main: thread created. Unlocking mutex..." {} - timeout { exit 1 } -} -expect { - "main: mutex unlocked." {} - timeout { exit 1 } -} - -send "end_test\n" - -expect { - "\[TEST_END\]" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" diff --git a/projects/test_suite/tests/04-thread_sleep b/projects/test_suite/tests/04-thread_sleep deleted file mode 100755 index 1c5544169b7ca5eb20a809aa7893dd01758923b6..0000000000000000000000000000000000000000 --- a/projects/test_suite/tests/04-thread_sleep +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -sleep 1 -send "\n" -send "\n" -expect { - ">" {} - timeout { exit 1 } -} - -send "start_test\n" -expect { - "\[TEST_START\]" {} - timeout { exit 1 } -} - -expect { - ">" {} - timeout { exit 1 } -} - -send "thread_sleep\n" -expect { -" main: running. integer=0, i=1." {} -" main: running. integer=0, i=2." {} -"Waking up sleeper." {} -"sleeper: running. integer=1, i=2." {} -"sleeper: running. integer=2, i=2." {} -"Going to sleep." {} -" main: running. integer=2, i=3." {} -" main: running. integer=2, i=4." {} -"Waking up sleeper." {} -"Woke up!" {} -"sleeper: running. integer=3, i=4." {} -"sleeper: running. integer=4, i=4." {} -"Going to sleep." {} -" main: running. integer=4, i=5." {} -" main: running. integer=4, i=6." {} -"Waking up sleeper." {} -"Woke up!" {} -"sleeper: running. integer=5, i=6." {} -"sleeper: running. integer=6, i=6." {} -"Going to sleep." {} -" main: running. integer=6, i=7." {} -" main: running. integer=6, i=8." {} -"Waking up sleeper." {} -"Woke up!" {} -"sleeper: running. integer=7, i=8." {} -"sleeper: running. integer=8, i=8." {} -"Going to sleep." {} -" main: running. integer=8, i=9." {} -" main: running. integer=8, i=10." {} -"Waking up sleeper." {} -"Woke up!" {} -"sleeper: running. integer=9, i=10." {} -"sleeper: running. integer=10, i=10." {} -"Going to sleep." {} - ">$" {} - timeout { exit 1 } -} - -send "end_test\n" - -expect { - "\[TEST_END\]" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" diff --git a/projects/test_suite/thread_sleep.c b/projects/test_suite/thread_sleep.c deleted file mode 100644 index c88c01550358e1d8b7896a82ecdea2643f1aef01..0000000000000000000000000000000000000000 --- a/projects/test_suite/thread_sleep.c +++ /dev/null @@ -1,39 +0,0 @@ -#include <stdio.h> -#include <thread.h> -#include <kernel.h> - -static int integer = 0; -static int i = 0; - -static void second_thread(void) { - while(1) { - integer++; - printf("sleeper: running. integer=%i, i=%i.\n", integer, i); - if (integer % 2 == 0) { - printf("Going to sleep.\n"); - thread_sleep(); - printf("Woke up!\n"); - } - } -} - -static char second_thread_stack[KERNEL_CONF_STACKSIZE_DEFAULT*2]; - -void test_thread_sleep(char* line) -{ - int pid = thread_create(second_thread_stack, sizeof(second_thread_stack), PRIORITY_MAIN-1, CREATE_STACKTEST | CREATE_SLEEPING | CREATE_WOUT_YIELD, second_thread, "sleeper"); - - if (pid < 0) { - puts("Error creating second_thread! Stopping test."); - while(1); - } - - while(i < 10) { - i++; - printf(" main: running. integer=%i, i=%i.\n", integer, i); - if (i % 2 == 0) { - printf("Waking up sleeper.\n"); - thread_wakeup(pid); - } - } -} diff --git a/projects/test_swtimer/Jamfile b/projects/test_swtimer/Jamfile deleted file mode 100644 index 2a286f086171b75b0e2b7636c300334907d221da..0000000000000000000000000000000000000000 --- a/projects/test_swtimer/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_swtimer ; - -Module test_swtimer : main.c : swtimer ; - -UseModule test_swtimer ; diff --git a/projects/test_swtimer/main.c b/projects/test_swtimer/main.c deleted file mode 100644 index 5932662168f4bd2520948f4de45f6721047d3e06..0000000000000000000000000000000000000000 --- a/projects/test_swtimer/main.c +++ /dev/null @@ -1,63 +0,0 @@ -#include <stdio.h> -#include <stdint.h> -#include <thread.h> -#include <kernel.h> -#include <hwtimer.h> - -#include <swtimer.h> - -#include "primes.h" - -#define TIMERS 20 -swtimer_t timers[TIMERS]; -int timer_hits[TIMERS]; -swtime_t timer_durations[TIMERS]; -swtime_t timer_planned_durations[TIMERS]; - -extern swtime_t swtimer_next_alarm_absolute; - -void simple_callback(void* ptr) { - int timernum = (int) ptr; - swtimer_t *t = &timers[timernum]; - timer_durations[timernum] = swtimer_now() - t->start; - timer_hits[timernum] += 1; - swtimer_set(t, t->interval); -} - -#define TIMER_FACTOR 1000L - -int main(void) -{ - hwtimer_init(); - swtimer_init(); - - printf("swtimer stress test.\n"); - - int prime = 10; - for (int i = 0; i < TIMERS; i++) { - timer_hits[i] = 0; - timers[i].action_type = SWTIMER_CALLBACK; - timers[i].action.callback.f = simple_callback; - timers[i].action.callback.ptr = (void*)i; - - swtimer_set(&timers[i], TIMER_FACTOR*primes[(prime)-1]); - timer_planned_durations[i] = TIMER_FACTOR*primes[(prime)-1]; - prime+=5; - if (prime >= 999) prime = 0; - } - - swtime_t last = 0; - unsigned int total_hits = 0; - while(1) { - swtimer_usleep(1000000L); - printf("Duration: %lu\n", swtimer_now() - last); - last = swtimer_now(); - - for (int t = 0; t < TIMERS; t++) { - total_hits += timer_hits[t]; - printf("timernum: %i \thits=%i \tduration: %8lu \tdiff=%lu\n", t, timer_hits[t], timer_durations[t], timer_durations[t] - timer_planned_durations[t]); - } - printf("-----\nTotal Hits: %u\n", total_hits); - puts(""); - } -} diff --git a/projects/test_swtimer/primes.h b/projects/test_swtimer/primes.h deleted file mode 100644 index 12641138eba2c96153d7c48d629e278ada6f90f7..0000000000000000000000000000000000000000 --- a/projects/test_swtimer/primes.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef __PRIMES_H -#define __PRIMES_H - -const int primes[999] = {3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, -59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, -139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, -229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, -317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, -421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, -521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, -619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, -733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, -839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, -953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, -1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, -1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, -1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, -1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, -1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, -1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, -1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, -1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, -1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, -1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, -2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, -2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, -2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, -2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, -2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, -2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, -2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, -2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, -2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, -2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, -3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, -3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, -3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, -3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, -3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, -3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, -3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, -3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, -3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, -4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, -4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, -4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, -4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, -4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, -4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, -4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, -4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, -4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, -5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, -5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, -5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, -5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, -5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, -5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, -5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, -5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, -5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, -6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, -6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, -6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, -6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, -6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, -6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, -6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, -6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, -6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, -7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, -7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, -7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, -7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, -7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, -7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, -7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, -7877, 7879, 7883, 7901, 7907, 7919}; - -#endif /* __PRIMES_H */ diff --git a/projects/test_swtimer_basic/Jamfile b/projects/test_swtimer_basic/Jamfile deleted file mode 100644 index 7a5e6acb086c5ce8ceda2db171f31c84b5bed87a..0000000000000000000000000000000000000000 --- a/projects/test_swtimer_basic/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects expect_swtimer ; - -Module expect_swtimer : main.c : swtimer ; - -UseModule expect_swtimer ; diff --git a/projects/test_swtimer_basic/main.c b/projects/test_swtimer_basic/main.c deleted file mode 100644 index 0130aa4d6547a901ec472dbd9c242f3a99161f89..0000000000000000000000000000000000000000 --- a/projects/test_swtimer_basic/main.c +++ /dev/null @@ -1,45 +0,0 @@ -#include <stdio.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <thread.h> -#include <kernel.h> -#include <msg.h> - -void callback(void* ptr){ - puts((char*)ptr); -} - -void wakeup_thread(void){ - puts("wakeup"); -} - -void msg_thread(void){ - msg_t m; - msg_receive(&m); - printf("%s\n",(char*)m.content.ptr); -} - -int main(void) -{ - hwtimer_init(); - swtimer_init(); - - int pid1 = thread_create(8192, PRIORITY_MAIN-1, - CREATE_WOUT_YIELD | CREATE_SLEEPING | CREATE_STACKTEST, wakeup_thread, "nr1"); - - int pid2 = thread_create(8192, PRIORITY_MAIN-1, - /*CREATE_WOUT_YIELD | CREATE_SLEEPING |*/ CREATE_STACKTEST, msg_thread, "nr2"); - - - swtimer_t cbt; - swtimer_t wut; - swtimer_t mst; - /* test callback */ - swtimer_set_cb(&cbt,1000L,callback,"callback"); - /* test wake-up */ - swtimer_set_wakeup(&wut, 1000L, pid1); - /* test message */ - swtimer_set_msg(&mst,1000L, pid2, "message"); - - while(1); -} diff --git a/projects/test_swtimer_basic/tests/test_swtimer.py b/projects/test_swtimer_basic/tests/test_swtimer.py deleted file mode 100755 index 465e5562adb6d972f23c0194cb5c8900bd559ca8..0000000000000000000000000000000000000000 --- a/projects/test_swtimer_basic/tests/test_swtimer.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/python - -import pexpect -import os -import subprocess - -child = pexpect.spawn ("pseudoterm %s" % os.environ["PORT"]) - -null = open('/dev/null', 'wb') -subprocess.call(['jam', 'reset'], stdout=null) - -child.expect ('callback\r\n'); -child.expect ('wakeup\r\n'); -child.expect ('message\r\n'); -print("Test successful!") diff --git a/projects/test_swtimer_remove/Jamfile b/projects/test_swtimer_remove/Jamfile deleted file mode 100644 index dc9af1031818fa56a354d1bbfe8dec1abd47c44d..0000000000000000000000000000000000000000 --- a/projects/test_swtimer_remove/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_swtimer_remove ; - -Module test_swtimer_remove : main.c : swtimer ; - -UseModule test_swtimer_remove ; diff --git a/projects/test_swtimer_remove/main.c b/projects/test_swtimer_remove/main.c deleted file mode 100644 index 414e57d61ddfe77790576ff10df316e699c16950..0000000000000000000000000000000000000000 --- a/projects/test_swtimer_remove/main.c +++ /dev/null @@ -1,50 +0,0 @@ -#include <stdio.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <sched.h> - -int main(void) -{ - hwtimer_init(); - swtimer_init(); - - puts("Hello world!\n"); - - swtimer_t t; - - puts("Setting timer...\n"); - swtimer_set_wakeup(&t, 10000000L, active_thread->pid); - puts("Small delay...\n"); - hwtimer_wait(200000); - puts("Removing timer...\n"); - swtimer_remove(&t); - puts("Done.\n"); - - swtimer_t t2; - puts("Setting timer...\n"); - swtimer_set_wakeup(&t, 10000000L, active_thread->pid); - puts("Setting timer 2...\n"); - swtimer_set_wakeup(&t2, 50000000L, active_thread->pid); - puts("Small delay...\n"); - hwtimer_wait(200000); - puts("Removing timer 1...\n"); - swtimer_remove(&t); - puts("Removing timer 2...\n"); - swtimer_remove(&t2); - puts("Done.\n"); - - puts("Setting timer...\n"); - swtimer_set_wakeup(&t, 10000000L, active_thread->pid); - puts("Setting timer 2...\n"); - swtimer_set_wakeup(&t2, 50000000L, active_thread->pid); - puts("Small delay...\n"); - hwtimer_wait(200000); - puts("Removing timer 2...\n"); - swtimer_remove(&t2); - puts("Removing timer 1...\n"); - swtimer_remove(&t); - puts("Done.\n"); - - - while(1); -} diff --git a/projects/test_swtimer_remove/tests/hello-world b/projects/test_swtimer_remove/tests/hello-world deleted file mode 100755 index 6f4a6ca8114811b10ab0ba8bd7193769aab5f889..0000000000000000000000000000000000000000 --- a/projects/test_swtimer_remove/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/test_thread_basic/Jamfile b/projects/test_thread_basic/Jamfile deleted file mode 100644 index 3d1aba9d76a06b4bb944b92b8468d76700abd5dd..0000000000000000000000000000000000000000 --- a/projects/test_thread_basic/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_thread_basic ; - -Module test_thread_basic : main.c ; - -UseModule test_thread_basic ; diff --git a/projects/test_thread_basic/main.c b/projects/test_thread_basic/main.c deleted file mode 100644 index 02d7bbfbfd35d4732bdefad43c63d078dea4c4d3..0000000000000000000000000000000000000000 --- a/projects/test_thread_basic/main.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <stdio.h> -#include <thread.h> -#include <flags.h> -#include <kernel.h> - -#define STACK_SIZE (8192) - -char t2_stack[STACK_SIZE]; - -void second_thread(void) { - puts("second thread\n"); -} - -int main(void) -{ - (void) thread_create(t2_stack, STACK_SIZE, PRIORITY_MAIN-1, CREATE_WOUT_YIELD | CREATE_STACKTEST, second_thread, "nr2"); - puts("first thread\n"); -} diff --git a/projects/test_thread_basic/tests/test_thread.py b/projects/test_thread_basic/tests/test_thread.py deleted file mode 100755 index 40df9e651e79dbffcb5231d550ace278f65c4821..0000000000000000000000000000000000000000 --- a/projects/test_thread_basic/tests/test_thread.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/python - -import pexpect -import os -import subprocess - -child = pexpect.spawn("board/msba2/tools/bin/pseudoterm %s" % os.environ["PORT"]) - -null = open('/dev/null', 'wb') -subprocess.call(['jam', 'reset'], stdout=null) - -child.expect ('first thread\r\n') -child.expect ('second thread\r\n') -print("Test successful!") - diff --git a/projects/test_thread_exit/Jamfile b/projects/test_thread_exit/Jamfile deleted file mode 100644 index 3f9c7e01dad6d34b31cbdc4e31b9fdb942715383..0000000000000000000000000000000000000000 --- a/projects/test_thread_exit/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects test_thread_exit ; - -Module test_thread_exit : main.c ; - -UseModule test_thread_exit ; diff --git a/projects/test_thread_exit/main.c b/projects/test_thread_exit/main.c deleted file mode 100644 index aec8cf48bebee68f6bd96afc980edd0f578416a8..0000000000000000000000000000000000000000 --- a/projects/test_thread_exit/main.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <stdio.h> -#include <thread.h> -#include <flags.h> -#include <kernel.h> - -void second_thread(void) { - printf("second_thread starting.\n"); - - puts("2nd: running..."); -} - -char second_thread_stack[8192]; - -int main(void) -{ - (void) thread_create(second_thread_stack, sizeof(second_thread_stack), PRIORITY_MAIN-1, CREATE_WOUT_YIELD | CREATE_STACKTEST, second_thread, "nr2"); - puts("Main thread exiting..."); -} diff --git a/projects/test_thread_exit/tests/hello-world b/projects/test_thread_exit/tests/hello-world deleted file mode 100755 index 6f4a6ca8114811b10ab0ba8bd7193769aab5f889..0000000000000000000000000000000000000000 --- a/projects/test_thread_exit/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/tlayer/Jamfile b/projects/tlayer/Jamfile deleted file mode 100644 index 71d2a82e13ca0a9fbcfa801e66b3dad6b26634b1..0000000000000000000000000000000000000000 --- a/projects/tlayer/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects tlayer ; - -Module tlayer : main.c : auto_init vtimer ps shell_commands config cc110x_ng destiny uart0 posix_io shell 6lowpan rtc ltc4150 net_help ; - -UseModule tlayer ; diff --git a/projects/tlayer/main.c b/projects/tlayer/main.c deleted file mode 100644 index 610846c00d3ff18c3d7071807bdcae63e30ebed0..0000000000000000000000000000000000000000 --- a/projects/tlayer/main.c +++ /dev/null @@ -1,697 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <malloc.h> -#include <stdint.h> - -#include <posix_io.h> -#include <shell.h> -#include <board_uart0.h> -#include "hwtimer.h" -#include <vtimer.h> -#include <ltc4150.h> -#include <thread.h> -#include <cc110x_ng.h> -#include <transceiver.h> -#include <time.h> -#include <rtc.h> -#include "sys/net/sixlowpan/sixlowmac.h" -#include "sys/net/sixlowpan/sixlowip.h" -#include "sys/net/sixlowpan/sixlowborder.h" -#include "sys/net/sixlowpan/sixlowpan.h" -#include "sys/net/sixlowpan/sixlowerror.h" -#include "sys/net/sixlowpan/sixlownd.h" -#include "sys/net/destiny/udp.h" -#include "sys/net/destiny/tcp.h" -#include "sys/net/destiny/socket.h" -#include "sys/net/destiny/in.h" -#include "sys/net/destiny/destiny.h" -#include "sys/net/destiny/tcp_timer.h" -#include "sys/net/net_help/net_help.h" -#include "sys/net/net_help/msg_help.h" - -#define SEND_TCP_THREAD_SIZE 1024 -#define TCP_CLOSE_THREAD_STACK_SIZE 1024 -#define RECV_FROM_TCP_THREAD_STACK_SIZE1 512 -#define RECV_FROM_TCP_THREAD_STACK_SIZE2 512 -#define UDP_APP_STACK_SIZE 3072 -#define TCP_APP_STACK_SIZE 3072 - -uint8_t udp_server_thread_pid; -char udp_server_stack_buffer[UDP_APP_STACK_SIZE]; - -uint8_t tcp_server_thread_pid; -char tcp_server_stack_buffer[TCP_APP_STACK_SIZE]; - -uint8_t tcp_cht_pid; -char tcp_cht_stack_buffer[TCP_APP_STACK_SIZE]; - -// Socket ID used for sending/receiving packets via different threads -int tcp_socket_id = -1; - -uint8_t tcp_send_pid = -1; -char tcp_send_stack_buffer[SEND_TCP_THREAD_SIZE]; - -char tcp_close_thread_stack[TCP_CLOSE_THREAD_STACK_SIZE]; - -char recv_from_tcp_thread_stack1[RECV_FROM_TCP_THREAD_STACK_SIZE1]; -char recv_from_tcp_thread_stack2[RECV_FROM_TCP_THREAD_STACK_SIZE2]; - -#ifdef DBG_IGNORE -static msg_t mesg; -static transceiver_command_t tcmd; -#endif - -static uint8_t running_recv_threads = 0; -static uint8_t recv_socket_id1 = 0; -static uint8_t recv_socket_id2 = 0; - -typedef struct tcp_msg_t - { - int node_number; - char tcp_string_msg[80]; - }tcp_message_t; -tcp_message_t current_message; - -void recv_from_tcp_thread1 (void); -void recv_from_tcp_thread2 (void); - -void init_tl (char *str) - { - init_transport_layer(); - } - -void tcp_ch(void) - { - msg_t recv_msg; - int read_bytes = 0; - char buff_msg[MAX_TCP_BUFFER]; - sockaddr6_t stSockAddr; - msg_receive(&recv_msg); - int SocketFD = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP); - if (-1 == SocketFD) - { - printf("cannot create socket"); - return; - } - memset(&stSockAddr, 0, sizeof(stSockAddr)); - - stSockAddr.sin6_family = AF_INET6; - stSockAddr.sin6_port = HTONS(1100); - - ipv6_init_address(&stSockAddr.sin6_addr, 0xabcd, 0x0, 0x0, 0x0, 0x3612, 0x00ff, 0xfe00, current_message.node_number); - ipv6_print_addr(&stSockAddr.sin6_addr); - - if (-1 == connect(SocketFD, &stSockAddr, sizeof(stSockAddr))) - { - printf("Connect failed!\n"); - close(SocketFD); - return; - } - tcp_socket_id = SocketFD; - while (read_bytes != -1) - { - read_bytes = recv(SocketFD, buff_msg, MAX_TCP_BUFFER, 0); - if (read_bytes > 0) - { - printf("--- Message: %s ---\n", buff_msg); - } - - } - } - -void init_udp_server(void) - { - sockaddr6_t sa; - char buffer_main[256]; - ssize_t recsize; - uint32_t fromlen; - int sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP); - memset(&sa, 0, sizeof(sa)); - - sa.sin6_family = AF_INET; - sa.sin6_port = HTONS(7654); - - fromlen = sizeof(sa); - if (-1 == bind(sock, &sa, sizeof(sa))) - { - printf("Error bind failed!\n"); - close(sock); - } - for (;;) - { - recsize = recvfrom(sock, (void *)buffer_main, 256, 0, &sa, &fromlen); - if (recsize < 0) - { - printf("ERROR: recsize < 0!\n"); - } - printf("recsize: %i\n ", recsize); - printf("datagram: %s\n", buffer_main); - } - close(sock); - } - -void init_tcp_server(void) - { - sockaddr6_t stSockAddr; - int read_bytes; - char buff_msg[MAX_TCP_BUFFER]; - memset(buff_msg, 0, MAX_TCP_BUFFER); - int SocketFD = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP); - - if(-1 == SocketFD) - { - perror("can not create socket"); - exit(EXIT_FAILURE); - } - - memset(&stSockAddr, 0, sizeof(stSockAddr)); - - stSockAddr.sin6_family = AF_INET6; - stSockAddr.sin6_port = HTONS(1100); - - ipv6_init_address(&stSockAddr.sin6_addr, 0xabcd, 0x0, 0x0, 0x0, 0x3612, 0x00ff, 0xfe00, get_radio_address()); - ipv6_print_addr(&stSockAddr.sin6_addr); - - if(-1 == bind(SocketFD, &stSockAddr, sizeof(stSockAddr))) - { - printf("error bind failed\n"); - close(SocketFD); - return; - } - print_internal_socket(getSocket(SocketFD)); - if(-1 == listen(SocketFD, 10)) - { - printf("error listen failed\n"); - close(SocketFD); - return; - } - while (1) - { - read_bytes = 0; - printf("INFO: WAITING FOR INC CONNECTIONS!\n"); - int ConnectFD = accept(SocketFD, NULL, 0); - if(0 > ConnectFD) - { - printf("error accept failed\n"); - close(SocketFD); - return; - } - else - { - printf("Connection established on socket %u.\n", ConnectFD); - if (running_recv_threads == 0) - { - recv_socket_id1 = ConnectFD; - thread_create(recv_from_tcp_thread_stack1, RECV_FROM_TCP_THREAD_STACK_SIZE1, PRIORITY_MAIN, - CREATE_STACKTEST, recv_from_tcp_thread1, "recv_from_tcp_thread1"); - } - else if (running_recv_threads == 1) - { - recv_socket_id2 = ConnectFD; - thread_create(recv_from_tcp_thread_stack2, RECV_FROM_TCP_THREAD_STACK_SIZE2, PRIORITY_MAIN, - CREATE_STACKTEST, recv_from_tcp_thread2, "recv_from_tcp_thread2"); - } - running_recv_threads++; - } - } - } - -void init_udp_server_thread(char *str) - { - udp_server_thread_pid = thread_create(udp_server_stack_buffer, UDP_APP_STACK_SIZE, PRIORITY_MAIN, CREATE_STACKTEST, init_udp_server, "init_udp_server"); - printf("UDP SERVER THREAD PID: %i\n", udp_server_thread_pid); - } - -void init_tcp_server_thread(char *str) - { - tcp_server_thread_pid = thread_create(tcp_server_stack_buffer, TCP_APP_STACK_SIZE, PRIORITY_MAIN, CREATE_STACKTEST, init_tcp_server, "init_tcp_server"); - printf("TCP SERVER THREAD PID: %i\n", tcp_server_thread_pid); - } - -// Init TCP connection handler thread -void init_tcp_cht(char *str) - { - tcp_cht_pid = thread_create( tcp_cht_stack_buffer, - TCP_APP_STACK_SIZE, - PRIORITY_MAIN, - CREATE_STACKTEST, - tcp_ch, - "init_conn_handler"); - printf("TCP CONNECTION HANDLER THREAD PID: %i\n", tcp_cht_pid); - } - -void send_tcp_thread (void) - { - msg_t recv_msg, send_msg; - while (1) - { - msg_receive(&recv_msg); - if (tcp_socket_id == -1) - { - tcp_socket_id = recv_socket_id1; - } - if (send(tcp_socket_id, (void*) current_message.tcp_string_msg, strlen(current_message.tcp_string_msg)+1, 0) < 0) - { - printf("Could not send %s!\n", current_message.tcp_string_msg); - } -// printf("Finished sending!\n"); - msg_reply(&recv_msg, &send_msg); - } - } - -void send_tcp_msg(char *str) - { - msg_t send_msg, recv_msg; - sscanf(str, "send_tcp %s", current_message.tcp_string_msg); -// printf("Message: %s\n", current_message.tcp_string_msg); - if (strcmp(current_message.tcp_string_msg, "close") == 0) - { - send_msg.content.value = 0; - } - else - { - send_msg.content.value = 1; - } - msg_send_receive(&send_msg, &recv_msg, tcp_send_pid); - } - -void send_tcp_bulk(char *str) - { - int i = 0, count; - char command[61]; - char msg_string[50]; - sscanf(str, "send_tcp_bulk %i %s", &count, msg_string); - for (i = 0; i < count; i++) - { - sprintf(command, "send_tcp %s%.5i", msg_string, i); - send_tcp_msg(command); - } - } - -void send_tcp_bandwidth_test(char *str) - { - timex_t start, end, total; - double secs; - - int i = 0, count; - char command[80]; -// char msg_string[] = "abcdefghijklmnopqrstuvwxyz0123456789!-"; - char msg_string[] = "abcdefghijklmnopqrstuvwxyz0123456789!-=/%$"; - - sscanf(str, "tcp_bw %i", &count); - ltc4150_start(); - printf("Start power: %f\n", ltc4150_get_total_mAh()); - start = vtimer_now(); - for (i = 0; i < count; i++) - { - sprintf(command, "send_tcp %s%.5i", msg_string, i); - send_tcp_msg(command); - } - end = vtimer_now(); - total = timex_sub(end, start); - secs = total.microseconds / 1000000.0f; - printf("Used power: %f\n", ltc4150_get_total_Joule()); - printf("Start: %lu, End: %lu, Total: %lu\n", start.microseconds, end.microseconds, total.microseconds); - printf("Time: %f seconds, Bandwidth: %f byte/second\n", secs, (count*48)/secs); - } - -void connect_tcp(char *str) - { - msg_t send_msg; - sscanf(str, "connect_tcp %i", ¤t_message.node_number); - send_msg.content.value = 1; - msg_send(&send_msg, tcp_cht_pid, 0); - } - -void disconnect_tcp(char *str) - { - msg_t send_msg; - - send_msg.content.value = 0; - msg_send(&send_msg, tcp_cht_pid, 0); - } - -void recv_from_tcp_thread2 (void) - { - int read_bytes = 0; - char buff_msg[MAX_TCP_BUFFER]; - memset(buff_msg, 0, MAX_TCP_BUFFER); - - while (read_bytes != -1) - { - read_bytes = recv(recv_socket_id2, buff_msg, MAX_TCP_BUFFER, 0); - - if (read_bytes > 0) - { -// printf("--- Read bytes: %i, Strlen(): %i, Message: %s ---\n", read_bytes, strlen(buff_msg), buff_msg); - } - } - } - -void recv_from_tcp_thread1 (void) - { - int read_bytes = 0; - char buff_msg[MAX_TCP_BUFFER]; - memset(buff_msg, 0, MAX_TCP_BUFFER); - - while (read_bytes != -1) - { - read_bytes = recv(recv_socket_id1, buff_msg, MAX_TCP_BUFFER, 0); - - if (read_bytes > 0) - { -// printf("--- Read bytes: %i, Strlen(): %i, Message: %s ---\n", read_bytes, strlen(buff_msg), buff_msg); - } - } - } - -void init(char *str){ - char command; - uint16_t r_addr; - ipv6_addr_t std_addr; - - int res = sscanf(str, "init %c %hu", &command, &r_addr); - - if(res < 1){ - printf("Usage: init {h | r | a | e} radio_address\n"); - printf("\th\tinitialize as host\n"); - printf("\tr\tinitialize as router\n"); - printf("\ta\tinitialize as ad-hoc router\n"); - printf("\tb\tinitialize as border router\n\n"); - printf("\tradio_address must be an 8 bit integer\n"); - } - - ipv6_init_address(&std_addr,0xABCD,0,0,0,0x1034,0x00FF,0xFE00,r_addr); - - switch (command) { - case 'h': - printf("INFO: Initialize as host on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - sixlowpan_init(TRANSCEIVER_CC1100,r_addr,0); - break; - case 'r': - printf("INFO: Initialize as router on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - sixlowpan_init(TRANSCEIVER_CC1100, r_addr,0); - ipv6_init_iface_as_router(); - break; - case 'a': - printf("INFO: Initialize as adhoc router on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - sixlowpan_adhoc_init(TRANSCEIVER_CC1100, &std_addr, r_addr); - break; - case 'b': - printf("INFO: Initialize as border router on radio address %hu\n", r_addr); - if (r_addr > 255) { - printf("ERROR: radio_address not an 8 bit integer\n"); - return; - } - res = border_initialize(TRANSCEIVER_CC1100, &std_addr); - switch (res) { - case (SUCCESS): printf("INFO: Border router initialized.\n"); break; - case (SIXLOWERROR_ADDRESS): printf("ERROR: Illegal IP address: "); - ipv6_print_addr(&std_addr); break; - default: printf("ERROR: Unknown error (%d).\n", res); break; - } - break; - default: - printf("ERROR: Unknown command '%c'\n", command); - break; - } - tcp_send_pid = thread_create( tcp_send_stack_buffer, - SEND_TCP_THREAD_SIZE, - PRIORITY_MAIN, - CREATE_STACKTEST, - send_tcp_thread, - "send_tcp_thread"); -} - -void bootstrapping(char *str){ - sixlowpan_bootstrapping(); -} - -void send_udp(char *str) - { - timex_t start, end, total; - long secs; - int sock; - sockaddr6_t sa; - ipv6_addr_t ipaddr; - int bytes_sent; - int address, count; - char text[] = "abcdefghijklmnopqrstuvwxyz0123456789!-=$%&/()"; - sscanf(str, "send_udp %i %i %s", &count, &address, text); - - sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP); - if (-1 == sock) - { - printf("Error Creating Socket!"); - exit(EXIT_FAILURE); - } - - memset(&sa, 0, sizeof sa); - - ipv6_init_address(&ipaddr, 0xabcd, 0x0, 0x0, 0x0, 0x3612, 0x00ff, 0xfe00, (uint16_t)address); - ipv6_print_addr(&ipaddr); - - sa.sin6_family = AF_INET; - memcpy(&sa.sin6_addr, &ipaddr, 16); - sa.sin6_port = HTONS(7654); - ltc4150_start(); - printf("Start power: %f\n", ltc4150_get_total_Joule()); - start = vtimer_now(); - for (int i = 0; i < count; i++) - { - bytes_sent = sendto(sock, (char*)text, strlen((char*)text)+1, 0, &sa, sizeof sa); - if (bytes_sent < 0) - { - printf("Error sending packet!\n"); - } -// hwtimer_wait(20*1000); - } - end = vtimer_now(); - total = timex_sub(end, start); - secs = total.microseconds / 1000000; - printf("Used power: %f\n", ltc4150_get_total_Joule()); - printf("Start: %lu, End: %lu, Total: %lu\n", start.microseconds, end.microseconds, total.microseconds); - secs = total.microseconds / 1000000; - printf("Time: %lu seconds, Bandwidth: %lu byte/second\n", secs, (count*48)/secs); - close(sock); - } - -void set_radio_chann(char *str){ - uint16_t chann; - int res = sscanf(str, "set_chann %hu", &chann); - if(res < 1){ - printf("Usage: set_chann [channel]\n"); - } - - cc110x_set_channel(chann); -} - -void get_r_address(char *str){ - printf("radio: %hu\n", cc110x_get_address()); -} - -void ip(char *str){ - ipv6_iface_print_addrs(); -} - -void context(char *str){ - uint8_t i; - lowpan_context_t *context; - - for(i = 0; i < LOWPAN_CONTEXT_MAX; i++){ - context = lowpan_context_num_lookup(i); - if (context != NULL) { - printf("%2d\tLifetime: %5u\tLength: %3d\t",context->num,context->lifetime,context->length); - ipv6_print_addr(&(context->prefix)); - } - } -} - -void shows(char *str) - { - print_sockets(); - } - -void showReas(char *str) - { - printReasBuffers(); - } - -void kill_process(char *str) - { - msg_t send; - int mypid; - send.type = RETURNNOW; - sscanf(str, "kill_process %i", &mypid); - msg_send(&send, mypid, 0); - } - -void continue_process(char *str) - { - msg_t send; - int pid; - sscanf(str, "continue_process %i", &pid); - send.type = TCP_CONTINUE; - msg_send(&send, pid, 0); - } - -void close_tcp_thread(void) - { - close(tcp_socket_id); - } - -void close_tcp (char *str) - { - thread_create(tcp_close_thread_stack, TCP_CLOSE_THREAD_STACK_SIZE, PRIORITY_MAIN, - CREATE_STACKTEST, close_tcp_thread, "tcp_close_thread"); - } - -void boot_server(char *str) - { - bootstrapping(NULL); - vtimer_usleep(1000*1000*2); - init_tcp_server_thread(NULL); - } - -void boot_client(char *str) - { - init_tcp_cht(NULL); - vtimer_usleep(1000*1000*2); - connect_tcp("connect_tcp 2"); - } - -void show_nbr_cache(char *str) - { -// print_nbr_cache(); - } - -#ifdef DBG_IGNORE -void ignore(char *addr) { - uint16_t a; - mesg.type = DBG_IGN; - mesg.content.ptr = (char*) &tcmd; - - tcmd.transceivers = TRANSCEIVER_CC1100; - tcmd.data = &a; - if (sscanf(addr, "ign %hu", &a) == 1) { - msg_send(&mesg, transceiver_pid, 1); - } - else { - puts("Usage:\tign <addr>"); - } -} -#endif - -/* HACK: Simple routing on IP layer: - * - * This routing method is used to forward IP packets over N hops in 2 directions. - * - * Example: A <--> B <--> C <--> D (N = 4) - * - * To achieve the network topology described in the example above one has to - * declare the nodes A to D as "static_routes" and assign them radio addresses in ascending or descending order - * without gaps (ie 2-3-4-5 is OK, 2-3-5-6 is NOT OK). - * - * The variable which needs to be set in every node is static_route in sys/net/sixlowpan/sixlowpan.c. */ - -void static_routing (char *str) - { - if (static_route == 0) - { - static_route = 1; - printf("Static Routing: TRUE\n"); - } - else - { - static_route = 0; - printf("Static Routing: FALSE\n"); - } - } - -void print_fragment_counter (char *str) - { - printf("Fragment Counter: %u\n", fragmentcounter); - } - -void pfifo_buf (char *str) - { - printFIFOBuffers(); - } - -void sleep_now(char *str) - { - int time; - sscanf(str, "sleep %i", &time); - vtimer_usleep(time*1000*1000); - } - -void get_rtt (char *str) - { - int socket; - sscanf(str, "get_rtt %i", &socket); - printf("SRTT: %f, RTO: %f, RTTVAR: %f\n", getSocket(socket)->socket_values.tcp_control.srtt, - getSocket(socket)->socket_values.tcp_control.rto, - getSocket(socket)->socket_values.tcp_control.rttvar); - } - -const shell_command_t shell_commands[] = { - {"init", "", init}, - {"addr", "", get_r_address}, - {"set_chann", "", set_radio_chann}, - {"boot", "", bootstrapping}, - {"ip", "", ip}, - {"shows", "Show Sockets", shows}, - {"show_reas", "Show reassembly Buffers", showReas}, - {"context", "", context}, - {"init_udp_server_thread", "", init_udp_server_thread}, - {"init_tcp_server_thread", "", init_tcp_server_thread}, - {"init_tcp_cht", "", init_tcp_cht}, - {"connect_tcp", "", connect_tcp}, - {"send_tcp", "", send_tcp_msg}, - {"send_udp", "", send_udp}, - {"send_tcp_bulk", "send_tcp_bulk NO_OF_PACKETS PAYLOAD", send_tcp_bulk}, - {"kill_process", "", kill_process}, - {"continue_process", "", continue_process}, - {"close_tcp", "", close_tcp}, - {"tcp_bw", "tcp_bw NO_OF_PACKETS", send_tcp_bandwidth_test}, - {"boots", "", boot_server}, - {"bootc", "", boot_client}, - {"print_nbr_cache", "", show_nbr_cache}, - {"static_routing", "", static_routing}, -// {"static_head", "", static_head}, - {"pfrag", "", print_fragment_counter}, - {"show_fifo", "", pfifo_buf}, - {"sleep", "", sleep_now}, - {"get_rtt", "", get_rtt}, -#ifdef DBG_IGNORE - {"ign", "ignore node", ignore}, -#endif - {NULL, NULL, NULL} -}; - -int main(void) { - printf("6LoWPAN Transport Layers\n"); - posix_open(uart0_handler_pid, 0); - - init_tl(NULL); - - shell_t shell; - shell_init(&shell, shell_commands, uart0_readc, uart0_putc); - - shell_run(&shell); - - return 0; -} diff --git a/projects/tlayer/tests/hello-world b/projects/tlayer/tests/hello-world deleted file mode 100644 index 736151dd7823ac2b1ea6f9e8ad6137c83ee46313..0000000000000000000000000000000000000000 --- a/projects/tlayer/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn board/msba2/tools/bin/pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/ukleos/Jamfile b/projects/ukleos/Jamfile deleted file mode 100644 index a9808e1998e2f4307940ca46868b25b4e0d4dedb..0000000000000000000000000000000000000000 --- a/projects/ukleos/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects ukleos ; - -Module ukleos : main.c ; - -UseModule ukleos ; diff --git a/projects/ukleos/main.c b/projects/ukleos/main.c deleted file mode 100644 index 2aa451ee0666a59816359ae3fd2678d125b7d357..0000000000000000000000000000000000000000 --- a/projects/ukleos/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <stdio.h> - -int main(void) -{ - puts("Hello world!\n"); - - while(1); -} diff --git a/projects/ukleos/tests/hello-world b/projects/ukleos/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/ukleos/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/watch/Jamfile b/projects/watch/Jamfile deleted file mode 100644 index d3484567e3d6fb8e6f396d39ff20cdf2f3731b10..0000000000000000000000000000000000000000 --- a/projects/watch/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects watch ; - -Module watch : main.c clock_app.c alarm_app.c : uart0 posix_io rtc display_putchar gpioint hwtimer board_buzzer auto_init ; - -UseModule watch ; diff --git a/projects/watch/alarm_app.c b/projects/watch/alarm_app.c deleted file mode 100644 index 92158382d282c0f185a505cc760ed912633e302d..0000000000000000000000000000000000000000 --- a/projects/watch/alarm_app.c +++ /dev/null @@ -1,62 +0,0 @@ -#include <stdio.h> -#include <time.h> - -#include <thread.h> -#include <msg.h> -#include <rtc.h> -#include <display.h> - -#include "alarm_app.h" -#include "clock_app.h" -#include "watch.h" - -static char alarm_stack[KERNEL_CONF_STACKSIZE_DEFAULT]; - -static void alarm_thread(void) { - msg_t m; - - struct tm time; - - time.tm_sec = 1; - time.tm_min = 2; - time.tm_hour = 3; - - int active = 0; - - while(1) { - msg_receive(&m); - switch (m.type) { - case MSG_ACTIVATE: - { - time_print(&time); - if (active) { - } else { - } - break; - } - case MSG_DEACTIVATE: - { - break; - } - case MSG_BUTTON_HASH: - { - if (active) { - active = 0; - display_symbol(LCD_ICON_ALARM, SEG_OFF); - } else { - active = 1; - display_symbol(LCD_ICON_ALARM, SEG_ON); - } - break; - } - default: - { - printf("def alarm\n"); - } - } - } -} - -int alarm_app_init() { - return thread_create(alarm_stack, sizeof(alarm_stack), PRIORITY_MAIN-1, CREATE_STACKTEST, alarm_thread, "alarm"); -} diff --git a/projects/watch/alarm_app.h b/projects/watch/alarm_app.h deleted file mode 100644 index 569be69b02a05de72414b996961f1e96bf17e4ba..0000000000000000000000000000000000000000 --- a/projects/watch/alarm_app.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ALARM_APP_H -#define __ALARM_APP_H - -int alarm_app_init(); - -#endif /* __ALARM_APP_H */ diff --git a/projects/watch/clock_app.c b/projects/watch/clock_app.c deleted file mode 100644 index f46fc35bd099ddf34c00dab99d07936fb71e9894..0000000000000000000000000000000000000000 --- a/projects/watch/clock_app.c +++ /dev/null @@ -1,58 +0,0 @@ -#include <stdio.h> -#include <time.h> - -#include <thread.h> -#include <msg.h> -#include <rtc.h> - -#include "clock_app.h" -#include "watch.h" - -void time_print(struct tm *time) { - printf("%02i %02i%02i\n", time->tm_sec, time->tm_hour, time->tm_min); -} - -static char clock_stack[KERNEL_CONF_STACKSIZE_DEFAULT]; - -static void clock_thread(void) { - msg_t m; - - int active = 0; - rtc_second_pid = thread_getpid(); - - while(1) { - msg_receive(&m); - switch (m.type) { - case RTC_SECOND: - { - if (! active) break; - } - case MSG_ACTIVATE: - { - active = 1; - struct tm now; - rtc_get_localtime(&now); - time_print(&now); - break; - } - case MSG_DEACTIVATE: - { - active = 0; - break; - } - case MSG_BUTTON_HASH: - { - printf("hashclock\n"); - break; - } - default: - { - printf("def clock\n"); - } - } - } -} - -int clock_app_init() { - return thread_create(clock_stack, sizeof(clock_stack), PRIORITY_MAIN-1, CREATE_STACKTEST, clock_thread, "clock"); -} diff --git a/projects/watch/clock_app.h b/projects/watch/clock_app.h deleted file mode 100644 index 084f5886686a09aa515b4377e1de110cae3c0649..0000000000000000000000000000000000000000 --- a/projects/watch/clock_app.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __CLOCK_APP_H -#define __CLOCK_APP_H - -int clock_app_init(); -void time_print(struct tm *time); - -#endif /* __CLOCK_APP_H */ diff --git a/projects/watch/main.c b/projects/watch/main.c deleted file mode 100644 index 94bbcc86462a5fea5253392ee00ef6a6c2754ee6..0000000000000000000000000000000000000000 --- a/projects/watch/main.c +++ /dev/null @@ -1,83 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <time.h> -#include <thread.h> -#include <msg.h> - -#include <gpioint.h> -#include <buttons.h> -#include <buzzer.h> - -#include <posix_io.h> -#include <board_uart0.h> - -#include "watch.h" -#include "alarm_app.h" -#include "clock_app.h" - -#define NUM_APPS 2 -int napps = NUM_APPS; -int apps[NUM_APPS]; - -int button_thread = 0; -void button_star(void) { - msg_t m; - - if (button_thread) { - m.type = MSG_BUTTON_STAR; - msg_send(&m, button_thread, false); - } -} - -int main(void) -{ - memset(apps, '\0', sizeof(apps)); - apps[0] = clock_app_init(); - apps[1] = alarm_app_init(); - - gpioint_set(2, BUTTON_STAR_PIN, (GPIOINT_RISING_EDGE | GPIOINT_DEBOUNCE), button_star); - button_thread = thread_getpid(); - - int active_app = 0; - - msg_t m; - - //buzzer_beep(15, 5000); - - printf("ukleos\n"); - - m.type = MSG_ACTIVATE; - msg_send(&m, apps[active_app], true); - - while(1) { - msg_receive(&m); - - switch (m.type) { - case MSG_BUTTON_STAR: { - m.type = MSG_DEACTIVATE; - msg_send(&m, apps[active_app], true); - - active_app++; - - if (active_app == (NUM_APPS)) active_app = 0; - - m.type = MSG_ACTIVATE; - msg_send(&m, apps[active_app], true); - - // buzzer_beep(15, 5000); - - break; - } - case MSG_BUTTON_HASH: - { - m.type = MSG_BUTTON_HASH; - msg_send(&m, apps[active_app], true); - break; - } - default: - { - printf("msg\n"); - } - } - } -} diff --git a/projects/watch/tests/hello-world b/projects/watch/tests/hello-world deleted file mode 100755 index acde8265feff62b0aae66bbe823541fa4fe3f007..0000000000000000000000000000000000000000 --- a/projects/watch/tests/hello-world +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect - -set timeout 5 - -spawn pseudoterm $env(PORT) - -expect { - "Hello World!" {} - timeout { exit 1 } -} - -puts "\nTest successful!\n" - diff --git a/projects/watch/watch.h b/projects/watch/watch.h deleted file mode 100644 index c2cd7ddbe0793ce3c32a6e18931f84a35e7f6e21..0000000000000000000000000000000000000000 --- a/projects/watch/watch.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __WATCH_H -#define __WATCH_H - -#define MSG_ACTIVATE 0 -#define MSG_DEACTIVATE 1 -#define MSG_BUTTON_STAR 2 -#define MSG_BUTTON_HASH 3 - -#endif /* __WATCH_H */ diff --git a/projects/wiselib/Jamfile b/projects/wiselib/Jamfile deleted file mode 100644 index 9fddfaab90d876ada427820a7b03727df9b5e60f..0000000000000000000000000000000000000000 --- a/projects/wiselib/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP projects wiselib ; - -Module wiselib : main.c : shell posix_io vtimer timex shell_commands ps rtc sht11 ltc4150 cc110x gpioint config mci ps transceiver swtimer ; - -UseModule wiselib ; diff --git a/projects/wiselib/main.c b/projects/wiselib/main.c deleted file mode 100644 index ecf6cba1d8f0475c7bec9210ac43c1b509f8ac60..0000000000000000000000000000000000000000 --- a/projects/wiselib/main.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <stdio.h> -#include <string.h> - -#include <shell.h> -#include <board_uart0.h> -#include <posix_io.h> -#include <thread.h> -#include <board.h> -#include <hwtimer.h> -#include <swtimer.h> -#include <msg.h> -#include <transceiver.h> -#include <cc110x_ng.h> - -#define SHELL_STACK_SIZE (2048) -#define RADIO_STACK_SIZE (2048) - -#define SND_BUFFER_SIZE (100) -#define RCV_BUFFER_SIZE (64) - -#define SENDING_DELAY (5 * 1000) - -char shell_stack_buffer[SHELL_STACK_SIZE]; -char radio_stack_buffer[RADIO_STACK_SIZE]; - -uint8_t snd_buffer[SND_BUFFER_SIZE][CC1100_MAX_DATA_LENGTH]; - -msg_t msg_q[RCV_BUFFER_SIZE]; - -static msg_t mesg; -static transceiver_command_t tcmd; -static radio_packet_t p; - -static uint32_t sending_delay = SENDING_DELAY; - -void sender(char *count); -void print_buffer(char *unused); -void switch2rx(char *unused); -void powerdown(char *unused); -void set_delay(char *delay); - -int main(void){} diff --git a/projects/wiselib/script b/projects/wiselib/script deleted file mode 100755 index c5978378c011cc1db894f0490caaedb52af66c12..0000000000000000000000000000000000000000 --- a/projects/wiselib/script +++ /dev/null @@ -1,3 +0,0 @@ -echo "Doing stuff..." -cd $FEUERWHERE_PATH -jam -sPROJECT=wiselib diff --git a/sys/Jamfile b/sys/Jamfile deleted file mode 100644 index 89c36c15f12e7e43d823798cd7b40cfc1180fce8..0000000000000000000000000000000000000000 --- a/sys/Jamfile +++ /dev/null @@ -1,49 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP sys ; - -Module timex : timex.c ; -Module vtimer : vtimer.c : hwtimer timex ; -Module swtimer : swtimer.c : hwtimer ; -Module posix_io : posix_io.c ; -Module config : config.c : board_config ; - -Module auto_init : auto_init.c ; - -Module chardev_thread : chardev_thread.c : ringbuffer ; -Module uart0 : uart0.c : ringbuffer chardev_thread ; - -Module transceiver : transceiver.c ; - -SubInclude TOP sys net ; -SubInclude TOP sys lib ; -SubInclude TOP sys shell ; -SubInclude TOP sys net sixlowpan ; -SubInclude TOP sys net sixlowpan rpl ; -SubInclude TOP sys net destiny ; -SubInclude TOP sys net net_help ; diff --git a/sys/lib/Jamfile b/sys/lib/Jamfile deleted file mode 100644 index 1158cdb7e48ba8c1330e2ac12e5b3cde6c1555a5..0000000000000000000000000000000000000000 --- a/sys/lib/Jamfile +++ /dev/null @@ -1,10 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# ****************************************************************************** - -SubDir TOP sys lib ; - -Module hashtable : hashtable.c ; -Module hash_string : hash_string.c : hashtable ; -Module ringbuffer : ringbuffer.c ; - diff --git a/sys/net/Jamfile b/sys/net/Jamfile deleted file mode 100644 index 50ec3b6e1b73cea1abb9e9728ed40f4463ed838e..0000000000000000000000000000000000000000 --- a/sys/net/Jamfile +++ /dev/null @@ -1,32 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP sys net ; - -Module protocol_multiplex : protocol-multiplex.c ; - -# SubInclude TOP net ; diff --git a/sys/net/destiny/Jamfile b/sys/net/destiny/Jamfile deleted file mode 100644 index e5fddbc701c969a060ea4cacf1cbd8d5f9cb91a4..0000000000000000000000000000000000000000 --- a/sys/net/destiny/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP sys net destiny ; - -# HDRS += $(TOP)/sys/net/destiny/ ; - -Module destiny : destiny.c udp.c tcp.c socket.c tcp_timer.c tcp_hc.c : vtimer net_help ; diff --git a/sys/net/mm/Jamfile b/sys/net/mm/Jamfile deleted file mode 100644 index fd3bf49ba8ac047ba37d99139252056a7102ab70..0000000000000000000000000000000000000000 --- a/sys/net/mm/Jamfile +++ /dev/null @@ -1,31 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id: Jamfile 1253 2009-08-25 10:31:47Z hillebra $ - -SubDir TOP sys net mm ; - -Module net_mm : mmr.c mmstack.c : net_kernel ; - diff --git a/sys/net/net_help/Jamfile b/sys/net/net_help/Jamfile deleted file mode 100644 index 8d4527f5ac2d0ce5184ad7d07e1a96d4afce63df..0000000000000000000000000000000000000000 --- a/sys/net/net_help/Jamfile +++ /dev/null @@ -1,7 +0,0 @@ -SubDir TOP sys net net_help ; - -# HDRS += $(TOP)/sys/net/net_help/ ; - -Module net_help : net_help.c msg_help.c inet_pton.c inet_ntop.c ; - - diff --git a/sys/net/sixlowpan/Jamfile b/sys/net/sixlowpan/Jamfile deleted file mode 100644 index 61869157794ad3d94279b54dc50b6029b0b04f6d..0000000000000000000000000000000000000000 --- a/sys/net/sixlowpan/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -SubDir TOP sys net sixlowpan ; - -# HDRS += $(TOP)/sys/net/sixlowpan/ ; - -Module 6lowpan : sixlowpan.c sixlowip.c sixlowmac.c sixlownd.c sixlowborder.c ieee802154_frame.c serialnumber.c semaphore.c bordermultiplex.c flowcontrol.c : vtimer transceiver net_help rtc ; diff --git a/sys/net/sixlowpan/rpl/Jamfile b/sys/net/sixlowpan/rpl/Jamfile deleted file mode 100644 index 738beef80e2b8c7343d91cb18df6ea074010a59f..0000000000000000000000000000000000000000 --- a/sys/net/sixlowpan/rpl/Jamfile +++ /dev/null @@ -1,3 +0,0 @@ -SubDir TOP sys net sixlowpan rpl ; - -Module rpl : rpl.c of0.c rpl_dodag.c trickle.c : vtimer ; diff --git a/sys/shell/Jamfile b/sys/shell/Jamfile deleted file mode 100644 index c91c6d86ab03179d9c82076e660cbf1a9a52f488..0000000000000000000000000000000000000000 --- a/sys/shell/Jamfile +++ /dev/null @@ -1,34 +0,0 @@ -# ****************************************************************************** -# Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. -# -# These sources were developed at the Freie Universitaet Berlin, Computer -# Systems and Telematics group (http://cst.mi.fu-berlin.de). -# ------------------------------------------------------------------------------ -# This file is part of FeuerWare. -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, either version 3 of the License, or (at your option) any later -# version. -# -# FeuerWare is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see http://www.gnu.org/licenses/ . -# ------------------------------------------------------------------------------ -# For further information and questions please use the web site -# http://scatterweb.mi.fu-berlin.de -# and the mailinglist (subscription via web site) -# scatterweb@lists.spline.inf.fu-berlin.de -# ****************************************************************************** -# $Id$ - -SubDir TOP sys shell ; - -Module shell : shell.c ; -Module shell_commands : shell_commands.c id.c rtc.c sht11.c ltc4150.c cc1100.c cc110x_ng.c disk.c : shell ; - -Module ps : ps.c ; -