Contiki-NG
contiki-conf.h
1 /*
2  * Copyright (c) 2006, 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
11  * copyright notice, this list of conditions and the following
12  * disclaimer in the documentation and/or other materials provided
13  * with the distribution.
14  * 3. The name of the author may not be used to endorse or promote
15  * products derived from this software without specific prior
16  * written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  *
31  */
32 
33 #ifndef CONTIKI_CONF_H_
34 #define CONTIKI_CONF_H_
35 
36 /* include the project config */
37 #ifdef PROJECT_CONF_PATH
38 #include PROJECT_CONF_PATH
39 #endif /* PROJECT_CONF_PATH */
40 
41 #ifdef INCLUDE_SUBPLATFORM_CONF
42 #include "subplatform-conf.h"
43 #endif /* INCLUDE_SUBPLATFORM_CONF */
44 
45 #define PLATFORM_CONF_PROVIDES_MAIN_LOOP 1
46 
47 #define LOG_CONF_ENABLED 1
48 
49 #define COOJA 1
50 
51 #define LEDS_CONF_LEGACY_API 1
52 
53 #ifndef EEPROM_CONF_SIZE
54 #define EEPROM_CONF_SIZE 1024
55 #endif
56 
57 #define w_memcpy memcpy
58 
59 #ifdef NETSTACK_CONF_H
60 
61 /* These header overrides the below default configuration */
62 #define NETSTACK__QUOTEME(s) NETSTACK_QUOTEME(s)
63 #define NETSTACK_QUOTEME(s) #s
64 #include NETSTACK__QUOTEME(NETSTACK_CONF_H)
65 
66 #else /* NETSTACK_CONF_H */
67 
68 /* Default network config */
69 #define CSMA_CONF_SEND_SOFT_ACK 1
70 #define CSMA_CONF_ACK_WAIT_TIME RTIMER_SECOND / 500
71 #define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME 0
72 
73 /* Radio setup */
74 #define NETSTACK_CONF_RADIO cooja_radio_driver
75 
76 #endif /* NETSTACK_CONF_H */
77 
78 /* Default network config */
79 #if NETSTACK_CONF_WITH_IPV6
80 
81 
82 
83 /* Radio setup */
84 #define NETSTACK_CONF_RADIO cooja_radio_driver
85 
86 /* configure network size and density */
87 #ifndef NETSTACK_MAX_ROUTE_ENTRIES
88 #define NETSTACK_MAX_ROUTE_ENTRIES 300
89 #endif /* NETSTACK_MAX_ROUTE_ENTRIES */
90 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
91 #define NBR_TABLE_CONF_MAX_NEIGHBORS 300
92 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
93 
94 /* configure queues */
95 #ifndef QUEUEBUF_CONF_NUM
96 #define QUEUEBUF_CONF_NUM 64
97 #endif /* QUEUEBUF_CONF_NUM */
98 
99 #ifndef UIP_CONF_IPV6_QUEUE_PKT
100 #define UIP_CONF_IPV6_QUEUE_PKT 1
101 #endif /* UIP_CONF_IPV6_QUEUE_PKT */
102 
103 #endif /* NETSTACK_CONF_WITH_IPV6 */
104 
105 #define CC_CONF_REGISTER_ARGS 1
106 #define CC_CONF_FUNCTION_POINTER_ARGS 1
107 #define CC_CONF_VA_ARGS 1
108 #define CC_CONF_INLINE inline
109 
110 /* These names are deprecated, use C99 names. */
111 #include <inttypes.h>
112 typedef uint8_t u8_t;
113 typedef uint16_t u16_t;
114 typedef uint32_t u32_t;
115 typedef int32_t s32_t;
116 
117 typedef unsigned short uip_stats_t;
118 
119 #define CLOCK_CONF_SECOND 1000L
120 typedef unsigned long clock_time_t;
121 
122 /* Use 64-bit rtimer (default in Contiki-NG is 32) */
123 #define RTIMER_CONF_CLOCK_SIZE 8
124 
125 /* 1 len byte, 2 bytes CRC */
126 #define RADIO_PHY_OVERHEAD 3
127 /* 250kbps data rate. One byte = 32us */
128 #define RADIO_BYTE_AIR_TIME 32
129 #define RADIO_DELAY_BEFORE_TX 0
130 #define RADIO_DELAY_BEFORE_RX 0
131 #define RADIO_DELAY_BEFORE_DETECT 0
132 
133 #define UIP_ARCH_IPCHKSUM 1
134 
135 #if MAC_CONF_WITH_TSCH
136 /* A bug in cooja causes many EBs to be missed at scan. Increase EB
137  frequency to shorten the join process */
138 #undef TSCH_CONF_EB_PERIOD
139 #define TSCH_CONF_EB_PERIOD (4 * CLOCK_SECOND)
140 #undef TSCH_CONF_MAX_EB_PERIOD
141 #define TSCH_CONF_MAX_EB_PERIOD (4 * CLOCK_SECOND)
142 #endif /* MAC_CONF_WITH_TSCH */
143 
144 #define CFS_CONF_OFFSET_TYPE long
145 
146 #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 125
147 
148 #define PLATFORM_CONF_SUPPORTS_STACK_CHECK 0
149 
150 #endif /* CONTIKI_CONF_H_ */