Revision 5b0a8e7b

View differences:

modules/DiWheelDrive_1-1/Makefile
1
################################################################################
2
# AMiRo-OS is an operating system designed for the Autonomous Mini Robot       #
3
# (AMiRo) platform.                                                            #
4
# Copyright (C) 2016..2018  Thomas Schöpping et al.                            #
5
#                                                                              #
6
# This program is free software: you can redistribute it and/or modify         #
7
# it under the terms of the GNU General Public License as published by         #
8
# the Free Software Foundation, either version 3 of the License, or            #
9
# (at your option) any later version.                                          #
10
#                                                                              #
11
# This program is distributed in the hope that it will be useful,              #
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
14
# GNU General Public License for more details.                                 #
15
#                                                                              #
16
# You should have received a copy of the GNU General Public License            #
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
18
#                                                                              #
19
# This research/work was supported by the Cluster of Excellence Cognitive      #
20
# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
21
# funded by the German Research Foundation (DFG).                              #
22
################################################################################
23

  
24

  
25

  
26
################################################################################
27
# Build global options                                                         #
28
# NOTE: Can be overridden externally.                                          #
29
#                                                                              #
30

  
31
# Compiler options here.
32
ifeq ($(USE_OPT),)
33
  USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16 -fstack-usage
34
endif
35

  
36
# C specific options here (added to USE_OPT).
37
ifeq ($(USE_COPT),)
38
  USE_COPT = -std=c11
39
endif
40

  
41
# C++ specific options here (added to USE_OPT).
42
ifeq ($(USE_CPPOPT),)
43
  USE_CPPOPT = -fno-rtti -std=c++17
44
endif
45

  
46
# Enable this if you want the linker to remove unused code and data
47
ifeq ($(USE_LINK_GC),)
48
  USE_LINK_GC = yes
49
endif
50

  
51
# Linker extra options here.
52
ifeq ($(USE_LDOPT),)
53
  USE_LDOPT =
54
endif
55

  
56
# Enable this if you want link time optimizations (LTO)
57
ifeq ($(USE_LTO),)
58
  USE_LTO = yes
59
endif
60

  
61
# If enabled, this option allows to compile the application in THUMB mode.
62
ifeq ($(USE_THUMB),)
63
  USE_THUMB = yes
64
endif
65

  
66
# Enable this if you want to see the full log while compiling.
67
ifeq ($(USE_VERBOSE_COMPILE),)
68
  USE_VERBOSE_COMPILE = no
69
endif
70

  
71
# If enabled, this option makes the build process faster by not compiling
72
# modules not used in the current configuration.
73
ifeq ($(USE_SMART_BUILD),)
74
  USE_SMART_BUILD = no
75
endif
76

  
77
#                                                                              #
78
# Build global options                                                         #
79
################################################################################
80

  
81
################################################################################
82
# Architecture or project specific options                                     #
83
#                                                                              #
84

  
85
# Stack size to be allocated to the Cortex-M process stack. This stack is
86
# the stack used by the main() thread.
87
ifeq ($(USE_PROCESS_STACKSIZE),)
88
  USE_PROCESS_STACKSIZE = 0x400
89
endif
90

  
91
# Stack size to the allocated to the Cortex-M main/exceptions stack. This
92
# stack is used for processing interrupts and exceptions.
93
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
94
  USE_EXCEPTIONS_STACKSIZE = 0x400
95
endif
96

  
97
# Enables the use of FPU on Cortex-M4.
98
# Possible selections are:
99
#   no     - no FPU is used (probably equals 'soft')
100
#   soft   - does not use the FPU, thus all floating point operations are emulated
101
#   softfp - uses the FPU, but uses the integer registers only
102
#   hard   - uses the FPU and passes data via the FPU registers
103
ifeq ($(USE_FPU),)
104
  USE_FPU = no
105
endif
106

  
107
#                                                                              #
108
# Architecture or project specific options                                     #
109
################################################################################
110

  
111
################################################################################
112
# Project, sources and paths                                                   #
113
#                                                                              #
114

  
115
# Define project name here
116
PROJECT := $(patsubst $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))..)/%,%,$(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
117

  
118
# Imported source files and paths
119
include ../../../kernel/kernel.mk
120
CHIBIOS := $(AMIROOS_KERNEL)
121
AMIROOS = ../..
122
# Startup files
123
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
124
# HAL-OSAL files
125
include $(CHIBIOS)/os/hal/hal.mk
126
include $(AMIROOS)/hal/hal.mk
127
include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
128
include $(AMIROOS)/hal/ports/STM32/platform.mk
129
include ./board.mk
130
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
131
# RTOS files
132
include $(CHIBIOS)/os/rt/rt.mk
133
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
134
# Other files (optional).
135
include $(CHIBIOS)/test/rt/test.mk
136
# AMiRo-BLT files
137
include ../../../bootloader/bootloader.mk
138
# AMiRo-LLD files
139
include ../../../periphery-lld/periphery-lld.mk
140
# AMiRo-OS files
141
include $(AMIROOS)/modules/modules.mk
142
include $(AMIROOS)/core/core.mk
143
include $(AMIROOS)/unittests/unittests.mk
144

  
145
# Define linker script file here
146
LDSCRIPT= $(BOARDLD)/STM32F103xE.ld
147

  
148
# C sources that can be compiled in ARM or THUMB mode depending on the global
149
# setting.
150
CSRC = $(STARTUPSRC) \
151
       $(KERNSRC) \
152
       $(PORTSRC) \
153
       $(OSALSRC) \
154
       $(HALSRC) \
155
       $(PLATFORMSRC) \
156
       $(BOARDSRC) \
157
       $(MODULESCSRC) \
158
       $(TESTSRC) \
159
       $(PERIPHERYLLDCSRC) \
160
       $(AMIROOSCORECSRC) \
161
       $(UNITTESTSCSRC) \
162
       $(CHIBIOS)/os/various/evtimer.c \
163
       $(CHIBIOS)/os/various/syscalls.c \
164
       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
165
       module.c \
166
       $(APPSCSRC)
167

  
168
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
169
# setting.
170
CPPSRC = $(AMIROOSCORECPPSRC) \
171
         $(APPSCPPSRC)
172

  
173
# C sources to be compiled in ARM mode regardless of the global setting.
174
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
175
#       option that results in lower performance and larger code size.
176
ACSRC = $(APPSACSRC)
177

  
178
# C++ sources to be compiled in ARM mode regardless of the global setting.
179
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
180
#       option that results in lower performance and larger code size.
181
ACPPSRC = $(APPSACPPSRC)
182

  
183
# C sources to be compiled in THUMB mode regardless of the global setting.
184
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
185
#       option that results in lower performance and larger code size.
186
TCSRC = $(APPSTCSRC)
187

  
188
# C sources to be compiled in THUMB mode regardless of the global setting.
189
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
190
#       option that results in lower performance and larger code size.
191
TCPPSRC = $(APPSTCPPSRC)
192

  
193
# List ASM source files here
194
ASMSRC = $(APPSASMSRC)
195
ASMXSRC = $(STARTUPASM) \
196
          $(PORTASM) \
197
          $(OSALASM) \
198
          $(APPSASMXSRC)
199

  
200
INCDIR = $(CHIBIOS)/os/license \
201
         $(STARTUPINC) \
202
         $(KERNINC) \
203
         $(PORTINC) \
204
         $(OSALINC) \
205
         $(HALINC) \
206
         $(PLATFORMINC) \
207
         $(BOARDINC) \
208
         $(MODULESINC) \
209
         $(TESTINC) \
210
         $(BOOTLOADERINC) \
211
         $(CHIBIOS)/os/hal/lib/streams \
212
         $(CHIBIOS)/os/various \
213
         $(PERIPHERYLLDINC) \
214
         $(AMIROOS) \
215
         $(AMIROOSCOREINC) \
216
         $(UNITTESTSINC) \
217
         $(APPSINC)
218

  
219
#                                                                              #
220
# Project, sources and paths                                                   #
221
################################################################################
222

  
223
################################################################################
224
# Compiler settings                                                            #
225
# NOTE: Some can be overridden externally.                                     #
226
#                                                                              #
227

  
228
MCU  = cortex-m3
229

  
230
#TRGT = arm-elf-
231
TRGT = arm-none-eabi-
232
CC   = $(TRGT)gcc
233
CPPC = $(TRGT)g++
234
# Enable loading with g++ only if you need C++ runtime support.
235
# NOTE: You can use C++ even without C++ support if you are careful. C++
236
#       runtime support makes code size explode.
237
LD   = $(TRGT)gcc
238
#LD   = $(TRGT)g++
239
CP   = $(TRGT)objcopy
240
AS   = $(TRGT)gcc -x assembler-with-cpp
241
AR   = $(TRGT)ar
242
OD   = $(TRGT)objdump
243
SZ   = $(TRGT)size
244
HEX  = $(CP) -O ihex
245
BIN  = $(CP) -O binary
246
SREC = $(CP) -O srec --srec-len=248
247

  
248
# ARM-specific options here
249
ifeq ($(AOPT),)
250
  AOPT =
251
endif
252

  
253
# THUMB-specific options here
254
ifeq ($(TOPT),)
255
  TOPT = -mthumb -DTHUMB
256
endif
257

  
258
# Define C warning options here
259
ifeq ($(CWARN),)
260
  CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
261
endif
262

  
263
# Define C++ warning options here
264
ifeq ($(CPPWARN),)
265
  CPPWARN = -Wall -Wextra -Wundef
266
endif
267

  
268
#                                                                              #
269
# Compiler settings                                                            #
270
################################################################################
271

  
272
################################################################################
273
# Start of user section                                                        #
274
#                                                                              #
275

  
276
# List all user C define here, like -D_DEBUG=1
277
UDEFS +=
278

  
279
# Define ASM defines here
280
UADEFS +=
281

  
282
# List all user directories here
283
UINCDIR +=
284

  
285
# List the user directory to look for the libraries here
286
ULIBDIR +=
287

  
288
# List all user libraries here
289
ULIBS +=
290

  
291
#                                                                              #
292
# End of user defines                                                          #
293
################################################################################
294

  
295
# allow for custom build directory
296
ifneq ($(BUILDDIR),)
297
  BUILDDIR := $(BUILDDIR)/$(PROJECT)
298
endif
299

  
300
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
301
include $(RULESPATH)/rules.mk
302

  
303
include $(AMIROOS)/modules/flash.mk
modules/DiWheelDrive_1-1/alldconf.h
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
#ifndef _ALLDCONF_H_
20
#define _ALLDCONF_H_
21

  
22
/*
23
 * compatibility guards
24
 */
25
#define _AMIRO_LLD_CFG_
26
#define AMIRO_LLD_CFG_VERSION_MAJOR         1
27
#define AMIRO_LLD_CFG_VERSION_MINOR         0
28

  
29
/**
30
 * @brief   Enable flag for the A3906 motor driver.
31
 */
32
#define AMIROLLD_CFG_USE_A3906
33

  
34
/**
35
 * @brief   Enable flag for the AT24C01BN-SH-B EEPROM.
36
 */
37
#define AMIROLLD_CFG_USE_AT24C01BN
38

  
39
/**
40
 * @brief   Enable flag for the MHC5883L compass.
41
 */
42
#define AMIROLLD_CFG_USE_HMC5883L
43

  
44
/**
45
 * @brief   Enable flag for the INA219 power monitor.
46
 */
47
#define AMIROLLD_CFG_USE_INA219
48

  
49
/**
50
 * @brief   Enable flag for the L3G4200D gyroscope.
51
 */
52
#define AMIROLLD_CFG_USE_L3G4200D
53

  
54
/**
55
 * @brief   Enable flag for the status LED.
56
 */
57
#define AMIROLLD_CFG_USE_LED
58

  
59
/**
60
 * @brief   Enable flag for the LIS331DLH accelerometer.
61
 */
62
#define AMIROLLD_CFG_USE_LIS331DLH
63

  
64
/**
65
 * @brief   Enable flag for the LTC4412 power path controller.
66
 */
67
#define AMIROLLD_CFG_USE_LTC4412
68

  
69
/**
70
 * @brief   Enable flag for the PCA9544A I2C multiplexer.
71
 */
72
#define AMIROLLD_CFG_USE_PCA9544A
73

  
74
/**
75
 * @brief   Enable flag for the TPS62113 step-down converter.
76
 */
77
#define AMIROLLD_CFG_USE_TPS62113
78

  
79
/**
80
 * @brief   Enable flag for the VCNL4020 proximity sensor.
81
 */
82
#define AMIROLLD_CFG_USE_VCNL4020
83

  
84
#endif /* _ALLDCONF_H_ */
modules/DiWheelDrive_1-1/aosconf.h
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
#ifndef _AOSCONF_H_
20
#define _AOSCONF_H_
21

  
22
/*
23
 * compatibility guards
24
 */
25
#define _AMIRO_OS_CFG_
26
#define _AMIRO_OS_CFG_VERSION_MAJOR_            2
27
#define _AMIRO_OS_CFG_VERSION_MINOR_            0
28

  
29
#include <stdbool.h>
30

  
31
/*===========================================================================*/
32
/**
33
 * @name Kernel parameters and options
34
 * @{
35
 */
36
/*===========================================================================*/
37

  
38
/*
39
 * Include an external configuration file to override the following default settings only if required.
40
 */
41
#if defined(AMIRO_APPS) && (AMIRO_APPS == true)
42
  #include <osconf.h>
43
#endif
44

  
45
/**
46
 * @brief   Flag to set the module as SSSP master.
47
 */
48
#if !defined(OS_CFG_SSSP_MASTER)
49
  #define AMIROOS_CFG_SSSP_MASTER               false
50
#else
51
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
52
#endif
53

  
54
/**
55
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
56
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
57
 *          All modules need to align their local uptime to the nearest multiple of this value.
58
 */
59
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
60
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
61
#else
62
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
63
#endif
64

  
65
/**
66
 * @brief   Flag to enable/disable debug API.
67
 */
68
#if !defined(OS_CFG_DBG)
69
  #define AMIROOS_CFG_DBG                       true
70
#else
71
  #define AMIROOS_CFG_DBG                       OS_CFG_DBG
72
#endif
73

  
74
/**
75
 * @brief   Flag to enable/disable unit tests.
76
 */
77
#if !defined(OS_CFG_TESTS_ENABLE)
78
  #define AMIROOS_CFG_TESTS_ENABLE              true
79
#else
80
  #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
81
#endif
82

  
83
/**
84
 * @brief   Flag to enable/disable profiling API.
85
 */
86
#if !defined(O