mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
add application for openwsn
This commit is contained in:
parent
2dec12302b
commit
3e1346d1d7
33
openwsn/Makefile
Normal file
33
openwsn/Makefile
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
APPLICATION = openwsn-app
|
||||||
|
|
||||||
|
# If no BOARD is found in the environment, use this default:
|
||||||
|
BOARD ?= iot-lab_M3
|
||||||
|
|
||||||
|
# This has to be the absolute path to the RIOT base directory:
|
||||||
|
RIOTBASE ?= $(CURDIR)/../../RIOT
|
||||||
|
|
||||||
|
# Uncomment this to enable scheduler statistics for ps:
|
||||||
|
#CFLAGS += -DSCHEDSTATISTICS
|
||||||
|
|
||||||
|
# Uncomment this to enable code in RIOT that does safety checking
|
||||||
|
# which is not needed in a production environment but helps in the
|
||||||
|
# development process:
|
||||||
|
CFLAGS += -DDEVELHELP
|
||||||
|
|
||||||
|
# Change this to 0 show compiler invocation lines by default:
|
||||||
|
export QUIET ?= 1
|
||||||
|
|
||||||
|
USEMODULE += ps
|
||||||
|
USEMODULE += vtimer
|
||||||
|
USEMODULE += shell
|
||||||
|
USEMODULE += shell_commands
|
||||||
|
USEMODULE += posix
|
||||||
|
USEMODULE += uart0
|
||||||
|
USEMODULE += at86rf231
|
||||||
|
|
||||||
|
USEPKG += openwsn
|
||||||
|
|
||||||
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|
||||||
|
INCLUDES += -I$(RIOTBASE)/pkg/openwsn/openwsn/projects/common/03oos_openwsn \
|
||||||
|
-I$(RIOTBASE)/pkg/openwsn/openwsn/bsp/boards/riot-adaption
|
60
openwsn/main.c
Normal file
60
openwsn/main.c
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Freie Universität Berlin
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
||||||
|
* Public License v2.1. See the file LICENSE in the top level directory for more
|
||||||
|
* details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup tests
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief Test application for OpenWSN pkg
|
||||||
|
*
|
||||||
|
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "vtimer.h"
|
||||||
|
#include "shell.h"
|
||||||
|
#include "posix_io.h"
|
||||||
|
#include "03oos_openwsn.h"
|
||||||
|
#include "board_uart0.h"
|
||||||
|
#include "riot.h"
|
||||||
|
|
||||||
|
|
||||||
|
const shell_command_t shell_commands[] = {
|
||||||
|
{"owsn_init", "Start OpenWSN", openwsn_start_thread},
|
||||||
|
{NULL, NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static int shell_readc(void)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
|
||||||
|
puts("Welcome to RIOT!");
|
||||||
|
|
||||||
|
shell_init(&shell, shell_commands, UART0_BUFSIZE, shell_readc, shell_putchar);
|
||||||
|
|
||||||
|
shell_run(&shell);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user