[I2C] Introduce computational I2C waveform configuration for HAL based MCUs
[betaflight.git] / make / source.mk
blobabc8b833dd2003c470a8c2a7707c7fe4fd66eaf6
1 COMMON_SRC = \
2 build/build_config.c \
3 build/debug.c \
4 build/debug_pin.c \
5 build/version.c \
6 $(TARGET_DIR_SRC) \
7 main.c \
8 $(addprefix pg/, $(notdir $(wildcard $(SRC_DIR)/pg/*.c))) \
9 $(addprefix common/,$(notdir $(wildcard $(SRC_DIR)/common/*.c))) \
10 $(addprefix config/,$(notdir $(wildcard $(SRC_DIR)/config/*.c))) \
11 cli/cli.c \
12 cli/settings.c \
13 config/config.c \
14 drivers/adc.c \
15 drivers/dshot.c \
16 drivers/dshot_dpwm.c \
17 drivers/dshot_command.c \
18 drivers/buf_writer.c \
19 drivers/bus.c \
20 drivers/bus_i2c_config.c \
21 drivers/bus_i2c_busdev.c \
22 drivers/bus_i2c_soft.c \
23 drivers/bus_quadspi.c \
24 drivers/bus_spi.c \
25 drivers/bus_spi_config.c \
26 drivers/bus_spi_pinconfig.c \
27 drivers/buttons.c \
28 drivers/display.c \
29 drivers/display_canvas.c \
30 drivers/dma_reqmap.c \
31 drivers/exti.c \
32 drivers/io.c \
33 drivers/light_led.c \
34 drivers/mco.c \
35 drivers/motor.c \
36 drivers/pinio.c \
37 drivers/pin_pull_up_down.c \
38 drivers/resource.c \
39 drivers/rcc.c \
40 drivers/serial.c \
41 drivers/serial_pinconfig.c \
42 drivers/serial_uart.c \
43 drivers/serial_uart_pinconfig.c \
44 drivers/sound_beeper.c \
45 drivers/stack_check.c \
46 drivers/system.c \
47 drivers/timer_common.c \
48 drivers/timer.c \
49 drivers/transponder_ir_arcitimer.c \
50 drivers/transponder_ir_ilap.c \
51 drivers/transponder_ir_erlt.c \
52 fc/board_info.c \
53 fc/dispatch.c \
54 fc/hardfaults.c \
55 fc/tasks.c \
56 fc/runtime_config.c \
57 fc/stats.c \
58 io/beeper.c \
59 io/piniobox.c \
60 io/serial.c \
61 io/smartaudio_protocol.c \
62 io/statusindicator.c \
63 io/tramp_protocol.c \
64 io/transponder_ir.c \
65 io/usb_cdc_hid.c \
66 io/usb_msc.c \
67 msp/msp.c \
68 msp/msp_box.c \
69 msp/msp_serial.c \
70 scheduler/scheduler.c \
71 sensors/adcinternal.c \
72 sensors/battery.c \
73 sensors/current.c \
74 sensors/voltage.c \
75 target/config_helper.c \
76 fc/init.c \
77 fc/controlrate_profile.c \
78 drivers/camera_control.c \
79 drivers/accgyro/gyro_sync.c \
80 drivers/pwm_esc_detect.c \
81 drivers/pwm_output.c \
82 drivers/rx/rx_spi.c \
83 drivers/rx/rx_xn297.c \
84 drivers/rx/rx_pwm.c \
85 drivers/serial_softserial.c \
86 fc/core.c \
87 fc/rc.c \
88 fc/rc_adjustments.c \
89 fc/rc_controls.c \
90 fc/rc_modes.c \
91 flight/position.c \
92 flight/failsafe.c \
93 flight/gps_rescue.c \
94 flight/gyroanalyse.c \
95 flight/imu.c \
96 flight/interpolated_setpoint.c \
97 flight/mixer.c \
98 flight/mixer_tricopter.c \
99 flight/pid.c \
100 flight/rpm_filter.c \
101 flight/servos.c \
102 flight/servos_tricopter.c \
103 io/serial_4way.c \
104 io/serial_4way_avrootloader.c \
105 io/serial_4way_stk500v2.c \
106 rx/ibus.c \
107 rx/jetiexbus.c \
108 rx/msp.c \
109 rx/pwm.c \
110 rx/rx.c \
111 rx/rx_bind.c \
112 rx/rx_spi.c \
113 rx/rx_spi_common.c \
114 rx/crsf.c \
115 rx/sbus.c \
116 rx/sbus_channels.c \
117 rx/spektrum.c \
118 rx/srxl2.c \
119 io/spektrum_vtx_control.c \
120 io/spektrum_rssi.c \
121 rx/sumd.c \
122 rx/sumh.c \
123 rx/xbus.c \
124 rx/fport.c \
125 sensors/acceleration.c \
126 sensors/boardalignment.c \
127 sensors/compass.c \
128 sensors/gyro.c \
129 sensors/initialisation.c \
130 blackbox/blackbox.c \
131 blackbox/blackbox_encoding.c \
132 blackbox/blackbox_io.c \
133 cms/cms.c \
134 cms/cms_menu_blackbox.c \
135 cms/cms_menu_failsafe.c \
136 cms/cms_menu_firmware.c \
137 cms/cms_menu_gps_rescue.c\
138 cms/cms_menu_imu.c \
139 cms/cms_menu_ledstrip.c \
140 cms/cms_menu_main.c \
141 cms/cms_menu_misc.c \
142 cms/cms_menu_osd.c \
143 cms/cms_menu_power.c \
144 cms/cms_menu_saveexit.c \
145 cms/cms_menu_vtx_common.c \
146 cms/cms_menu_vtx_rtc6705.c \
147 cms/cms_menu_vtx_smartaudio.c \
148 cms/cms_menu_vtx_tramp.c \
149 drivers/display_ug2864hsweg01.c \
150 drivers/light_ws2811strip.c \
151 drivers/rangefinder/rangefinder_hcsr04.c \
152 drivers/rangefinder/rangefinder_lidartf.c \
153 drivers/serial_escserial.c \
154 drivers/vtx_common.c \
155 drivers/vtx_table.c \
156 io/dashboard.c \
157 io/displayport_frsky_osd.c \
158 io/displayport_max7456.c \
159 io/displayport_msp.c \
160 io/displayport_oled.c \
161 io/displayport_srxl.c \
162 io/displayport_crsf.c \
163 io/displayport_hott.c \
164 io/frsky_osd.c \
165 io/rcdevice_cam.c \
166 io/rcdevice.c \
167 io/gps.c \
168 io/ledstrip.c \
169 io/pidaudio.c \
170 osd/osd.c \
171 osd/osd_elements.c \
172 sensors/barometer.c \
173 sensors/rangefinder.c \
174 telemetry/telemetry.c \
175 telemetry/crsf.c \
176 telemetry/srxl.c \
177 telemetry/frsky_hub.c \
178 telemetry/hott.c \
179 telemetry/jetiexbus.c \
180 telemetry/smartport.c \
181 telemetry/ltm.c \
182 telemetry/mavlink.c \
183 telemetry/msp_shared.c \
184 telemetry/ibus.c \
185 telemetry/ibus_shared.c \
186 sensors/esc_sensor.c \
187 io/vtx.c \
188 io/vtx_rtc6705.c \
189 io/vtx_smartaudio.c \
190 io/vtx_tramp.c \
191 io/vtx_control.c \
192 ./lib/main/BoschSensortec/BMI270-Sensor-API/bmi270.c
194 COMMON_DEVICE_SRC = \
195 $(CMSIS_SRC) \
196 $(DEVICE_STDPERIPH_SRC)
198 COMMON_SRC := $(COMMON_SRC) $(COMMON_DEVICE_SRC)
200 ifeq ($(EXST),yes)
201 TARGET_FLAGS := -DUSE_EXST $(TARGET_FLAGS)
202 endif
204 ifeq ($(RAM_BASED),yes)
205 TARGET_FLAGS := -DUSE_EXST -DCONFIG_IN_RAM -DRAMBASED $(TARGET_FLAGS)
206 endif
208 ifeq ($(SIMULATOR_BUILD),yes)
209 TARGET_FLAGS := -DSIMULATOR_BUILD $(TARGET_FLAGS)
210 endif
212 SPEED_OPTIMISED_SRC := ""
213 SIZE_OPTIMISED_SRC := ""
215 ifneq ($(TARGET),$(filter $(TARGET),$(F1_TARGETS)))
216 SPEED_OPTIMISED_SRC := $(SPEED_OPTIMISED_SRC) \
217 common/encoding.c \
218 common/filter.c \
219 common/maths.c \
220 common/typeconversion.c \
221 drivers/accgyro/accgyro_fake.c \
222 drivers/accgyro/accgyro_mpu.c \
223 drivers/accgyro/accgyro_mpu3050.c \
224 drivers/accgyro/accgyro_mpu6050.c \
225 drivers/accgyro/accgyro_mpu6500.c \
226 drivers/accgyro/accgyro_spi_bmi160.c \
227 drivers/accgyro/accgyro_spi_icm20689.c \
228 drivers/accgyro/accgyro_spi_mpu6000.c \
229 drivers/accgyro/accgyro_spi_mpu6500.c \
230 drivers/accgyro/accgyro_spi_mpu9250.c \
231 drivers/accgyro_legacy/accgyro_adxl345.c \
232 drivers/accgyro_legacy/accgyro_bma280.c \
233 drivers/accgyro_legacy/accgyro_l3g4200d.c \
234 drivers/accgyro_legacy/accgyro_l3gd20.c \
235 drivers/accgyro_legacy/accgyro_lsm303dlhc.c \
236 drivers/accgyro_legacy/accgyro_mma845x.c \
237 drivers/adc.c \
238 drivers/buf_writer.c \
239 drivers/bus.c \
240 drivers/bus_quadspi.c \
241 drivers/bus_spi.c \
242 drivers/exti.c \
243 drivers/io.c \
244 drivers/pwm_output.c \
245 drivers/rcc.c \
246 drivers/serial.c \
247 drivers/serial_uart.c \
248 drivers/system.c \
249 drivers/timer.c \
250 fc/core.c \
251 fc/tasks.c \
252 fc/rc.c \
253 fc/rc_controls.c \
254 fc/runtime_config.c \
255 flight/gyroanalyse.c \
256 flight/imu.c \
257 flight/mixer.c \
258 flight/pid.c \
259 flight/rpm_filter.c \
260 rx/ibus.c \
261 rx/rx.c \
262 rx/rx_spi.c \
263 rx/crsf.c \
264 rx/sbus.c \
265 rx/sbus_channels.c \
266 rx/spektrum.c \
267 rx/srxl2.c \
268 rx/sumd.c \
269 rx/xbus.c \
270 rx/fport.c \
271 scheduler/scheduler.c \
272 sensors/acceleration.c \
273 sensors/boardalignment.c \
274 sensors/gyro.c \
275 $(CMSIS_SRC) \
276 $(DEVICE_STDPERIPH_SRC) \
278 SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
279 bus_bst_stm32f30x.c \
280 cli/cli.c \
281 cli/settings.c \
282 drivers/barometer/barometer_bmp085.c \
283 drivers/barometer/barometer_bmp280.c \
284 drivers/barometer/barometer_fake.c \
285 drivers/barometer/barometer_ms5611.c \
286 drivers/barometer/barometer_lps.c \
287 drivers/barometer/barometer_qmp6988.c \
288 drivers/bus_i2c_config.c \
289 drivers/bus_spi_config.c \
290 drivers/bus_spi_pinconfig.c \
291 drivers/compass/compass_ak8963.c \
292 drivers/compass/compass_ak8975.c \
293 drivers/compass/compass_fake.c \
294 drivers/compass/compass_hmc5883l.c \
295 drivers/compass/compass_qmc5883l.c \
296 drivers/compass/compass_lis3mdl.c \
297 drivers/display_ug2864hsweg01.c \
298 drivers/inverter.c \
299 drivers/light_ws2811strip.c \
300 drivers/light_ws2811strip_hal.c \
301 drivers/light_ws2811strip_stdperiph.c \
302 drivers/serial_escserial.c \
303 drivers/serial_pinconfig.c \
304 drivers/serial_tcp.c \
305 drivers/serial_uart_init.c \
306 drivers/serial_uart_pinconfig.c \
307 drivers/serial_usb_vcp.c \
308 drivers/transponder_ir_io_hal.c \
309 drivers/transponder_ir_io_stdperiph.c \
310 drivers/vtx_rtc6705_soft_spi.c \
311 drivers/vtx_rtc6705.c \
312 drivers/vtx_common.c \
313 fc/init.c \
314 fc/board_info.c \
315 config/config_eeprom.c \
316 config/feature.c \
317 config/config_streamer.c \
318 i2c_bst.c \
319 io/dashboard.c \
320 io/serial.c \
321 io/serial_4way.c \
322 io/serial_4way_avrootloader.c \
323 io/serial_4way_stk500v2.c \
324 io/transponder_ir.c \
325 io/usb_cdc_hid.c \
326 msp/msp_serial.c \
327 cms/cms.c \
328 cms/cms_menu_blackbox.c \
329 cms/cms_menu_failsafe.c \
330 cms/cms_menu_firmware.c \
331 cms/cms_menu_gps_rescue.c\
332 cms/cms_menu_imu.c \
333 cms/cms_menu_ledstrip.c \
334 cms/cms_menu_main.c \
335 cms/cms_menu_misc.c \
336 cms/cms_menu_osd.c \
337 cms/cms_menu_power.c \
338 cms/cms_menu_saveexit.c \
339 cms/cms_menu_vtx_common.c \
340 cms/cms_menu_vtx_rtc6705.c \
341 cms/cms_menu_vtx_smartaudio.c \
342 cms/cms_menu_vtx_tramp.c \
343 io/vtx.c \
344 io/vtx_rtc6705.c \
345 io/vtx_smartaudio.c \
346 io/vtx_tramp.c \
347 io/vtx_control.c \
348 io/spektrum_vtx_control.c \
349 osd/osd.c \
350 osd/osd_elements.c \
351 rx/rx_bind.c
353 # F4 and F7 optimizations
354 ifneq ($(TARGET),$(filter $(TARGET),$(F3_TARGETS)))
355 SPEED_OPTIMISED_SRC := $(SPEED_OPTIMISED_SRC) \
356 drivers/bus_i2c_hal.c \
357 drivers/bus_spi_ll.c \
358 drivers/max7456.c \
359 drivers/pwm_output_dshot.c \
360 drivers/pwm_output_dshot_shared.c \
361 drivers/pwm_output_dshot_hal.c
363 SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
364 drivers/bus_i2c_hal_init.c
365 endif #!F3
366 endif #!F1
368 # check if target.mk supplied
369 SRC := $(STARTUP_SRC) $(MCU_COMMON_SRC) $(TARGET_SRC) $(VARIANT_SRC)
371 # Files that should not be optimized, useful for debugging IMPRECISE cpu faults.
372 # Specify FULL PATH, e.g. "./lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_sdmmc.c"
373 NOT_OPTIMISED_SRC := $(NOT_OPTIMISED_SRC) \
375 ifneq ($(DSP_LIB),)
377 INCLUDE_DIRS += $(DSP_LIB)/Include
379 SRC += $(DSP_LIB)/Source/BasicMathFunctions/arm_mult_f32.c
380 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_rfft_fast_f32.c
381 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_cfft_f32.c
382 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_rfft_fast_init_f32.c
383 SRC += $(DSP_LIB)/Source/TransformFunctions/arm_cfft_radix8_f32.c
384 SRC += $(DSP_LIB)/Source/CommonTables/arm_common_tables.c
386 SRC += $(DSP_LIB)/Source/ComplexMathFunctions/arm_cmplx_mag_f32.c
387 SRC += $(DSP_LIB)/Source/StatisticsFunctions/arm_max_f32.c
389 SRC += $(wildcard $(DSP_LIB)/Source/*/*.S)
390 endif
392 ifneq ($(filter ONBOARDFLASH,$(FEATURES)),)
393 SRC += \
394 drivers/flash.c \
395 drivers/flash_m25p16.c \
396 drivers/flash_w25n01g.c \
397 drivers/flash_w25m.c \
398 io/flashfs.c \
399 $(MSC_SRC)
400 endif
402 SRC += $(COMMON_SRC)
404 #excludes
405 SRC := $(filter-out $(MCU_EXCLUDES), $(SRC))
407 ifneq ($(filter SDCARD_SPI,$(FEATURES)),)
408 SRC += \
409 drivers/sdcard.c \
410 drivers/sdcard_spi.c \
411 drivers/sdcard_standard.c \
412 io/asyncfatfs/asyncfatfs.c \
413 io/asyncfatfs/fat_standard.c \
414 $(MSC_SRC)
415 endif
417 ifneq ($(filter SDCARD_SDIO,$(FEATURES)),)
418 SRC += \
419 drivers/sdcard.c \
420 drivers/sdcard_sdio_baremetal.c \
421 drivers/sdcard_standard.c \
422 io/asyncfatfs/asyncfatfs.c \
423 io/asyncfatfs/fat_standard.c \
424 $(MSC_SRC)
425 endif
427 ifneq ($(filter VCP,$(FEATURES)),)
428 SRC += $(VCP_SRC)
429 endif
431 ifneq ($(filter MSC,$(FEATURES)),)
432 SRC += $(MSC_SRC)
433 endif
434 # end target specific make file checks
436 # Search path and source files for the ST stdperiph library
437 VPATH := $(VPATH):$(STDPERIPH_DIR)/src