-
Notifications
You must be signed in to change notification settings - Fork 1
/
project-conf.h
246 lines (179 loc) · 6.4 KB
/
project-conf.h
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/*******************************************************************************
* BSD 3-Clause License
*
* Copyright (c) 2017 Beshr Al Nahas and Olaf Landsiedel.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
/**
* \file
* A2-Synchrotron project config.
* \author
* Beshr Al Nahas <[email protected]>
* Olaf Landsiedel <[email protected]>
*
*/
#ifndef PROJECT_CONF_H_
#define PROJECT_CONF_H_
#ifndef NODE_LIST_LEN
#define NODE_LIST_LEN 4 //describes how many nodes can join in a single round
#endif
#define TILE_FREEDOM 1
#define ARRIVAL_TIMES 1
#define WAIT_FOR_FREE_PATH 0
#undef COOJA
#define COOJA 1
#undef INITIATOR_NODE
#define INITIATOR_NODE 0
#define N_TX_COMPLETE 9
#define CHAOS_RESTART_MIN 4
#define CHAOS_RESTART_MAX 10
#define MERGE_COMMIT_ADVANCED_STATS 1
#define CHAOS_DYNAMIC_INITIATOR 1
#define MERGE_COMMIT_ROUND_MAX_SLOTS (200)
#define MERGE_COMMIT_SLOT_LEN_MSEC 6
#ifndef CHAOS_AUTOMATIC_START
#define CHAOS_AUTOMATIC_START 1
#endif
#ifndef CHAOS_INTERVAL_SEC
#define CHAOS_INTERVAL_SEC 2
#endif
#define CHAOS_INTERVAL (CHAOS_INTERVAL_SEC*RTIMER_SECOND)
#if COOJA
//join parameters
#define JOIN_ROUND_MAX_SLOTS (1)
#define JOIN_ROUNDS_AFTER_BOOTUP (1)
#else
//join parameters
#define JOIN_ROUND_MAX_SLOTS (120)
#define JOIN_ROUNDS_AFTER_BOOTUP (5)
#endif
// Keep this enabled, because the nodes were starting to fail
#undef LLSEC802154_CONF_SECURITY_LEVEL
#define LLSEC802154_CONF_SECURITY_LEVEL 1 //MIC
#define JOIN_STRESS_TEST (_param_join == 2)
//remember to disable logs
#undef WITH_CHAOS_LOG
#define WITH_CHAOS_LOG 0
//don't disable PRINTF if logs are enabled ;)
#undef CHAOS_DEBUG_PRINTF
#define CHAOS_DEBUG_PRINTF 1
//disable logging of flags since it takes a long time
#undef CHAOS_LOG_FLAGS
#define CHAOS_LOG_FLAGS 0
#undef CHAOS_USE_SRC_ID
#define CHAOS_USE_SRC_ID _param_src
#undef CHAOS_USE_DST_ID
#define CHAOS_USE_DST_ID _param_dst
#undef CHAOS_ENABLE_SFD_SYNC
#define CHAOS_ENABLE_SFD_SYNC _param_sync
#undef CHAOS_USE_SRC_RANK
#define CHAOS_USE_SRC_RANK _param_rank
/* Chaos timing */
//(40*(RTIMER_SECOND/10))
#undef CHAOS_RF_CHANNEL
#define CHAOS_RF_CHANNEL _param_ch
#undef CHAOS_MULTI_CHANNEL
#define CHAOS_MULTI_CHANNEL 0
#undef CHAOS_MULTI_CHANNEL_PARALLEL_SEQUENCES
#define CHAOS_MULTI_CHANNEL_PARALLEL_SEQUENCES _param_pch
#define TXPW0 31 //max
#define TXPW1 27
#define TXPW2 23
#define TXPW3 19
#define TXPW4 15
#define TXPW5 11
#define TXPW6 7
#define TXPW7 3 //min
#undef CHAOS_TX_POWER
#define CHAOS_TX_POWER 3
//TX_POWER
// { 0, 31 }, /* 0xff */
// { -1, 27 }, /* 0xfb */
// { -3, 23 }, /* 0xf7 */
// { -5, 19 }, /* 0xf3 */
// { -7, 15 }, /* 0xef */
// {-10, 11 }, /* 0xeb */
// {-15, 7 }, /* 0xe7 */
// {-25, 3 }, /* 0xe3 */
////how many rounds are considered association rounds? (thus, have shorter restart threshold)
//#define ASSOCIATE_ROUND_NUMBER ( 20 )
//#define ASSOCIATE_ROUND_RESTART_THRESHOLD ( 2 )
/* no need to touch these */
#undef RTIMER_CONF_SECOND
#define RTIMER_CONF_SECOND (4096U*4)
/* how many failed rounds to allow before associating again? */
#undef CHAOS_FAILED_ROUNDS_RESYNC_THRESHOLD
#define CHAOS_FAILED_ROUNDS_RESYNC_THRESHOLD (10)
//no need for the led :)
//for SKY
#undef PRINT_STACK_ON_REBOOT
#define PRINT_STACK_ON_REBOOT 1
//#undef ENABLE_COOJA_DEBUG
//#define ENABLE_COOJA_DEBUG 1
#define EWSN_LEDS_AFTER_ROUND 0
#if WITH_CHAOS_LOG && !CHAOS_DEBUG_PRINTF
#error "Fix me: PRINTF disabled and CHAOS_LOG enabled!"
#endif
//
///* a big number used only in the association phase */
//#define EWSN_ROUND_MAX_SLOTS (MIN(CHAOS_INTERVAL/EWSN_SLOT_LEN - 10,200))
///* the actual limit that is enforced after the association rounds!! */
//#define EWSN_ROUND_MAX_APP_SLOTS (100)
//lower tick rate
//#undef CLOCK_CONF_SECOND
//#define CLOCK_CONF_SECOND 1UL
//#define SKY_DISABLE_WDT 1
#undef QUEUEBUF_CONF_NUM
#define QUEUEBUF_CONF_NUM 0
#undef CC2420_CONF_AUTOACK
#define CC2420_CONF_AUTOACK 0
#undef DCOSYNCH_CONF_ENABLED
#define DCOSYNCH_CONF_ENABLED 0
/* we have to disable DMA in order to save power and enable LPM3 for the CPU */
#undef UART1_CONF_RX_WITH_DMA
#define UART1_CONF_RX_WITH_DMA 0
#undef UART1_CONF_TX_WITH_DMA
#define UART1_CONF_TX_WITH_DMA 0
#undef UART0_CONF_RX_WITH_DMA
#define UART0_CONF_RX_WITH_DMA 0
#undef UART0_CONF_TX_WITH_DMA
#define UART0_CONF_TX_WITH_DMA 1
//remove processes names to avoid printing them
#undef PROCESS_CONF_NO_PROCESS_NAMES
#define PROCESS_CONF_NO_PROCESS_NAMES 0
#undef LOG_CONF_ENABLED
#define LOG_CONF_ENABLED 0
#undef ENERGEST_CONF_ON
#define ENERGEST_CONF_ON 0
#define MAX_NODE_COUNT 16
#define TILES_WIDTH 6
#define TILES_HEIGHT 6
#define NUM_TILES (TILES_WIDTH * TILES_HEIGHT)
#define MERGE_COMMIT_VALUE_STRUCT_CONTENT uint16_t priorities[MAX_NODE_COUNT]; uint8_t tile_reservations[NUM_TILES];
#define SERIAL_LINE_CONF_BUFSIZE 256
#endif /* PROJECT_CONF_H_ */