Commit 882be254 authored by Simon Duquennoy's avatar Simon Duquennoy Committed by GitHub
Browse files

Merge pull request #94 from simonduq/pr/misc

Miscellaneous fixes
parents 4d827736 40e6b4be
......@@ -118,7 +118,7 @@ ifeq ($(MAKE_MAC),MAKE_MAC_OTHER)
CFLAGS += -DMAC_CONF_WITH_OTHER=1
endif
# Configure IPv6, RPL
# Configure Network layer
MAKE_NET_NULLNET = 0
MAKE_NET_IPV6 = 1
......@@ -133,8 +133,6 @@ endif
ifeq ($(MAKE_NET),MAKE_NET_IPV6)
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
CONTIKI_WITH_RPL ?= 1
CONTIKI_WITH_RPL_LITE ?= 1
MODULES += os/net/ipv6
else
CFLAGS += -DNETSTACK_CONF_WITH_NULLNET=1
......@@ -145,20 +143,32 @@ ifeq ($(MAKE_NET),MAKE_NET_OTHER)
CFLAGS += -DNETSTACK_CONF_WITH_OTHER=1
endif
ifeq ($(CONTIKI_WITH_RPL),1)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
ifeq ($(CONTIKI_WITH_RPL_LITE),1)
CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1
MODULES += os/net/rpl-lite
else
MODULES += os/net/rpl-classic
endif
ifeq ($(WITH_IP64),1)
MODULES += os/services/ip64
endif
# Configure Routing protocol
MAKE_ROUTING_NONE = 0
MAKE_ROUTING_RPL_CLASSIC = 1
MAKE_ROUTING_RPL_LITE = 2
# Default routing protocol: RPL for IPv6, None otherwise
ifeq ($(MAKE_NET),MAKE_NET_IPV6)
MAKE_ROUTING ?= MAKE_ROUTING_RPL_LITE
else
CFLAGS += -DUIP_CONF_IPV6_RPL=0
MAKE_ROUTING ?= MAKE_ROUTING_NONE
endif
ifeq ($(WITH_IP64),1)
MODULES += os/services/ip64
ifeq ($(MAKE_ROUTING),MAKE_ROUTING_RPL_CLASSIC)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
CFLAGS += -DUIP_CONF_IPV6_RPL_CLASSIC=1
MODULES += os/net/rpl-classic
else ifeq ($(MAKE_ROUTING),MAKE_ROUTING_RPL_LITE)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1
MODULES += os/net/rpl-lite
else
CFLAGS += -DUIP_CONF_IPV6_RPL=0
endif
ifdef MODULES
......@@ -166,7 +176,7 @@ ifdef MODULES
MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(UNIQUEMODULES)}}
MODULES_SOURCES = ${foreach d, $(MODULEDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}}
MODULES_INCLUDES = ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.${notdir $(d)}}}
-include $(MODULE_INCLUDES)
include $(MODULES_INCLUDES)
CONTIKI_SOURCEFILES += $(MODULES_SOURCES)
endif
......@@ -363,8 +373,7 @@ viewconf:
@echo "##### \"BOARD\": _________________________________ $(BOARD)"
@echo "##### \"MAKE_MAC\": ______________________________ $(MAKE_MAC)"
@echo "##### \"MAKE_NET\": ______________________________ $(MAKE_NET)"
@echo "##### \"CONTIKI_WITH_RPL\": ______________________ $(CONTIKI_WITH_RPL)"
@echo "##### \"CONTIKI_WITH_RPL_LITE\": _________________ $(CONTIKI_WITH_RPL_LITE)"
@echo "##### \"MAKE_ROUTING\": __________________________ $(MAKE_ROUTING)"
@echo "----------------- C variables: -----------------"
$(Q)$(CC) $(CFLAGS) -E $(CONTIKI)/tools/viewconf.c | grep \#\#\#\#\#
@echo "------------------------------------------------"
......
......@@ -230,8 +230,9 @@ typedef uint32_t rtimer_clock_t;
*/
#ifndef USB_SERIAL_CONF_ENABLE
#define USB_SERIAL_CONF_ENABLE \
((SLIP_ARCH_CONF_USB & SLIP_ARCH_CONF_ENABLED) | \
DBG_CONF_USB)
((SLIP_ARCH_CONF_USB && SLIP_ARCH_CONF_ENABLED) || \
(MAC_CONF_WITH_TSCH && (SLIP_ARCH_CONF_ENABLED || BUILD_WITH_SHELL)) || \
DBG_CONF_USB)
#endif
/*
......
......@@ -68,6 +68,12 @@
#include "reg.h"
#include "ieee-addr.h"
#include "lpm.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
#include <stdint.h>
#include <string.h>
......@@ -224,6 +230,13 @@ main(void)
energest_init();
ENERGEST_ON(ENERGEST_TYPE_CPU);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
autostart_start(autostart_processes);
watchdog_start();
......
......@@ -43,36 +43,6 @@ CONTIKI_APP_OBJ = $(CONTIKI_APP).co
# Modules
MODULES += os/net os/net/mac os/net/mac/framer
## Copied from Makefile.include, since Cooja overrides CFLAGS et al
MAKE_NET_NULLNET = 0
MAKE_NET_IPV6 = 1
MAKE_NET_OTHER = 2
# Make IPv6 the default stack
MAKE_NET ?= MAKE_NET_IPV6
ifeq ($(MAKE_NET),MAKE_NET_IPV6)
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
CONTIKI_WITH_RPL ?= 1
CONTIKI_WITH_RPL_LITE ?= 1
MODULES += os/net/ipv6
COOJA_NET = uip-driver.c
else
COOJA_NET =
endif
ifeq ($(CONTIKI_WITH_RPL),1)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
ifeq ($(CONTIKI_WITH_RPL_LITE),1)
CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1
MODULES += os/net/rpl-lite
else
MODULES += os/net/rpl
endif
else
CFLAGS += -DUIP_CONF_IPV6_RPL=0
endif
### COOJA platform sources
COOJA = $(CONTIKI)/arch/platform/$(TARGET)
CONTIKI_TARGET_DIRS = . dev lib sys cfs net
......
......@@ -124,7 +124,6 @@ typedef uint64_t rtimer_clock_t;
#define UIP_ARCH_IPCHKSUM 1
#if MAC_CONF_WITH_TSCH
#define COOJA_CONF_SIMULATE_TURNAROUND 0
/* A bug in cooja causes many EBs to be missed at scan. Increase EB
frequency to shorten the join process */
#undef TSCH_CONF_EB_PERIOD
......
......@@ -61,7 +61,12 @@
#include "dev/vib-sensor.h"
#include "sys/node-id.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
/* JNI-defined functions, depends on the environment variable CLASSNAME */
#ifndef CLASSNAME
......@@ -258,6 +263,13 @@ contiki_init()
/* Start serial process */
serial_line_init();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
/* Start autostart processes (defined in Contiki application) */
print_processes(autostart_processes);
autostart_start(autostart_processes);
......
......@@ -39,7 +39,7 @@
#ifdef COOJA_CONF_SIMULATE_TURNAROUND
#define COOJA_SIMULATE_TURNAROUND COOJA_CONF_SIMULATE_TURNAROUND
#else
#define COOJA_SIMULATE_TURNAROUND 1
#define COOJA_SIMULATE_TURNAROUND (!(MAC_CONF_WITH_TSCH))
#endif
#ifdef COOJA_CONF_TRANSMIT_ON_CCA
......
......@@ -96,6 +96,13 @@ extern uint32_t heap_location;
#include "experiment-setup.h"
#endif
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
/* _EXTRA_LPM is the sleep mode, _LPM is the doze mode */
#define ENERGEST_TYPE_EXTRA_LPM ENERGEST_TYPE_LPM
......@@ -346,6 +353,13 @@ main(void)
auto-start processes */
(void)u32AHI_Init();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
start_autostart_processes();
leds_off(LEDS_ALL);
......
......@@ -69,6 +69,13 @@
#include "net/ipv6/uip-ds6.h"
#endif /* NETSTACK_CONF_WITH_IPV6 */
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
#ifdef SELECT_CONF_MAX
#define SELECT_MAX SELECT_CONF_MAX
#else
......@@ -274,6 +281,13 @@ main(int argc, char **argv)
serial_line_init();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
autostart_start(autostart_processes);
/* Make standard output unbuffered. */
......
......@@ -69,6 +69,13 @@
#endif
#endif
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
#if defined(SOFTDEVICE_PRESENT) && PLATFORM_INDICATE_BLE_STATE
PROCESS(ble_iface_observer, "BLE interface observer");
......@@ -178,6 +185,14 @@ main(void)
#endif /* SOFTDEVICE_PRESENT */
process_start(&sensors_process, NULL);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
autostart_start(autostart_processes);
watchdog_start();
......
......@@ -278,8 +278,9 @@ typedef uint32_t rtimer_clock_t;
*/
#ifndef USB_SERIAL_CONF_ENABLE
#define USB_SERIAL_CONF_ENABLE \
((SLIP_ARCH_CONF_USB & SLIP_ARCH_CONF_ENABLED) | \
DBG_CONF_USB)
((SLIP_ARCH_CONF_USB && SLIP_ARCH_CONF_ENABLED) || \
(MAC_CONF_WITH_TSCH && (SLIP_ARCH_CONF_ENABLED || BUILD_WITH_SHELL)) || \
DBG_CONF_USB)
#endif
/*
......
......@@ -72,6 +72,13 @@
#include "ieee-addr.h"
#include "lpm.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
#include <stdint.h>
#include <string.h>
#include <stdio.h>
......@@ -220,6 +227,13 @@ main(void)
energest_init();
ENERGEST_ON(ENERGEST_TYPE_CPU);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
autostart_start(autostart_processes);
watchdog_start();
......
......@@ -53,6 +53,13 @@
#include "cfs/cfs-coffee.h"
#include "sys/autostart.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
#if DCOSYNCH_CONF_ENABLED
static struct timer mgt_timer;
#endif
......@@ -306,6 +313,13 @@ main(int argc, char **argv)
watchdog_start();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
#if !PROCESS_CONF_NO_PROCESS_NAMES
print_processes(autostart_processes);
#endif /* !PROCESS_CONF_NO_PROCESS_NAMES */
......
......@@ -55,7 +55,7 @@
* You need to set this to 1 to use TSCH with its default 2.2ms or larger guard time.
*/
#ifndef CC2650_FAST_RADIO_STARTUP
#define CC2650_FAST_RADIO_STARTUP 0
#define CC2650_FAST_RADIO_STARTUP (MAC_CONF_WITH_TSCH)
#endif
#ifdef RF_CHANNEL
......
......@@ -71,6 +71,13 @@
#include "driverlib/driverlib_release.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
#include <stdio.h>
/*---------------------------------------------------------------------------*/
unsigned short node_id = 0;
......@@ -226,6 +233,13 @@ main(void)
process_start(&sensors_process, NULL);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
autostart_start(autostart_processes);
watchdog_start();
......
......@@ -276,7 +276,8 @@ typedef uint32_t rtimer_clock_t;
*/
#ifndef USB_SERIAL_CONF_ENABLE
#define USB_SERIAL_CONF_ENABLE \
((SLIP_ARCH_CONF_USB & SLIP_ARCH_CONF_ENABLED) | \
((SLIP_ARCH_CONF_USB && SLIP_ARCH_CONF_ENABLED) || \
(MAC_CONF_WITH_TSCH && (SLIP_ARCH_CONF_ENABLED || BUILD_WITH_SHELL)) || \
DBG_CONF_USB)
#endif
......
......@@ -71,6 +71,12 @@
#include "ieee-addr.h"
#include "lpm.h"
#include "sys/autostart.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
#include <stdint.h>
#include <string.h>
......@@ -286,6 +292,13 @@ main(void)
energest_init();
ENERGEST_ON(ENERGEST_TYPE_CPU);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */
autostart_start(autostart_processes);
watchdog_start();
......
......@@ -4,6 +4,7 @@ PROJECT_SOURCEFILES += test-sf.c
CONTIKI = ../../../
MAKE_MAC = MAKE_MAC_TSCH
MAKE_ROUTING = MAKE_ROUTING_NONE
MODULES += os/net/mac/tsch/sixtop
include $(CONTIKI)/Makefile.include
......@@ -31,18 +31,9 @@
#ifndef _PROJECT_CONF_H_
#define _PROJECT_CONF_H_
#define CONTIKI_WITH_RPL 0
#define UIP_CONF_IPV6_RPL 0
#define UIP_CONF_ND6_SEND_RA 0
#if CONTIKI_TARGET_COOJA
#define COOJA_CONF_SIMULATE_TURNAROUND 0
#else
#error "This example is intended to be used for Cooja mote."
#endif /* CONTIKI_TARGET_COOJA */
#define TSCH_CONF_WITH_SIXTOP 1
#define TSCH_LOG_CONF_LEVEL 2
#define TSCH_CONF_AUTOSTART 1
#define TSCH_CONF_DEFAULT_HOPPING_SEQUENCE TSCH_HOPPING_SEQUENCE_1_1
......
......@@ -35,29 +35,11 @@
#ifndef __PROJECT_CONF_H__
#define __PROJECT_CONF_H__
/* Set to use the Contiki shell */
#define WITH_SHELL 1
/* Set to enable TSCH security */
#ifndef WITH_SECURITY
#define WITH_SECURITY 0
#endif /* WITH_SECURITY */
/*******************************************************/
/********************* Enable TSCH *********************/
/*******************************************************/
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#define TSCH_CALLBACK_KA_SENT tsch_rpl_callback_ka_sent
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
/*******************************************************/
/******************* Configure TSCH ********************/
/*******************************************************/
/* IEEE802.15.4 PANID */
#define IEEE802154_CONF_PANID 0x81a5
......@@ -71,8 +53,7 @@
#if WITH_SECURITY
/* Enable security */
#define LLSEC802154_CONF_ENABLED 1
#define LLSEC802154_CONF_USES_EXPLICIT_KEYS 0
#define LLSEC802154_CONF_USES_FRAME_COUNTER 0
#define TSCH_SECURITY_CONF_K1 { 0x11, 0x11, 0x11, 0x11, \
0x11, 0x11, 0x11, 0x11, \
0x11, 0x11, 0x11, 0x11, \
......@@ -108,36 +89,10 @@
/************* Platform dependent configuration ********/
/*******************************************************/
#if CONTIKI_TARGET_CC2538DK || CONTIKI_TARGET_ZOUL || \
CONTIKI_TARGET_OPENMOTE_CC2538
#define TSCH_CONF_HW_FRAME_FILTERING 0
#endif /* CONTIKI_TARGET_CC2538DK || CONTIKI_TARGET_ZOUL \
|| CONTIKI_TARGET_OPENMOTE_CC2538 */
/* Needed for CC2538 platforms only */
/* For TSCH we have to use the more accurate crystal oscillator
* by default the RC oscillator is activated */
#define SYS_CTRL_CONF_OSC32K_USE_XTAL 1
#define USB_SERIAL_CONF_ENABLE 1
/* USB serial takes space, free more space elsewhere */
#define SICSLOWPAN_CONF_FRAG 0
#define UIP_CONF_BUFFER_SIZE 160
#if CONTIKI_TARGET_SRF06_CC26XX
#define CC2650_FAST_RADIO_STARTUP 1
#endif /* CONTIK_TARGET_SRF06_CC26XX */
#if CONTIKI_TARGET_COOJA
#define COOJA_CONF_SIMULATE_TURNAROUND 0
#endif /* CONTIKI_TARGET_COOJA */
/* Needed for cc2420 platforms only */
/* Disable DCO calibration (uses timerB) */
#define DCOSYNCH_CONF_ENABLED 0
/* Enable SFD timestamps (uses timerB) */
#define CC2420_CONF_SFD_TIMESTAMPS 1
/*******************************************************/
/******************* Configure 6LoWPAN/IPv6 ************/
/*******************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment