Merge pull request #4134 from atomiclama/bf_CSInitialise
[betaflight.git] / make / source.mk
blobbc6c3e49132dd6424592ee00a73bb1c292b9d1d7
1 COMMON_SRC = \
2 build/build_config.c \
3 build/debug.c \
4 build/version.c \
5 $(TARGET_DIR_SRC) \
6 main.c \
7 common/bitarray.c \
8 common/crc.c \
9 common/encoding.c \
10 common/filter.c \
11 common/huffman.c \
12 common/huffman_table.c \
13 common/maths.c \
14 common/printf.c \
15 common/streambuf.c \
16 common/typeconversion.c \
17 config/config_eeprom.c \
18 config/feature.c \
19 config/parameter_group.c \
20 config/config_streamer.c \
21 drivers/adc.c \
22 drivers/buf_writer.c \
23 drivers/bus.c \
24 drivers/bus_i2c_config.c \
25 drivers/bus_i2c_busdev.c \
26 drivers/bus_i2c_soft.c \
27 drivers/bus_spi.c \
28 drivers/bus_spi_config.c \
29 drivers/bus_spi_pinconfig.c \
30 drivers/bus_spi_soft.c \
31 drivers/buttons.c \
32 drivers/display.c \
33 drivers/exti.c \
34 drivers/io.c \
35 drivers/light_led.c \
36 drivers/resource.c \
37 drivers/rcc.c \
38 drivers/serial.c \
39 drivers/serial_pinconfig.c \
40 drivers/serial_uart.c \
41 drivers/serial_uart_pinconfig.c \
42 drivers/sound_beeper.c \
43 drivers/stack_check.c \
44 drivers/system.c \
45 drivers/timer.c \
46 drivers/transponder_ir.c \
47 drivers/transponder_ir_arcitimer.c \
48 drivers/transponder_ir_ilap.c \
49 drivers/transponder_ir_erlt.c \
50 fc/config.c \
51 fc/fc_dispatch.c \
52 fc/fc_hardfaults.c \
53 fc/fc_msp.c \
54 fc/fc_msp_box.c \
55 fc/fc_tasks.c \
56 fc/runtime_config.c \
57 io/beeper.c \
58 io/serial.c \
59 io/statusindicator.c \
60 io/transponder_ir.c \
61 io/rcsplit.c \
62 msp/msp_serial.c \
63 scheduler/scheduler.c \
64 sensors/battery.c \
65 sensors/current.c \
66 sensors/voltage.c \
68 OSD_SLAVE_SRC = \
69 io/displayport_max7456.c \
70 osd_slave/osd_slave_init.c \
71 io/osd_slave.c
73 FC_SRC = \
74 fc/fc_init.c \
75 fc/controlrate_profile.c \
76 drivers/camera_control.c \
77 drivers/gyro_sync.c \
78 drivers/rx_nrf24l01.c \
79 drivers/rx_spi.c \
80 drivers/rx_xn297.c \
81 drivers/pwm_esc_detect.c \
82 drivers/pwm_output.c \
83 drivers/rx_pwm.c \
84 drivers/serial_softserial.c \
85 fc/fc_core.c \
86 fc/fc_rc.c \
87 fc/rc_adjustments.c \
88 fc/rc_controls.c \
89 fc/rc_modes.c \
90 fc/cli.c \
91 fc/settings.c \
92 flight/altitude.c \
93 flight/failsafe.c \
94 flight/imu.c \
95 flight/mixer.c \
96 flight/pid.c \
97 flight/servos.c \
98 io/serial_4way.c \
99 io/serial_4way_avrootloader.c \
100 io/serial_4way_stk500v2.c \
101 rx/ibus.c \
102 rx/jetiexbus.c \
103 rx/msp.c \
104 rx/nrf24_cx10.c \
105 rx/nrf24_inav.c \
106 rx/nrf24_h8_3d.c \
107 rx/nrf24_syma.c \
108 rx/nrf24_v202.c \
109 rx/pwm.c \
110 rx/rx.c \
111 rx/rx_spi.c \
112 rx/crsf.c \
113 rx/sbus.c \
114 rx/spektrum.c \
115 rx/sumd.c \
116 rx/sumh.c \
117 rx/xbus.c \
118 sensors/acceleration.c \
119 sensors/boardalignment.c \
120 sensors/compass.c \
121 sensors/gyro.c \
122 sensors/gyroanalyse.c \
123 sensors/initialisation.c \
124 blackbox/blackbox.c \
125 blackbox/blackbox_encoding.c \
126 blackbox/blackbox_io.c \
127 cms/cms.c \
128 cms/cms_menu_blackbox.c \
129 cms/cms_menu_builtin.c \
130 cms/cms_menu_imu.c \
131 cms/cms_menu_ledstrip.c \
132 cms/cms_menu_misc.c \
133 cms/cms_menu_osd.c \
134 cms/cms_menu_vtx_rtc6705.c \
135 cms/cms_menu_vtx_smartaudio.c \
136 cms/cms_menu_vtx_tramp.c \
137 common/colorconversion.c \
138 common/gps_conversion.c \
139 drivers/display_ug2864hsweg01.c \
140 drivers/light_ws2811strip.c \
141 drivers/serial_escserial.c \
142 drivers/sonar_hcsr04.c \
143 drivers/vtx_common.c \
144 flight/navigation.c \
145 io/dashboard.c \
146 io/displayport_max7456.c \
147 io/displayport_msp.c \
148 io/displayport_oled.c \
149 io/gps.c \
150 io/ledstrip.c \
151 io/osd.c \
152 sensors/sonar.c \
153 sensors/barometer.c \
154 telemetry/telemetry.c \
155 telemetry/crsf.c \
156 telemetry/srxl.c \
157 telemetry/frsky.c \
158 telemetry/hott.c \
159 telemetry/smartport.c \
160 telemetry/ltm.c \
161 telemetry/mavlink.c \
162 telemetry/msp_shared.c \
163 telemetry/ibus.c \
164 telemetry/ibus_shared.c \
165 sensors/esc_sensor.c \
166 io/vtx_string.c \
167 io/vtx_rtc6705.c \
168 io/vtx_smartaudio.c \
169 io/vtx_tramp.c \
170 io/vtx_control.c
172 COMMON_DEVICE_SRC = \
173 $(CMSIS_SRC) \
174 $(DEVICE_STDPERIPH_SRC)
176 ifeq ($(OSD_SLAVE),yes)
177 TARGET_FLAGS := -DUSE_OSD_SLAVE $(TARGET_FLAGS)
178 COMMON_SRC := $(COMMON_SRC) $(OSD_SLAVE_SRC) $(COMMON_DEVICE_SRC)
179 else
180 COMMON_SRC := $(COMMON_SRC) $(FC_SRC) $(COMMON_DEVICE_SRC)
181 endif
184 SPEED_OPTIMISED_SRC := ""
185 SIZE_OPTIMISED_SRC := ""
187 ifneq ($(TARGET),$(filter $(TARGET),$(F1_TARGETS)))
188 SPEED_OPTIMISED_SRC := $(SPEED_OPTIMISED_SRC) \
189 common/encoding.c \
190 common/filter.c \
191 common/maths.c \
192 common/typeconversion.c \
193 drivers/adc.c \
194 drivers/buf_writer.c \
195 drivers/bus.c \
196 drivers/bus_spi.c \
197 drivers/exti.c \
198 drivers/io.c \
199 drivers/pwm_output.c \
200 drivers/rcc.c \
201 drivers/serial.c \
202 drivers/serial_uart.c \
203 drivers/system.c \
204 drivers/timer.c \
205 fc/fc_core.c \
206 fc/fc_tasks.c \
207 fc/fc_rc.c \
208 fc/rc_controls.c \
209 fc/runtime_config.c \
210 flight/imu.c \
211 flight/mixer.c \
212 flight/pid.c \
213 io/serial.c \
214 rx/ibus.c \
215 rx/rx.c \
216 rx/rx_spi.c \
217 rx/crsf.c \
218 rx/sbus.c \
219 rx/spektrum.c \
220 rx/sumd.c \
221 rx/xbus.c \
222 scheduler/scheduler.c \
223 sensors/acceleration.c \
224 sensors/boardalignment.c \
225 sensors/gyro.c \
226 sensors/gyroanalyse.c \
227 $(CMSIS_SRC) \
228 $(DEVICE_STDPERIPH_SRC) \
229 drivers/light_ws2811strip.c \
230 io/displayport_max7456.c \
231 io/osd.c \
232 io/osd_slave.c
234 SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
235 drivers/bus_i2c_config.c \
236 drivers/bus_spi_config.c \
237 drivers/bus_spi_pinconfig.c \
238 drivers/serial_escserial.c \
239 drivers/serial_pinconfig.c \
240 drivers/serial_uart_init.c \
241 drivers/serial_uart_pinconfig.c \
242 drivers/vtx_rtc6705_soft_spi.c \
243 drivers/vtx_rtc6705.c \
244 drivers/vtx_common.c \
245 fc/fc_init.c \
246 fc/cli.c \
247 fc/settings.c \
248 config/config_eeprom.c \
249 config/feature.c \
250 config/parameter_group.c \
251 config/config_streamer.c \
252 io/serial_4way.c \
253 io/serial_4way_avrootloader.c \
254 io/serial_4way_stk500v2.c \
255 io/dashboard.c \
256 msp/msp_serial.c \
257 cms/cms.c \
258 cms/cms_menu_blackbox.c \
259 cms/cms_menu_builtin.c \
260 cms/cms_menu_imu.c \
261 cms/cms_menu_ledstrip.c \
262 cms/cms_menu_misc.c \
263 cms/cms_menu_osd.c \
264 io/vtx_string.c \
265 io/vtx_rtc6705.c \
266 io/vtx_smartaudio.c \
267 io/vtx_tramp.c \
268 io/vtx_control.c
269 endif #!F1
271 # check if target.mk supplied
272 SRC := $(STARTUP_SRC) $(MCU_COMMON_SRC) $(TARGET_SRC) $(VARIANT_SRC)
274 ifneq ($(DSP_LIB),)
276 INCLUDE_DIRS += $(DSP_LIB)/Include
278 SRC += $(DSP_LIB)/Source/BasicMathFunctions/arm_mult_f32.c
279 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_rfft_fast_f32.c
280 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_cfft_f32.c
281 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_rfft_fast_init_f32.c
282 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_cfft_radix8_f32.c
283 SRC += $(DSP_LIB)/Source/CommonTables/arm_common_tables.c
285 SRC += $(DSP_LIB)/Source/ComplexMathFunctions/arm_cmplx_mag_f32.c
286 SRC += $(DSP_LIB)/Source/StatisticsFunctions/arm_max_f32.c
288 SRC += $(wildcard $(DSP_LIB)/Source/*/*.S)
289 endif
291 ifneq ($(filter ONBOARDFLASH,$(FEATURES)),)
292 SRC += \
293 drivers/flash_m25p16.c \
294 io/flashfs.c
295 endif
297 SRC += $(COMMON_SRC)
299 #excludes
300 SRC := $(filter-out ${MCU_EXCLUDES}, $(SRC))
302 ifneq ($(filter SDCARD,$(FEATURES)),)
303 SRC += \
304 drivers/sdcard.c \
305 drivers/sdcard_standard.c \
306 io/asyncfatfs/asyncfatfs.c \
307 io/asyncfatfs/fat_standard.c
308 endif
310 ifneq ($(filter VCP,$(FEATURES)),)
311 SRC += $(VCP_SRC)
312 endif
313 # end target specific make file checks
315 # Search path and source files for the ST stdperiph library
316 VPATH := $(VPATH):$(STDPERIPH_DIR)/src