Refactor debugType (#13866)
[betaflight.git] / mk / mcu / AT32F4.mk
blobbee194464452602d90fc226bffea8e828da339ad
2 # AT32F4 Make file include
5 CMSIS_DIR := $(ROOT)/lib/main/AT32F43x/cmsis
6 STDPERIPH_DIR = $(ROOT)/lib/main/AT32F43x/drivers
7 MIDDLEWARES_DIR = $(ROOT)/lib/main/AT32F43x/middlewares
8 STDPERIPH_SRC = \
9 at32f435_437_acc.c \
10 at32f435_437_adc.c \
11 at32f435_437_can.c \
12 at32f435_437_crc.c \
13 at32f435_437_crm.c \
14 at32f435_437_dac.c \
15 at32f435_437_debug.c \
16 at32f435_437_dma.c \
17 at32f435_437_dvp.c \
18 at32f435_437_edma.c \
19 at32f435_437_emac.c \
20 at32f435_437_ertc.c \
21 at32f435_437_exint.c \
22 at32f435_437_flash.c \
23 at32f435_437_gpio.c \
24 at32f435_437_i2c.c \
25 at32f435_437_misc.c \
26 at32f435_437_pwc.c \
27 at32f435_437_qspi.c \
28 at32f435_437_scfg.c \
29 at32f435_437_sdio.c \
30 at32f435_437_spi.c \
31 at32f435_437_tmr.c \
32 at32f435_437_usart.c \
33 at32f435_437_usb.c \
34 at32f435_437_wdt.c \
35 at32f435_437_wwdt.c \
36 at32f435_437_xmc.c \
37 usb_drivers/src/usb_core.c \
38 usb_drivers/src/usbd_core.c \
39 usb_drivers/src/usbd_int.c \
40 usb_drivers/src/usbd_sdr.c \
41 usb_drivers/src/usbh_core.c \
42 usb_drivers/src/usbh_ctrl.c \
43 usb_drivers/src/usbh_int.c \
44 usbd_class/msc/msc_bot_scsi.c \
45 usbd_class/msc/msc_class.c \
46 usbd_class/msc/msc_desc.c
48 STARTUP_SRC = at32/startup_at32f435_437.s
50 VPATH := $(VPATH):$(ROOT)/lib/main/AT32F43x/cmsis/cm4/core_support:$(STDPERIPH_DIR)/src:$(MIDDLEWARES_DIR):$(SRC_DIR)/startup/at32
52 VCP_SRC = \
53 usbd_class/cdc/cdc_class.c \
54 usbd_class/cdc/cdc_desc.c \
55 drivers/usb_io.c
57 VCP_INCLUDES = \
58 $(MIDDLEWARES_DIR)/usb_drivers/inc \
59 $(MIDDLEWARES_DIR)/usbd_class/cdc
61 DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
63 INCLUDE_DIRS := $(INCLUDE_DIRS) \
64 $(SRC_DIR)/startup/at32 \
65 $(SRC_DIR)/drivers \
66 $(SRC_DIR)/drivers/mcu/at32 \
67 $(STDPERIPH_DIR)/inc \
68 $(CMSIS_DIR)/cm4/core_support \
69 $(CMSIS_DIR)/cm4 \
70 $(MIDDLEWARES_DIR)/i2c_application_library \
71 $(MIDDLEWARES_DIR)/usbd_class/msc \
72 $(VCP_INCLUDES)
74 ifeq ($(TARGET),AT32F435M)
75 LD_SCRIPT = $(LINKER_DIR)/at32_flash_f43xm.ld
76 else
77 LD_SCRIPT = $(LINKER_DIR)/at32_flash_f43xg.ld
78 endif
80 ARCH_FLAGS = -std=c99 -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion
81 DEVICE_FLAGS += -DUSE_ATBSP_DRIVER -DAT32F43x -DHSE_VALUE=$(HSE_VALUE) -DAT32 -DUSE_OTG_HOST_MODE
83 MCU_COMMON_SRC = \
84 startup/at32/at32f435_437_clock.c \
85 startup/at32/system_at32f435_437.c \
86 drivers/mcu/at32/adc_at32f43x.c \
87 drivers/mcu/at32/bus_i2c_atbsp.c \
88 drivers/mcu/at32/bus_i2c_atbsp_init.c \
89 drivers/mcu/at32/bus_spi_at32bsp.c \
90 drivers/mcu/at32/camera_control.c \
91 drivers/mcu/at32/debug.c \
92 drivers/mcu/at32/dma_at32f43x.c \
93 drivers/mcu/at32/dma_reqmap_mcu.c \
94 drivers/mcu/at32/dshot_bitbang.c \
95 drivers/mcu/at32/dshot_bitbang_stdperiph.c \
96 drivers/mcu/at32/exti_at32.c \
97 drivers/mcu/at32/io_at32.c \
98 drivers/mcu/at32/light_ws2811strip_at32f43x.c \
99 drivers/mcu/at32/persistent_at32bsp.c \
100 drivers/mcu/at32/pwm_output_at32bsp.c \
101 drivers/mcu/at32/pwm_output_dshot.c \
102 drivers/mcu/at32/rcc_at32.c \
103 drivers/mcu/at32/serial_uart_at32bsp.c \
104 drivers/mcu/at32/serial_uart_at32f43x.c \
105 drivers/mcu/at32/serial_usb_vcp_at32f4.c \
106 drivers/mcu/at32/system_at32f43x.c \
107 drivers/mcu/at32/timer_at32bsp.c \
108 drivers/mcu/at32/timer_at32f43x.c \
109 drivers/mcu/at32/usb_msc_at32f43x.c \
110 drivers/accgyro/accgyro_mpu.c \
111 drivers/dshot_bitbang_decode.c \
112 drivers/inverter.c \
113 drivers/pwm_output_dshot_shared.c \
114 $(MIDDLEWARES_DIR)/i2c_application_library/i2c_application.c \
115 drivers/bus_i2c_timing.c \
116 drivers/usb_msc_common.c \
117 msc/usbd_storage.c \
118 msc/usbd_storage_emfat.c \
119 msc/emfat.c \
120 msc/emfat_file.c
122 MCU_EXCLUDES =