Skip to content

Commit e1a5095

Browse files
committed
Merge tag '2.6' into update_to_2.6
Version 2.6 Conflicts: .gitignore core/loader/elfloader-avr.c cpu/avr/dev/clock-avr.h cpu/avr/dev/rs232.c cpu/avr/dev/rs232.h cpu/avr/mtarch.c cpu/avr/rtimer-arch.c tools/cygwin/cygwin1.dll tools/stm32w/stm32w_flasher/FTD2XX.dll tools/stm32w/stm32w_flasher/python26.dll tools/stm32w/stm32w_flasher/pywintypes26.dll tools/stm32w/stm32w_flasher/stm32w_flasher.exe tools/stm32w/stm32w_flasher/w9xpopen.exe tools/stm32w/wpcapslip6/wpcapslip6.exe
2 parents 6ab0f5c + a3e5637 commit e1a5095

File tree

2,036 files changed

+162884
-81729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,036 files changed

+162884
-81729
lines changed

.gitignore

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
*.a
2+
*.bin
23
*.map
3-
*.hex
4-
*.arduino
5-
*.native
6-
*.core
4+
*.png
5+
*.log
6+
*.elf
7+
*.ihex
78
obj_*
8-
<<<<<<< HEAD
9-
examples/*/symbols.c
10-
examples/*/symbols.h
11-
=======
12-
>>>>>>> fa83a9d43fb19dda97b0a4f4591c22c95ce98e64
9+
symbols.*
10+
Makefile.target
11+
doc/html
12+
patches-*
13+
tools/tunslip6

Makefile.include

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- makefile -*-
2+
13
ifndef CONTIKI
24
${error CONTIKI not defined! You must specify where CONTIKI resides}
35
endif
@@ -19,11 +21,21 @@ ifeq ($(DEFINES),)
1921
endif
2022
endif
2123

24+
ifndef HOST_OS
25+
ifeq ($(OS),Windows_NT)
26+
## TODO: detect more specific Windows set-ups,
27+
## e.g. CygWin, MingW, VisualC, Watcom, Interix
28+
HOST_OS := Windows
29+
else
30+
HOST_OS := $(shell uname)
31+
endif
32+
endif
33+
2234
usage:
2335
@echo "make MAKETARGETS... [TARGET=(TARGET)] [savetarget] [targets]"
2436

2537
targets:
26-
@ls -1 $(CONTIKI)/platform | grep -v CVS
38+
@ls -1 $(CONTIKI)/platform $(TARGETDIRS) | grep -v CVS
2739

2840
savetarget:
2941
-@rm -f Makefile.target
@@ -36,13 +48,10 @@ savedefines:
3648
@echo >Makefile.$(TARGET).defines "DEFINES = $(DEFINES)"
3749

3850
OBJECTDIR = obj_$(TARGET)
39-
ifeq (${wildcard $(OBJECTDIR)},)
40-
DUMMY := ${shell mkdir $(OBJECTDIR)}
41-
endif
4251

4352
LOWERCASE = -abcdefghijklmnopqrstuvwxyz
4453
UPPERCASE = _ABCDEFGHIJKLMNOPQRSTUVWXYZ
45-
TARGET_UPPERCASE := ${shell echo $(TARGET) | sed 'y!$(LOWERCASE)!$(UPPERCASE)!'}
54+
TARGET_UPPERCASE := ${strip ${shell echo $(TARGET) | sed y!$(LOWERCASE)!$(UPPERCASE)!}}
4655
CFLAGS += -DCONTIKI=1 -DCONTIKI_TARGET_$(TARGET_UPPERCASE)=1
4756

4857
include $(CONTIKI)/core/net/rime/Makefile.rime
@@ -58,14 +67,17 @@ NET = netstack.c uip-debug.c packetbuf.c queuebuf.c packetqueue.c
5867
ifdef UIP_CONF_IPV6
5968
CFLAGS += -DUIP_CONF_IPV6=1
6069
UIP = uip6.c tcpip.c psock.c uip-udp-packet.c uip-split.c \
61-
resolv.c tcpdump.c uiplib.c
70+
resolv.c tcpdump.c uiplib.c simple-udp.c
6271
NET += $(UIP) uip-icmp6.c uip-nd6.c uip-packetqueue.c \
6372
sicslowpan.c neighbor-attr.c neighbor-info.c uip-ds6.c
64-
include $(CONTIKI)/core/net/rpl/Makefile.rpl
73+
ifneq ($(UIP_CONF_RPL),0)
74+
CFLAGS += -DUIP_CONF_IPV6_RPL=1
75+
include $(CONTIKI)/core/net/rpl/Makefile.rpl
76+
endif # UIP_CONF_RPL
6577
else # UIP_CONF_IPV6
6678
UIP = uip.c uiplib.c resolv.c tcpip.c psock.c hc.c uip-split.c uip-fw.c \
6779
uip-fw-drv.c uip_arp.c tcpdump.c uip-neighbor.c uip-udp-packet.c \
68-
uip-over-mesh.c dhcpc.c #rawpacket-udp.c
80+
uip-over-mesh.c dhcpc.c simple-udp.c
6981
NET += $(UIP) uaodv.c uaodv-rt.c
7082
endif # UIP_CONF_IPV6
7183

@@ -93,12 +105,9 @@ PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFI
93105

94106
ifdef APPS
95107
APPDIRS += ${wildcard ${addprefix $(CONTIKI)/apps/, $(APPS)} \
96-
${addprefix $(CONTIKI)/platform/$(TARGET)/apps/, $(APPS)} \
97-
${addprefix , $(APPS)}}
98-
APPINCLUDES = ${foreach APP, $(APPS), ${wildcard \
99-
$(CONTIKI)/apps/$(APP)/Makefile.$(APP) \
100-
$(CONTIKI)/platform/$(TARGET)/apps/$(APP)/Makefile.$(APP) \
101-
$(APP)/Makefile.$(APP)}}
108+
${addprefix $(CONTIKI)/platform/$(TARGET)/apps/, $(APPS)} \
109+
$(APPS)}
110+
APPINCLUDES = ${foreach APP, $(APPS), ${wildcard ${foreach DIR, $(APPDIRS), $(DIR)/Makefile.$(APP)}}}
102111
-include $(APPINCLUDES)
103112
APP_SOURCES = ${foreach APP, $(APPS), $($(APP)_src)}
104113
DSC_SOURCES = ${foreach APP, $(APPS), $($(APP)_dsc)}
@@ -107,13 +116,19 @@ endif
107116

108117
### Include target makefile (TODO Unsafe?)
109118

110-
target_makefile := $(wildcard $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET))
119+
target_makefile := $(wildcard $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET) ${foreach TDIR, $(TARGETDIRS), $(TDIR)/$(TARGET)/Makefile.$(TARGET)})
111120

112-
# Check if the target makefile exists
121+
# Check if the target makefile exists, and create the object directory if necessary.
113122
ifeq ($(strip $(target_makefile)),)
114123
${error The target platform "$(TARGET)" does not exist (maybe it was misspelled?)}
115124
else
116-
include $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET)
125+
ifeq (${wildcard $(OBJECTDIR)},)
126+
DUMMY := ${shell mkdir $(OBJECTDIR)}
127+
endif
128+
ifneq (1, ${words $(target_makefile)})
129+
${error More than one TARGET Makefile found: $(target_makefile)}
130+
endif
131+
include $(target_makefile)
117132
endif
118133

119134
### Forward comma-separated list of arbitrary defines to the compiler
@@ -123,19 +138,27 @@ CFLAGS += ${addprefix -D,${subst $(COMMA), ,$(DEFINES)}}
123138

124139
### Setup directory search path for source and header files
125140

126-
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
141+
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix ${dir $(target_makefile)}, \
127142
$(CONTIKI_TARGET_DIRS)}
128143
CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI_CPU)/, \
129144
$(CONTIKI_CPU_DIRS)}
130145

131146
SOURCEDIRS = . $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
132-
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(APPDIRS)
147+
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(APPDIRS) ${dir $(target_makefile)}
133148

134149
vpath %.c $(SOURCEDIRS)
135150
vpath %.S $(SOURCEDIRS)
136151

137152
CFLAGS += ${addprefix -I,$(SOURCEDIRS)}
138153

154+
### Check for a git repo and pass version if found
155+
### git.exe in Windows cmd shells may require no stderr redirection
156+
#RELSTR=${shell git describe --tags}
157+
RELSTR=${shell git describe --tags 2>/dev/null}
158+
ifneq ($(RELSTR),)
159+
CFLAGS += -DCONTIKI_VERSION_STRING=\"Contiki-$(RELSTR)\"
160+
endif
161+
139162
### Automatic dependency generation
140163

141164
ifneq ($(MAKECMDGOALS),clean)
@@ -152,7 +175,7 @@ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
152175
rm -f $(@:.o=.$$$$)
153176
endef
154177

155-
clean:
178+
clean:
156179
rm -f *~ *core core *.srec \
157180
*.lst *.map \
158181
*.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \
@@ -204,6 +227,12 @@ ifndef CUSTOM_RULE_LINK
204227
$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@
205228
endif
206229

230+
%.ramprof: %.$(TARGET)
231+
nm -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4
232+
233+
%.flashprof: %.$(TARGET)
234+
nm -S -td --size-sort $< | grep -i " [t] " | cut -d' ' -f2,4
235+
207236
# Don't treat %.$(TARGET) as an intermediate file because it is
208237
# in fact the primary target.
209238
.PRECIOUS: %.$(TARGET)

README

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
1-
Contiki is an open source, highly portable, multi-tasking operating
2-
system for memory-constrained networked embedded systems written by
3-
Adam Dunkels at the Networked Embedded Systems group at the Swedish
4-
Institute of Computer Science.
1+
The Contiki Operating System
52

6-
Contiki is designed for embedded systems with small amounts of
7-
memory. A typical Contiki configuration is 2 kilobytes of RAM and 40
8-
kilobytes of ROM. Contiki consists of an event-driven kernel on top of
9-
which application programs are dynamically loaded and unloaded at
10-
runtime. Contiki processes use light-weight protothreads that provide
11-
a linear, thread-like programming style on top of the event-driven
12-
kernel. Contiki also supports per-process optional preemptive
13-
multi-threading, interprocess communication using message passing
14-
through events, as well as an optional GUI subsystem with either
15-
direct graphic support for locally connected terminals or networked
16-
virtual display with VNC or over Telnet.
3+
Contiki is an open source operating system that runs on tiny low-power
4+
microcontrollers and makes it possible to develop applications that
5+
make efficient use of the hardware while providing standardized
6+
low-power wireless communication for a range of hardware platforms.
177

18-
Contiki contains two communication stacks: uIP and Rime. uIP is a
19-
small RFC-compliant TCP/IP stack that makes it possible for Contiki to
20-
communicate over the Internet. Rime is a lightweight communication
21-
stack designed for low-power radios. Rime provides a wide range of
22-
communication primitives, from best-effort local area broadcast, to
23-
reliable multi-hop bulk data flooding.
8+
Contiki is used in numerous commercial and non-commercial systems,
9+
such as city sound monitoring, street lights, networked electrical
10+
power meters, industrial monitoring, radiation monitoring,
11+
construction site monitoring, alarm systems, remote house monitoring,
12+
and so on.
2413

25-
Contiki runs on a variety of platform ranging from embedded
26-
microcontrollers such as the MSP430 and the AVR to old
27-
homecomputers. Code footprint is on the order of kilobytes and memory
28-
usage can be configured to be as low as tens of bytes.
14+
For more information, see the Contiki website:
2915

30-
Contiki is written in the C programming language and is freely
31-
available as open source under a BSD-style license. More information
32-
about Contiki can be found at the Contiki home page:
33-
http://www.sics.se/contiki/
16+
http://www.contiki-os.org/

apps/antelope/Makefile.antelope

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
antelope_src = antelope.c aql-adt.c aql-exec.c aql-lexer.c aql-parser.c \
2+
index.c index-inline.c index-maxheap.c lvm.c relation.c \
3+
result.c storage-cfs.c
4+
antelope_dsc =

apps/antelope/antelope.c

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
/*
2+
* Copyright (c) 2010, Swedish Institute of Computer Science
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions
7+
* are met:
8+
* 1. Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
* 2. Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in the
12+
* documentation and/or other materials provided with the distribution.
13+
* 3. Neither the name of the Institute nor the names of its contributors
14+
* may be used to endorse or promote products derived from this software
15+
* without specific prior written permission.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27+
* SUCH DAMAGE.
28+
*/
29+
30+
/**
31+
* \file
32+
* Main functions for Antelope, a DBMS for sensor devices.
33+
*
34+
* Antelope is described and evaluated in the paper A Database in
35+
* Every Sensor, N. Tsiftes and A. Dunkels, in Proceedings of
36+
* ACM SenSys 2011.
37+
* \author
38+
* Nicolas Tsiftes <nvt@sics.se>
39+
*/
40+
41+
#include <stdio.h>
42+
43+
#include "antelope.h"
44+
45+
static db_output_function_t output = printf;
46+
47+
void
48+
db_init(void)
49+
{
50+
relation_init();
51+
index_init();
52+
}
53+
54+
void
55+
db_set_output_function(db_output_function_t f)
56+
{
57+
output = f;
58+
}
59+
60+
const char *
61+
db_get_result_message(db_result_t code)
62+
{
63+
switch(code) {
64+
case DB_FINISHED:
65+
return "Iteration finished";
66+
case DB_OK:
67+
return "Operation succeeded";
68+
case DB_LIMIT_ERROR:
69+
return "Limit reached";
70+
case DB_ALLOCATION_ERROR:
71+
return "Allocation error";
72+
case DB_STORAGE_ERROR:
73+
return "Storage error";
74+
case DB_PARSING_ERROR:
75+
return "Parsing error";
76+
case DB_NAME_ERROR:
77+
return "Invalid name";
78+
case DB_RELATIONAL_ERROR:
79+
return "Semantic error";
80+
case DB_TYPE_ERROR:
81+
return "Type error";
82+
case DB_IMPLEMENTATION_ERROR:
83+
return "Implementation error";
84+
case DB_INDEX_ERROR:
85+
return "Index error";
86+
case DB_BUSY_ERROR:
87+
return "Busy with processing";
88+
case DB_INCONSISTENCY_ERROR:
89+
return "Inconsistent handle";
90+
case DB_ARGUMENT_ERROR:
91+
return "Invalid argument";
92+
default:
93+
return "Unknown result code";
94+
};
95+
}
96+
97+
db_result_t
98+
db_print_header(db_handle_t *handle)
99+
{
100+
int column;
101+
attribute_t *attr;
102+
103+
output("[relation = %s, attributes = (", handle->result_rel->name);
104+
attr = list_head(handle->result_rel->attributes);
105+
for(column = 0; column < handle->ncolumns; column++) {
106+
if(attr == NULL) {
107+
return DB_IMPLEMENTATION_ERROR;
108+
} else if(attr->flags & ATTRIBUTE_FLAG_NO_STORE) {
109+
continue;
110+
}
111+
output("%s%s", column > 0 ? ", " : "", attr->name);
112+
attr = attr->next;
113+
}
114+
output(")]\n");
115+
return DB_OK;
116+
}
117+
118+
db_result_t
119+
db_print_tuple(db_handle_t *handle)
120+
{
121+
int column;
122+
attribute_value_t value;
123+
db_result_t result;
124+
125+
output("Row %lu:\t", (unsigned long)handle->current_row);
126+
127+
for(column = 0; column < handle->ncolumns; column++) {
128+
result = db_get_value(&value, handle, column);
129+
if(DB_ERROR(result)) {
130+
output("Unable to get the value for row %lu, column %u: %s\n",
131+
(unsigned long)handle->current_row, column,
132+
db_get_result_message(result));
133+
break;
134+
}
135+
136+
switch(value.domain) {
137+
case DOMAIN_STRING:
138+
output("\"%s\"\t", VALUE_STRING(&value));
139+
break;
140+
case DOMAIN_INT:
141+
output("%d\t", (int)VALUE_INT(&value));
142+
break;
143+
case DOMAIN_LONG:
144+
output("%ld\t", (long)VALUE_LONG(&value));
145+
break;
146+
default:
147+
output("\nUnrecognized domain: %d\n", value.domain);
148+
return DB_IMPLEMENTATION_ERROR;
149+
}
150+
}
151+
output("\n");
152+
153+
return DB_OK;
154+
}
155+
156+
int
157+
db_processing(db_handle_t *handle)
158+
{
159+
return handle->flags & DB_HANDLE_FLAG_PROCESSING;
160+
}

0 commit comments

Comments
 (0)