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 #endif /* NETSTACK_CONF_H */
74 
75 /* Radio setup */
76 #define NETSTACK_CONF_RADIO cooja_radio_driver
77 
78 #define cooja_radio_driver_max_payload_len 125
79 
80 /* Default network config */
81 #if NETSTACK_CONF_WITH_IPV6
82 
83 
84 /* configure network size and density */
85 #ifndef NETSTACK_MAX_ROUTE_ENTRIES
86 #define NETSTACK_MAX_ROUTE_ENTRIES 300
87 #endif /* NETSTACK_MAX_ROUTE_ENTRIES */
88 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
89 #define NBR_TABLE_CONF_MAX_NEIGHBORS 300
90 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
91 
92 /* configure queues */
93 #ifndef QUEUEBUF_CONF_NUM
94 #define QUEUEBUF_CONF_NUM 64
95 #endif /* QUEUEBUF_CONF_NUM */
96 
97 #ifndef UIP_CONF_IPV6_QUEUE_PKT
98 #define UIP_CONF_IPV6_QUEUE_PKT 1
99 #endif /* UIP_CONF_IPV6_QUEUE_PKT */
100 
101 #endif /* NETSTACK_CONF_WITH_IPV6 */
102 
103 #define CC_CONF_REGISTER_ARGS 1
104 #define CC_CONF_FUNCTION_POINTER_ARGS 1
105 #define CC_CONF_VA_ARGS 1
106 #define CC_CONF_INLINE inline
107 
108 /* These names are deprecated, use C99 names. */
109 #include <inttypes.h>
110 typedef uint8_t u8_t;
111 typedef uint16_t u16_t;
112 typedef uint32_t u32_t;
113 typedef int32_t s32_t;
114 
115 typedef unsigned short uip_stats_t;
116 
117 #define CLOCK_CONF_SECOND 1000L
118 typedef unsigned long clock_time_t;
119 
120 /* Use 64-bit rtimer (default in Contiki-NG is 32) */
121 #define RTIMER_CONF_CLOCK_SIZE 8
122 
123 /* 1 len byte, 2 bytes CRC */
124 #define RADIO_PHY_OVERHEAD 3
125 /* 250kbps data rate. One byte = 32us */
126 #define RADIO_BYTE_AIR_TIME 32
127 #define RADIO_DELAY_BEFORE_TX 0
128 #define RADIO_DELAY_BEFORE_RX 0
129 #define RADIO_DELAY_BEFORE_DETECT 0
130 
131 #define UIP_ARCH_IPCHKSUM 1
132 
133 #if MAC_CONF_WITH_TSCH
134 /* A bug in cooja causes many EBs to be missed at scan. Increase EB
135  frequency to shorten the join process */
136 #undef TSCH_CONF_EB_PERIOD
137 #define TSCH_CONF_EB_PERIOD (4 * CLOCK_SECOND)
138 #undef TSCH_CONF_MAX_EB_PERIOD
139 #define TSCH_CONF_MAX_EB_PERIOD (4 * CLOCK_SECOND)
140 #endif /* MAC_CONF_WITH_TSCH */
141 
142 #define CFS_CONF_OFFSET_TYPE long
143 
144 #define PLATFORM_CONF_SUPPORTS_STACK_CHECK 0
145 
146 #endif /* CONTIKI_CONF_H_ */