-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
rotorcraft.makefile
187 lines (145 loc) · 4.59 KB
/
rotorcraft.makefile
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
# Hey Emacs, this is a -*- makefile -*-
#
# Copyright (C) 2010 The Paparazzi Team
#
# This file is part of Paparazzi.
#
# Paparazzi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# Paparazzi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#
CFG_SHARED=$(PAPARAZZI_SRC)/conf/firmwares/subsystems/shared
CFG_ROTORCRAFT=$(PAPARAZZI_SRC)/conf/firmwares/subsystems/rotorcraft
SRC_BOARD=boards/$(BOARD)
SRC_FIRMWARE=firmwares/rotorcraft
SRC_SUBSYSTEMS=subsystems
SRC_MODULES=modules
SRC_EXT=$(PAPARAZZI_SRC)/sw/ext
SRC_ARCH=arch/$(ARCH)
ROTORCRAFT_INC = -I$(SRC_FIRMWARE) -I$(SRC_BOARD) -I$(SRC_EXT)
ap.ARCHDIR = $(ARCH)
######################################################################
##
## COMMON ROTORCRAFT ALL TARGETS (AP + NPS)
##
$(TARGET).CFLAGS += $(ROTORCRAFT_INC)
$(TARGET).CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
$(TARGET).CFLAGS += -DPERIPHERALS_AUTO_INIT
$(TARGET).srcs += mcu.c
$(TARGET).srcs += $(SRC_ARCH)/mcu_arch.c
# frequency of main periodic
PERIODIC_FREQUENCY ?= 512
$(TARGET).CFLAGS += -DPERIODIC_FREQUENCY=$(PERIODIC_FREQUENCY)
#
# Systime
#
$(TARGET).srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c
#
# Math functions
#
$(TARGET).srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c math/pprz_trig_int.c math/pprz_orientation_conversion.c math/pprz_algebra_int.c math/pprz_algebra_float.c math/pprz_algebra_double.c
$(TARGET).srcs += subsystems/settings.c
$(TARGET).srcs += $(SRC_ARCH)/subsystems/settings_arch.c
$(TARGET).srcs += subsystems/actuators.c
$(TARGET).srcs += subsystems/commands.c
$(TARGET).srcs += state.c
#
# BARO_BOARD (if existing/configured)
#
include $(CFG_SHARED)/baro_board.makefile
$(TARGET).srcs += $(SRC_FIRMWARE)/stabilization.c
$(TARGET).srcs += $(SRC_FIRMWARE)/stabilization/stabilization_none.c
$(TARGET).srcs += $(SRC_FIRMWARE)/stabilization/stabilization_rate.c
$(TARGET).srcs += $(SRC_FIRMWARE)/guidance/guidance_h.c
$(TARGET).srcs += $(SRC_FIRMWARE)/guidance/guidance_h_ref.c
$(TARGET).srcs += $(SRC_FIRMWARE)/guidance/guidance_v.c
$(TARGET).srcs += $(SRC_FIRMWARE)/guidance/guidance_v_ref.c
$(TARGET).srcs += $(SRC_FIRMWARE)/guidance/guidance_v_adapt.c
include $(CFG_ROTORCRAFT)/navigation.makefile
$(TARGET).srcs += $(SRC_FIRMWARE)/main.c
$(TARGET).srcs += $(SRC_FIRMWARE)/autopilot.c
######################################################################
##
## COMMON HARDWARE SUPPORT FOR ALL TARGETS
##
$(TARGET).srcs += mcu_periph/i2c.c
$(TARGET).srcs += $(SRC_ARCH)/mcu_periph/i2c_arch.c
#
# Electrical subsystem / Analog Backend
#
ifneq ($(ARCH), linux)
$(TARGET).CFLAGS += -DUSE_ADC
$(TARGET).srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
$(TARGET).srcs += subsystems/electrical.c
endif
######################################################################
##
## HARDWARE SUPPORT FOR ALL NON-SIMULATION TARGETS (ap)
##
# baro has variable offset amplifier on booz board
ifeq ($(BOARD), booz)
ns_CFLAGS += -DUSE_DAC
ns_srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c
else ifeq ($(BOARD)$(BOARD_TYPE), ardronesdk)
ns_srcs += $(SRC_BOARD)/electrical_dummy.c
else ifeq ($(BOARD)$(BOARD_TYPE), ardroneraw)
ns_srcs += $(SRC_BOARD)/electrical_raw.c
else ifeq ($(BOARD), bebop)
ns_srcs += $(SRC_BOARD)/electrical.c
endif
#
# Interrupts
#
ifeq ($(ARCH), lpc21)
ns_srcs += $(SRC_ARCH)/armVIC.c
endif
ifeq ($(ARCH), stm32)
ns_srcs += $(SRC_ARCH)/mcu_periph/gpio_arch.c
endif
#
# LEDs
#
ns_CFLAGS += -DUSE_LED
ifneq ($(SYS_TIME_LED),none)
ns_CFLAGS += -DSYS_TIME_LED=$(SYS_TIME_LED)
endif
ifeq ($(ARCH), stm32)
ns_srcs += $(SRC_ARCH)/led_hw.c
endif
ifeq ($(BOARD)$(BOARD_TYPE), ardroneraw)
ns_srcs += $(SRC_BOARD)/gpio_ardrone.c
endif
ns_srcs += mcu_periph/uart.c
ns_srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
ifeq ($(ARCH), linux)
ns_srcs += $(SRC_ARCH)/serial_port.c
endif
#
# add other subsystems to rotorcraft firmware in airframe file:
#
# telemetry
# radio_control
# actuators
# imu
# gps
# ahrs
# ins
#
######################################################################
##
## Final Target Allocations
##
ap.CFLAGS += $(ns_CFLAGS)
ap.srcs += $(ns_srcs)