-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.slip
151 lines (127 loc) · 4.44 KB
/
Makefile.slip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Border router Makefile for GNRC and SLIP based networking
# name of your application
APPLICATION = data-collector
# If no BOARD is found in the environment, use this default:
BOARD ?= samr21-xpro
# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../../riot/repo
# Uncomment these lines if you want to use platform support from external
# repositories:
#RIOTCPU ?= $(CURDIR)/../../RIOT/thirdparty_cpu
#RIOTBOARD ?= $(CURDIR)/../../RIOT/thirdparty_boards
# Uncomment this to enable scheduler statistics for ps:
#CFLAGS += -DSCHEDSTATISTICS
# If you want to use native with valgrind, you should recompile native
# with the target all-valgrind instead of all:
# make -B clean all-valgrind
# Comment this out to disable 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:
QUIET ?= 1
# Bootstrapping information for Datahead
ifeq (,$(DATAHEAD_ADDR))
# don't include prefix length in address
DATAHEAD_ADDR='"bbbb::1"'
endif
ifeq (,$(DATAHEAD_PORT))
DATAHEAD_PORT='"5683"'
endif
# For local wireless interface; only used if a router (NET_ROUTER defined).
ifeq (,$(HOST_ADDR))
HOST_ADDR='"aaaa::1/64"'
ROUTER_IF=7
endif
CFLAGS += -DDATAHEAD_ADDR=$(DATAHEAD_ADDR)
CFLAGS += -DDATAHEAD_PORT=$(DATAHEAD_PORT)
CFLAGS += -DHOST_ADDR=$(HOST_ADDR)
CFLAGS += -DROUTER_IF=$(ROUTER_IF)
# Border router requirements
ifeq (,$(SLIP_UART))
# set default (last available UART)
SLIP_UART="(UART_NUMOF-1)"
endif
ifeq (,$(SLIP_BAUDRATE))
# set default
SLIP_BAUDRATE=115200
endif
ifeq (,$(SLIP_ADDR))
# must include prefix length in address
SLIP_ADDR='"bbbb::2/64"'
BORDER_IF=8
endif
ifeq (,$(SLIP_PEER_ADDR))
# don't include prefix length in address
SLIP_PEER_ADDR='"bbbb::1"'
endif
GNRC_NETIF_NUMOF := 2
INCLUDES += -I$(CURDIR)
CFLAGS += -DNET_SLIP
CFLAGS += -DSLIP_UART=$(SLIP_UART)
CFLAGS += -DSLIP_BAUDRATE=$(SLIP_BAUDRATE)
CFLAGS += -DSLIP_ADDR=$(SLIP_ADDR)
CFLAGS += -DSLIP_PEER_ADDR=$(SLIP_PEER_ADDR)
CFLAGS += -DBORDER_IF=$(BORDER_IF)
BOARD_PROVIDES_NETIF := airfy-beacon cc2538dk fox iotlab-m3 iotlab-a8-m3 mulle \
microbit native nrf51dongle nrf52dk nrf6310 openmote-cc2538 pba-d-01-kw2x \
pca10000 pca10005 remote-pa remote-reva saml21-xpro samr21-xpro \
spark-core telosb yunjia-nrf51822 z1
ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF)))
# Use modules for networking
# gnrc is a meta module including all required, basic gnrc networking modules
USEMODULE += gnrc
# use the default network interface for the board
USEMODULE += gnrc_netdev_default
# automatically initialize the network interface
USEMODULE += auto_init_gnrc_netif
# Comment/Flag below does not apply. We use all of network stack.
#
# We use only the lower layers of the GNRC network stack, hence, we can
# reduce the size of the packet buffer a bit
#CFLAGS += -DGNRC_PKTBUF_SIZE=512
USEMODULE += gnrc_ipv6_default
USEMODULE += gnrc_udp
USEMODULE += gnrc_sock_udp
USEPKG += nanocoap
# Required by nanocoap, but only due to issue #5959.
USEMODULE += posix
USEMODULE += gcoap
# Border router requirements
# Include SLIP package for IP over Serial communication
USEMODULE += gnrc_slip
ifneq (,$(NET_ROUTER))
# Add a routing protocol
USEMODULE += gnrc_rpl
# Specify the mandatory networking modules for 6LoWPAN border router
USEMODULE += gnrc_sixlowpan_border_router_default
CFLAGS += -DNET_ROUTER
endif
endif
ifneq (,$(filter msb-430,$(BOARD)))
USEMODULE += sht11
endif
ifneq (,$(filter msba2,$(BOARD)))
USEMODULE += sht11
USEMODULE += mci
USEMODULE += random
endif
# Include and auto-initialize all available sensors
USEMODULE += saul_default
# For Microchip MCP9808 temperature sensor. No further configuration needed;
# uses defaults.
USEMODULE += jc42
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz
DEFAULT_CHANNEL ?= 0
CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
else
ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz
DEFAULT_CHANNEL ?= 5
CFLAGS += -DIEEE802154_DEFAULT_SUBGHZ_CHANNEL=$(DEFAULT_CHANNEL)
else # radio is IEEE 802.15.4 2.4 GHz
DEFAULT_CHANNEL ?= 26
CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
endif
endif