| 1 |
|
/*
|
| 2 |
|
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
| 3 |
|
Copyright (C) 2016..2018 Thomas Schöpping et al.
|
| 4 |
|
|
| 5 |
|
This program is free software: you can redistribute it and/or modify
|
| 6 |
|
it under the terms of the GNU General Public License as published by
|
| 7 |
|
the Free Software Foundation, either version 3 of the License, or
|
| 8 |
|
(at your option) any later version.
|
| 9 |
|
|
| 10 |
|
This program is distributed in the hope that it will be useful,
|
| 11 |
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 12 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 13 |
|
GNU General Public License for more details.
|
| 14 |
|
|
| 15 |
|
You should have received a copy of the GNU General Public License
|
| 16 |
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 17 |
|
*/
|
| 18 |
|
|
| 19 |
|
/**
|
| 20 |
|
* @file os/modules/DiWheelDrive/chconf.h
|
| 21 |
|
* @brief ChibiOS Configuration file for the DiWheelDrive v1.1 module.
|
| 22 |
|
* @details Contains the application specific kernel settings.
|
| 23 |
|
*
|
| 24 |
|
* @addtogroup config
|
| 25 |
|
* @details Kernel related settings and hooks.
|
| 26 |
|
* @{
|
| 27 |
|
*/
|
| 28 |
|
|
| 29 |
|
#ifndef _CHCONF_H_
|
| 30 |
|
#define _CHCONF_H_
|
| 31 |
|
|
| 32 |
|
#include <aosconf.h>
|
| 33 |
|
|
| 34 |
|
/*===========================================================================*/
|
| 35 |
|
/**
|
| 36 |
|
* @name System timers settings
|
| 37 |
|
* @{
|
| 38 |
|
*/
|
| 39 |
|
/*===========================================================================*/
|
| 40 |
|
|
| 41 |
|
/**
|
| 42 |
|
* @brief System time counter resolution.
|
| 43 |
|
* @note Allowed values are 16 or 32 bits.
|
| 44 |
|
*/
|
| 45 |
|
#define CH_CFG_ST_RESOLUTION 16
|
| 46 |
|
|
| 47 |
|
/**
|
| 48 |
|
* @brief System tick frequency.
|
| 49 |
|
* @details Frequency of the system timer that drives the system ticks. This
|
| 50 |
|
* setting also defines the system tick time unit.
|
| 51 |
|
*/
|
| 52 |
|
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__)
|
| 53 |
|
#define CH_CFG_ST_FREQUENCY 1000000UL
|
| 54 |
|
#else
|
| 55 |
|
#define CH_CFG_ST_FREQUENCY 100000UL
|
| 56 |
|
#endif
|
| 57 |
|
|
| 58 |
|
/**
|
| 59 |
|
* @brief Time delta constant for the tick-less mode.
|
| 60 |
|
* @note If this value is zero then the system uses the classic
|
| 61 |
|
* periodic tick. This value represents the minimum number
|
| 62 |
|
* of ticks that is safe to specify in a timeout directive.
|
| 63 |
|
* The value one is not valid, timeouts are rounded up to
|
| 64 |
|
* this value.
|
| 65 |
|
*/
|
| 66 |
|
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__)
|
| 67 |
|
#define CH_CFG_ST_TIMEDELTA 20
|
| 68 |
|
#else
|
| 69 |
|
#define CH_CFG_ST_TIMEDELTA 2
|
| 70 |
|
#endif
|
| 71 |
|
|
| 72 |
|
/** @} */
|
| 73 |
|
|
| 74 |
|
/*===========================================================================*/
|
| 75 |
|
/**
|
| 76 |
|
* @name Port specific settings
|
| 77 |
|
* @{
|
| 78 |
|
*/
|
| 79 |
|
/*===========================================================================*/
|
| 80 |
|
|
| 81 |
|
/**
|
| 82 |
|
* @brief NVIC VTOR initialization offset.
|
| 83 |
|
* @details On initialization, the code at this address in the flash memory will be executed.
|
| 84 |
|
*/
|
| 85 |
|
#define CORTEX_VTOR_INIT 0x00006000U
|
| 86 |
|
|
| 87 |
|
/** @} */
|
| 88 |
|
|
| 89 |
|
#include <aos_chconf.h>
|
| 90 |
|
|
| 91 |
|
#endif /* _CHCONF_H_ */
|
| 92 |
|
|
| 93 |
|
/** @} */
|
|
1 |
/*
|
|
2 |
* AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
|
3 |
* Copyright (C) 2016..2018 Thomas Schöpping et al.
|
|
4 |
*
|
|
5 |
* This program is free software: you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License as published by
|
|
7 |
* the Free Software Foundation, either version 3 of the License, or
|
|
8 |
* (at your option) any later version.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17 |
*/
|
|
18 |
|
|
19 |
/**
|
|
20 |
* @file os/modules/DiWheelDrive/chconf.h
|
|
21 |
* @brief ChibiOS Configuration file for the DiWheelDrive v1.1 module.
|
|
22 |
* @details Contains the application specific kernel settings.
|
|
23 |
*
|
|
24 |
* @addtogroup config
|
|
25 |
* @details Kernel related settings and hooks.
|
|
26 |
* @{
|
|
27 |
*/
|
|
28 |
|
|
29 |
#ifndef CHCONF_H
|
|
30 |
#define CHCONF_H
|
|
31 |
|
|
32 |
#define _CHIBIOS_RT_CONF_
|
|
33 |
#define _CHIBIOS_RT_CONF_VER_5_1_
|
|
34 |
|
|
35 |
/*===========================================================================*/
|
|
36 |
/**
|
|
37 |
* @name System timers settings
|
|
38 |
* @{
|
|
39 |
*/
|
|
40 |
/*===========================================================================*/
|
|
41 |
|
|
42 |
/**
|
|
43 |
* @brief System time counter resolution.
|
|
44 |
* @note Allowed values are 16 or 32 bits.
|
|
45 |
*/
|
|
46 |
#if !defined(CH_CFG_ST_RESOLUTION)
|
|
47 |
#define CH_CFG_ST_RESOLUTION 16
|
|
48 |
#endif
|
|
49 |
|
|
50 |
/**
|
|
51 |
* @brief System tick frequency.
|
|
52 |
* @details Frequency of the system timer that drives the system ticks. This
|
|
53 |
* setting also defines the system tick time unit.
|
|
54 |
*/
|
|
55 |
#if !defined(CH_CFG_ST_FREQUENCY)
|
|
56 |
#define CH_CFG_ST_FREQUENCY 1000000UL
|
|
57 |
#endif
|
|
58 |
|
|
59 |
/**
|
|
60 |
* @brief Time intervals data size.
|
|
61 |
* @note Allowed values are 16, 32 or 64 bits.
|
|
62 |
*/
|
|
63 |
#if !defined(CH_CFG_INTERVALS_SIZE)
|
|
64 |
#define CH_CFG_INTERVALS_SIZE 64
|
|
65 |
#endif
|
|
66 |
|
|
67 |
/**
|
|
68 |
* @brief Time types data size.
|
|
69 |
* @note Allowed values are 16 or 32 bits.
|
|
70 |
*/
|
|
71 |
#if !defined(CH_CFG_TIME_TYPES_SIZE)
|
|
72 |
#define CH_CFG_TIME_TYPES_SIZE 32
|
|
73 |
#endif
|
|
74 |
|
|
75 |
/**
|
|
76 |
* @brief Time delta constant for the tick-less mode.
|
|
77 |
* @note If this value is zero then the system uses the classic
|
|
78 |
* periodic tick. This value represents the minimum number
|
|
79 |
* of ticks that is safe to specify in a timeout directive.
|
|
80 |
* The value one is not valid, timeouts are rounded up to
|
|
81 |
* this value.
|
|
82 |
*/
|
|
83 |
#if !defined(CH_CFG_ST_TIMEDELTA)
|
|
84 |
#define CH_CFG_ST_TIMEDELTA 10
|
|
85 |
#endif
|
|
86 |
|
|
87 |
/** @} */
|
|
88 |
|
|
89 |
/*===========================================================================*/
|
|
90 |
/**
|
|
91 |
* @name Kernel parameters and options
|
|
92 |
* @{
|
|
93 |
*/
|
|
94 |
/*===========================================================================*/
|
|
95 |
|
|
96 |
/**
|
|
97 |
* @brief Round robin interval.
|
|
98 |
* @details This constant is the number of system ticks allowed for the
|
|
99 |
* threads before preemption occurs. Setting this value to zero
|
|
100 |
* disables the preemption for threads with equal priority and the
|
|
101 |
* round robin becomes cooperative. Note that higher priority
|
|
102 |
* threads can still preempt, the kernel is always preemptive.
|
|
103 |
* @note Disabling the round robin preemption makes the kernel more compact
|
|
104 |
* and generally faster.
|
|
105 |
* @note The round robin preemption is not supported in tickless mode and
|
|
106 |
* must be set to zero in that case.
|
|
107 |
*/
|
|
108 |
#if !defined(CH_CFG_TIME_QUANTUM)
|
|
109 |
#define CH_CFG_TIME_QUANTUM 0
|
|
110 |
#endif
|
|
111 |
|
|
112 |
/**
|
|
113 |
* @brief Managed RAM size.
|
|
114 |
* @details Size of the RAM area to be managed by the OS. If set to zero
|
|
115 |
* then the whole available RAM is used. The core memory is made
|
|
116 |
* available to the heap allocator and/or can be used directly through
|
|
117 |
* the simplified core memory allocator.
|
|
118 |
*
|
|
119 |
* @note In order to let the OS manage the whole RAM the linker script must
|
|
120 |
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
|
121 |
* @note Requires @p CH_CFG_USE_MEMCORE.
|
|
122 |
*/
|
|
123 |
#if !defined(CH_CFG_MEMCORE_SIZE)
|
|
124 |
#define CH_CFG_MEMCORE_SIZE 0
|
|
125 |
#endif
|
|
126 |
|
|
127 |
/**
|
|
128 |
* @brief Idle thread automatic spawn suppression.
|
|
129 |
* @details When this option is activated the function @p chSysInit()
|
|
130 |
* does not spawn the idle thread. The application @p main()
|
|
131 |
* function becomes the idle thread and must implement an
|
|
132 |
* infinite loop.
|
|
133 |
*/
|
|
134 |
#if !defined(CH_CFG_NO_IDLE_THREAD)
|
|
135 |
#define CH_CFG_NO_IDLE_THREAD FALSE
|
|
136 |
#endif
|
|
137 |
|
|
138 |
/** @} */
|
|
139 |
|
|
140 |
/*===========================================================================*/
|
|
141 |
/**
|
|
142 |
* @name Performance options
|
|
143 |
* @{
|
|
144 |
*/
|
|
145 |
/*===========================================================================*/
|
|
146 |
|
|
147 |
/**
|
|
148 |
* @brief OS optimization.
|
|
149 |
* @details If enabled then time efficient rather than space efficient code
|
|
150 |
* is used when two possible implementations exist.
|
|
151 |
*
|
|
152 |
* @note This is not related to the compiler optimization options.
|
|
153 |
* @note The default is @p TRUE.
|
|
154 |
*/
|
|
155 |
#if !defined(CH_CFG_OPTIMIZE_SPEED)
|
|
156 |
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
|
157 |
#endif
|
|
158 |
|
|
159 |
/** @} */
|
|
160 |
|
|
161 |
/*===========================================================================*/
|
|
162 |
/**
|
|
163 |
* @name Subsystem options
|
|
164 |
* @{
|
|
165 |
*/
|
|
166 |
/*===========================================================================*/
|
|
167 |
|
|
168 |
/**
|
|
169 |
* @brief Time Measurement APIs.
|
|
170 |
* @details If enabled then the time measurement APIs are included in
|
|
171 |
* the kernel.
|
|
172 |
*
|
|
173 |
* @note The default is @p TRUE.
|
|
174 |
*/
|
|
175 |
#if !defined(CH_CFG_USE_TM)
|
|
176 |
#define CH_CFG_USE_TM FALSE
|
|
177 |
#endif
|
|
178 |
|
|
179 |
/**
|
|
180 |
* @brief Threads registry APIs.
|
|
181 |
* @details If enabled then the registry APIs are included in the kernel.
|
|
182 |
*
|
|
183 |
* @note The default is @p TRUE.
|
|
184 |
*/
|
|
185 |
#if !defined(CH_CFG_USE_REGISTRY)
|
|
186 |
#define CH_CFG_USE_REGISTRY FALSE
|
|
187 |
#endif
|
|
188 |
|
|
189 |
/**
|
|
190 |
* @brief Threads synchronization APIs.
|
|
191 |
* @details If enabled then the @p chThdWait() function is included in
|
|
192 |
* the kernel.
|
|
193 |
*
|
|
194 |
* @note The default is @p TRUE.
|
|
195 |
*/
|
|
196 |
#if !defined(CH_CFG_USE_WAITEXIT)
|
|
197 |
#define CH_CFG_USE_WAITEXIT TRUE
|
|
198 |
#endif
|
|
199 |
|
|
200 |
/**
|
|
201 |
* @brief Semaphores APIs.
|
|
202 |
* @details If enabled then the Semaphores APIs are included in the kernel.
|
|
203 |
*
|
|
204 |
* @note The default is @p TRUE.
|
|
205 |
*/
|
|
206 |
#if !defined(CH_CFG_USE_SEMAPHORES)
|
|
207 |
#define CH_CFG_USE_SEMAPHORES FALSE
|
|
208 |
#endif
|
|
209 |
|
|
210 |
/**
|
|
211 |
* @brief Semaphores queuing mode.
|
|
212 |
* @details If enabled then the threads are enqueued on semaphores by
|
|
213 |
* priority rather than in FIFO order.
|
|
214 |
*
|
|
215 |
* @note The default is @p FALSE. Enable this if you have special
|
|
216 |
* requirements.
|
|
217 |
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
|
218 |
*/
|
|
219 |
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
|
|
220 |
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
|
221 |
#endif
|
|
222 |
|
|
223 |
/**
|
|
224 |
* @brief Mutexes APIs.
|
|
225 |
* @details If enabled then the mutexes APIs are included in the kernel.
|
|
226 |
*
|
|
227 |
* @note The default is @p TRUE.
|
|
228 |
*/
|
|
229 |
#if !defined(CH_CFG_USE_MUTEXES)
|
|
230 |
#define CH_CFG_USE_MUTEXES TRUE
|
|
231 |
#endif
|
|
232 |
|
|
233 |
/**
|
|
234 |
* @brief Enables recursive behavior on mutexes.
|
|
235 |
* @note Recursive mutexes are heavier and have an increased
|
|
236 |
* memory footprint.
|
|
237 |
*
|
|
238 |
* @note The default is @p FALSE.
|
|
239 |
* @note Requires @p CH_CFG_USE_MUTEXES.
|
|
240 |
*/
|
|
241 |
#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
|
|
242 |
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
|
243 |
#endif
|
|
244 |
|
|
245 |
/**
|
|
246 |
* @brief Conditional Variables APIs.
|
|
247 |
* @details If enabled then the conditional variables APIs are included
|
|
248 |
* in the kernel.
|
|
249 |
*
|
|
250 |
* @note The default is @p TRUE.
|
|
251 |
* @note Requires @p CH_CFG_USE_MUTEXES.
|
|
252 |
*/
|
|
253 |
#if !defined(CH_CFG_USE_CONDVARS)
|
|
254 |
#define CH_CFG_USE_CONDVARS FALSE
|
|
255 |
#endif
|
|
256 |
|
|
257 |
/**
|
|
258 |
* @brief Conditional Variables APIs with timeout.
|
|
259 |
* @details If enabled then the conditional variables APIs with timeout
|
|
260 |
* specification are included in the kernel.
|
|
261 |
*
|
|
262 |
* @note The default is @p TRUE.
|
|
263 |
* @note Requires @p CH_CFG_USE_CONDVARS.
|
|
264 |
*/
|
|
265 |
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
|
|
266 |
#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE
|
|
267 |
#endif
|
|
268 |
|
|
269 |
/**
|
|
270 |
* @brief Events Flags APIs.
|
|
271 |
* @details If enabled then the event flags APIs are included in the kernel.
|
|
272 |
*
|
|
273 |
* @note The default is @p TRUE.
|
|
274 |
*/
|
|
275 |
#if !defined(CH_CFG_USE_EVENTS)
|
|
276 |
#define CH_CFG_USE_EVENTS TRUE
|
|
277 |
#endif
|
|
278 |
|
|
279 |
/**
|
|
280 |
* @brief Events Flags APIs with timeout.
|
|
281 |
* @details If enabled then the events APIs with timeout specification
|
|
282 |
* are included in the kernel.
|
|
283 |
*
|
|
284 |
* @note The default is @p TRUE.
|
|
285 |
* @note Requires @p CH_CFG_USE_EVENTS.
|
|
286 |
*/
|
|
287 |
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
|
|
288 |
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
|
289 |
#endif
|
|
290 |
|
|
291 |
/**
|
|
292 |
* @brief Synchronous Messages APIs.
|
|
293 |
* @details If enabled then the synchronous messages APIs are included
|
|
294 |
* in the kernel.
|
|
295 |
*
|
|
296 |
* @note The default is @p TRUE.
|
|
297 |
*/
|
|
298 |
#if !defined(CH_CFG_USE_MESSAGES)
|
|
299 |
#define CH_CFG_USE_MESSAGES FALSE
|
|
300 |
#endif
|
|
301 |
|
|
302 |
/**
|
|
303 |
* @brief Synchronous Messages queuing mode.
|
|
304 |
* @details If enabled then messages are served by priority rather than in
|
|
305 |
* FIFO order.
|
|
306 |
*
|
|
307 |
* @note The default is @p FALSE. Enable this if you have special
|
|
308 |
* requirements.
|
|
309 |
* @note Requires @p CH_CFG_USE_MESSAGES.
|
|
310 |
*/
|
|
311 |
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
|
|
312 |
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
|
313 |
#endif
|
|
314 |
|
|
315 |
/**
|
|
316 |
* @brief Mailboxes APIs.
|
|
317 |
* @details If enabled then the asynchronous messages (mailboxes) APIs are
|
|
318 |
* included in the kernel.
|
|
319 |
*
|
|
320 |
* @note The default is @p TRUE.
|
|
321 |
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
|
322 |
*/
|
|
323 |
#if !defined(CH_CFG_USE_MAILBOXES)
|
|
324 |
#define CH_CFG_USE_MAILBOXES FALSE
|
|
325 |
#endif
|
|
326 |
|
|
327 |
/**
|
|
328 |
* @brief Core Memory Manager APIs.
|
|
329 |
* @details If enabled then the core memory manager APIs are included
|
|
330 |
* in the kernel.
|
|
331 |
*
|
|
332 |
* @note The default is @p TRUE.
|
|
333 |
*/
|
|
334 |
#if !defined(CH_CFG_USE_MEMCORE)
|
|
335 |
#define CH_CFG_USE_MEMCORE FALSE
|
|
336 |
#endif
|
|
337 |
|
|
338 |
/**
|
|
339 |
* @brief Heap Allocator APIs.
|
|
340 |
* @details If enabled then the memory heap allocator APIs are included
|
|
341 |
* in the kernel.
|
|
342 |
*
|
|
343 |
* @note The default is @p TRUE.
|
|
344 |
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
|
345 |
* @p CH_CFG_USE_SEMAPHORES.
|
|
346 |
* @note Mutexes are recommended.
|
|
347 |
*/
|
|
348 |
#if !defined(CH_CFG_USE_HEAP)
|
|
349 |
#define CH_CFG_USE_HEAP FALSE
|
|
350 |
#endif
|
|
351 |
|
|
352 |
/**
|
|
353 |
* @brief Memory Pools Allocator APIs.
|
|
354 |
* @details If enabled then the memory pools allocator APIs are included
|
|
355 |
* in the kernel.
|
|
356 |
*
|
|
357 |
* @note The default is @p TRUE.
|
|
358 |
*/
|
|
359 |
#if !defined(CH_CFG_USE_MEMPOOLS)
|
|
360 |
#define CH_CFG_USE_MEMPOOLS FALSE
|
|
361 |
#endif
|
|
362 |
|
|
363 |
/**
|
|
364 |
* @brief Objects FIFOs APIs.
|
|
365 |
* @details If enabled then the objects FIFOs APIs are included
|
|
366 |
* in the kernel.
|
|
367 |
*
|
|
368 |
* @note The default is @p TRUE.
|
|
369 |
*/
|
|
370 |
#if !defined(CH_CFG_USE_OBJ_FIFOS)
|
|
371 |
#define CH_CFG_USE_OBJ_FIFOS FALSE
|
|
372 |
#endif
|
|
373 |
|
|
374 |
/**
|
|
375 |
* @brief Dynamic Threads APIs.
|
|
|