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
|
# List of all the template platform files.
ifeq ($(USE_SMART_BUILD),yes)
# Configuration files directory
ifeq ($(CONFDIR),)
CONFDIR = .
endif
HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h | egrep -e "\#define"))
PLATFORMSRC := ${CHIBIOS}/os/hal/templates/hal_lld.c \
${CHIBIOS}/os/hal/templates/hal_st_lld.c
ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_adc_lld.c
endif
ifneq ($(findstring HAL_USE_CAN TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_can_lld.c
endif
ifneq ($(findstring HAL_USE_CRY TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_crypto_lld.c
endif
ifneq ($(findstring HAL_USE_DAC TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_dac_lld.c
endif
ifneq ($(findstring HAL_USE_EXT TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_ext_lld.c
endif
ifneq ($(findstring HAL_USE_GPT TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_gpt_lld.c
endif
ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_i2c_lld.c
endif
ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_i2s_lld.c
endif
ifneq ($(findstring HAL_USE_ICU TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_icu_lld.c
endif
ifneq ($(findstring HAL_USE_MAC TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_mac_lld.c
endif
ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_pal_lld.c
endif
ifneq ($(findstring HAL_USE_PWM TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_pwm_lld.c
endif
ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_rtc_lld.c
endif
ifneq ($(findstring HAL_USE_SDC TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_sdc_lld.c
endif
ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_serial_lld.c
endif
ifneq ($(findstring HAL_USE_SIO TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_sio_lld.c
endif
ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_spi_lld.c
endif
ifneq ($(findstring HAL_USE_TRNG TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_trng_lld.c
endif
ifneq ($(findstring HAL_USE_UART TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_uart_lld.c
endif
ifneq ($(findstring HAL_USE_USB TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_usb_lld.c
endif
ifneq ($(findstring HAL_USE_WDG TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_wdg_lld.c
endif
ifneq ($(findstring HAL_USE_WSPI TRUE,$(HALCONF)),)
PLATFORMSRC += ${CHIBIOS}/os/hal/templates/hal_wspi_lld.c
endif
else
PLATFORMSRC = ${CHIBIOS}/os/hal/templates/hal_lld.c \
${CHIBIOS}/os/hal/templates/hal_adc_lld.c \
${CHIBIOS}/os/hal/templates/hal_can_lld.c \
${CHIBIOS}/os/hal/templates/hal_crypto_lld.c \
${CHIBIOS}/os/hal/templates/hal_dac_lld.c \
${CHIBIOS}/os/hal/templates/hal_ext_lld.c \
${CHIBIOS}/os/hal/templates/hal_gpt_lld.c \
${CHIBIOS}/os/hal/templates/hal_i2c_lld.c \
${CHIBIOS}/os/hal/templates/hal_i2s_lld.c \
${CHIBIOS}/os/hal/templates/hal_icu_lld.c \
${CHIBIOS}/os/hal/templates/hal_mac_lld.c \
${CHIBIOS}/os/hal/templates/hal_pal_lld.c \
${CHIBIOS}/os/hal/templates/hal_pwm_lld.c \
${CHIBIOS}/os/hal/templates/hal_rtc_lld.c \
${CHIBIOS}/os/hal/templates/hal_sdc_lld.c \
${CHIBIOS}/os/hal/templates/hal_serial_lld.c \
${CHIBIOS}/os/hal/templates/hal_sio_lld.c \
${CHIBIOS}/os/hal/templates/hal_spi_lld.c \
${CHIBIOS}/os/hal/templates/hal_st_lld.c \
${CHIBIOS}/os/hal/templates/hal_trng_lld.c \
${CHIBIOS}/os/hal/templates/hal_uart_lld.c \
${CHIBIOS}/os/hal/templates/hal_usb_lld.c \
${CHIBIOS}/os/hal/templates/hal_wdg_lld.c \
${CHIBIOS}/os/hal/templates/hal_wspi_lld.c
endif
# Required include directories
PLATFORMINC = ${CHIBIOS}/os/hal/templates
# Shared variables
ALLCSRC += $(PLATFORMSRC)
ALLINC += $(PLATFORMINC)
|